Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

My partition table used to look like this:

[/boot (ext2)] [logical: [linux(ext4) /][linux(ext4) /home][linux swap] ] [windows 7]

Windows wasn't booting right, so I figured I'd just reinstall it, no biggie. As expected, it overwrote the MBR so I booted into a linux live-cd in order to run grub-install. However, much to my chagrin, my logical partition is now inexplicably empty. Both Windows and Linux see it as unallocated free space, albeit still inside a logical partition. The boot partition at the beginning of the drive seems untouched.

I'm rather peeved at this (seriously, wth windows, wth) and if anyone knows why this happened I'd be interested to know. More importantly, however, is how do I get my partitions back?

Update:

running gpart, I get:

Begin scan...
Possible extended partition at offset(101mb)
   Possible partition(Linux ext2), size(39997mb), offset(102mb)
   Possible partition(Linux ext2), size(381143mb), offset(40099mb)
End scan.

Checking partitions...
   Partition(Linux ext2 filesystem): logical 
   Partition(Linux ext2 filesystem): orphaned logical 
Ok.

Guessed primary partition table:
Primary partition(1)
   type: 005(0x05)(Extended DOS)
   size: 429343mb #s(879294464) s(208845-879503308)
   chs:  (13/0/1)-(1023/254/63)d (13/0/1)-(54746/139/62)r

Primary partition(2)
   type: 000(0x00)(unused)
   size: 0mb #s(0) s(0-0)
   chs:  (0/0/0)-(0/0/0)d (0/0/0)-(0/0/0)r

Primary partition(3)
   type: 000(0x00)(unused)
   size: 0mb #s(0) s(0-0)
   chs:  (0/0/0)-(0/0/0)d (0/0/0)-(0/0/0)r

Primary partition(4)
   type: 000(0x00)(unused)
   size: 0mb #s(0) s(0-0)
   chs:  (0/0/0)-(0/0/0)d (0/0/0)-(0/0/0)r

It seems to have only found the missing partitions (those offsets look right-ish). The two partitions that it summarizes in the first two lines of output are the correct sizes and offsets of the missing partitions. However, the information below only shows a single partition, which represents the whole of the extended partition, and no information about the logical partitions it displayed above.

Update2:

At this point I've made a new logical partition that spans the entire extended partition, and have a very large for loop going, running

dumpe2fs /dev/sda5 -o superblock=$i

does that even make sense? I'm getting desperate :(

share|improve this question
    
What exactly did you do when reinstalling? It's typical for the Windows OS installer (among others) to completely wipe the HDD unless you specify otherwise. –  Bob May 27 '12 at 9:38
    
I installed it over the previous windows installation partition. Everything went exactly as expected, and the Windows 7 partition is in the same place, same size, etc. Only my logical partition is now inexplicably unallocated space :< –  Mala May 27 '12 at 9:45
    
I'm seeing salingfamily.net/trav/linux/lost_partition.html and tldp.org/HOWTO/Partition/recovering.html as possible solution candidates, I'm just rather hoping somebody might have suggestions / tips –  Mala May 27 '12 at 9:48

1 Answer 1

I eventually got the partitions back using TestDisk (https://www.google.com/search?sugexp=chrome,mod=5&sourceid=chrome&ie=UTF-8&q=testdisk) which worked phenomenally quickly and well. Things were messy though because somehow my restored partition table overlapped, so I just mounted them individually and tarred them to an external hard drive, deleted the filesystems, made new ones and copied the files back. Took the better part of the night, but yeah...

I'm keeping backups of my partition tables from now on. Seriously, there is NO reason not to do this since it's not like they change particularly often. Just make a copy and upload it to Google Drive or to some webspace or something.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.