You are not logged in.

#26 2013-10-03 23:12:20

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,140

Re: drive lost all 4 partitions during power off on early boot stage

wolfdogg wrote:

in the end, that sparse option might have been the one that saved my data, incidentally, since if i had used it, assuming all the sectors are zero as they appear, then the image wouldnt have writter over 250GB across two different drives effectively erasing any data that was there before.

You mean you wrote that image over the top of data you wanted to recover? Why?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#27 2013-10-05 10:06:22

wolfdogg
Member
From: Portland, OR, USA
Registered: 2011-05-21
Posts: 545

Re: drive lost all 4 partitions during power off on early boot stage

no definitely not, i didn't do that.   i still have both the original drive, and the image from ddrescue.

I was repairing my other hard drives prior to this happening, this was my temporary backup for some important files it was retaining until the maintenance was complete, and you know how they switch back and forth sometimes(/dev/sda /dev/sdb, etc..) depending on if you have a scsi card, and which rescue disk you run.  some scsi cards are recognized by some rescue programs and not others, so the drive letters were switching now and then.  it may have done something to it.

However, it WAS booting after i ran those operations on the other drives, this is what i don't get is how it got messed up....  so im not sure what happened at all.

i have thought about this day in day out, and i cant seem to remember any mistake i made.  there is one possibility that when i was trying to boot from a usb stick to replace the firmware on another drive it did something.  i didnt ever get to run the firmware from the usb stick since the stick would NEVER actually boot into the firmware program, it just got stuck after 'booting from cd, booting from usb' etc.. or whatever it said, but nothing ever loaded.    The only thing i can think of is while i wating to see if the darn usb stick was going to boot is it slammed the drives somehow automatically.

i still think it was the power cycle that i hit it with JUST after the drive mounted.  you know i lost my files before using ext4, and never on ext3.  So which file system SHOULD i use to reduce the likelihood of this happening again???????????????

EDIT: oh crap i misunderstood what you were asking me, i was telling you how the data got lost initially.  In answer to your question, no what i was saying is kind of complicated, think of it like this
drive 1, operating system
drive 2,3,4,5 backup array. 
important files are on backup
drive 2,3,4,5 need maintenance. 
take MOST important files on drive 2,3,4,5 array and put them on drive 1.
now reformat drive 2,3,4,5
oh shit somethign just happened to drive 1 even though it was booting 2 minutes ago

so now since i cant recover from drive 1, apparently, without more suggestions, i might be able to recover from drive2,3,4,5.  but, and here is the big BUT, i just wrote the image of drive 1 like 3 times on top of drive 2, and drive 3 (thats 250GB 3 times).    so Unless my files are on drive 4,they may have gotten erased. 

if i had use sparse, it would have recognized the sectors were empty, and wouldnt have erased anything (250GB 3 times) on drives 2 and 3.   so effectively my chances of recovering anything from drives 2 and 3 are pretty slim since that data was over written by the ddrescue image in several places. 

see what im saying?

Last edited by wolfdogg (2013-10-05 10:25:38)


Node.js, PHP Software Architect and Engineer (Full-Stack/DevOps)
GitHub  | LinkedIn

Offline

#28 2013-10-23 19:07:35

svacko
Member
Registered: 2008-07-08
Posts: 9

Re: drive lost all 4 partitions during power off on early boot stage

i've just experience almost the same issue. GRUB2 & GBT & LVM & ext4. Archlinux OS just froze, after a time my gf just used power button to force poweroff. After system is not more able to boot. Grub is returning:

error: unknown filesystem.
grub rescue>

When i checked the disk using any other live distro, i see there are absolutely no partitions, disk is super clean. I cannot identify the culprit no address the evil, but is there anyone who can explain what can cause this? I cannot imagine any evil piece of code that can completely destroy partition table with all the data on it..

HDD looks OK after SMART tests...

Offline

#29 2013-10-31 06:04:52

wolfdogg
Member
From: Portland, OR, USA
Registered: 2011-05-21
Posts: 545

Re: drive lost all 4 partitions during power off on early boot stage

thats odd, if its just the partition table you should try running testdisk.  you can boot the pc with the arch setup disk and run it from there.  testdisk should/might find your partition tables.  in my case it was as if the data was zeroed too.  I would guess with yours its just the partition table and not the data. 

just BE CAREFUL what you do if your data is important on that disk because the data is probably ALL still there.  If you run test disk, i would try to recover the partition table only, but don't do anything to the rest of the disk unless you use ddrescue to create an image of that drive elsewhere, as mentioned earlier in this post.


Node.js, PHP Software Architect and Engineer (Full-Stack/DevOps)
GitHub  | LinkedIn

Offline

#30 2013-10-31 22:35:05

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,140

Re: drive lost all 4 partitions during power off on early boot stage

Also, what did you use to check the disk in the other distro? I would try gdisk as it might be able to recover the table from the backup table stored at the other end of a disk formatted with GPT. If you by any chance backed up your table using gdisk earlier, you can also restore it from the backup file.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#31 2013-11-03 09:32:12

wolfdogg
Member
From: Portland, OR, USA
Registered: 2011-05-21
Posts: 545

Re: drive lost all 4 partitions during power off on early boot stage

good point, the gdisk backup should almost certaintly be the most recent backup, therefore not the wrong backup right cfr?  That would definitely be alot easier to recover the partition that way before moving to testdisk, assuming its a GPT partition table.

Last edited by wolfdogg (2013-11-03 09:32:47)


Node.js, PHP Software Architect and Engineer (Full-Stack/DevOps)
GitHub  | LinkedIn

Offline

#32 2013-11-03 16:22:51

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,140

Re: drive lost all 4 partitions during power off on early boot stage

Well, if you saved it to file I guess it depends when you did it. But the backup at the other end of the disk is guaranteed most recent because GPT is just defined that way so any tool used to create a GPT partition table should have written the backup as part of writing the table at all. Unlike MBR, GPT itself includes a backup to provide better chance of recovering in case the primary table is damaged. gdisk (and probably other tools) can basically restore the primary table from the backup table, even if you didn't back the table up to file. Of course, it depends what's been damaged but because the backup is at the other end of the disk and isn't routinely accessed, I guess it reduces the chance that both the primary copy and the backup will be damaged at the same time. It is certainly worth trying this before resorting to other options because if the backup table is intact, it would be very simple (and likely extremely effective) to recover the table this way.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

Board footer

Powered by FluxBB