Windows Partition Destruction and Recovery

This may not apply to anyone who reads this, but it's my hope that if someone googles the title, this entry may be of help to them.

A couple of weeks ago I backed all of my important data up to my second hard drive, and freed up my primary hard drive to re-install my operating systems. I run Linux and XP right now, but that's not really important to the story.

When I went to install XP, I deleted in succession all of the partitions on the primary disk, with the intention of creating one 80GB partition for windows, since I have all my data on the second disk. Well, when I deleted the last partition on the first drive, it *also* deleted the partition table for the second drive. I don't know what caused this. Anyway, I pretty much freaked out, because that is six years of data on the second disk that no longer has a partition table.

When I booted into linux (the Ubuntu LiveCD), I couldn't mount the partitions on the second disk. I hadn't written anything to it since I saw windows remove the partition table, so I knew everything was still there. Gnome Partition Editor actually recognized the partitions. This seemed strange to me since the operating system (AND fdisk, cfdisk, sfdisk) did not recognize them. After asking around I learned that there's a new standard for partition tables (GPT), and this standard writes TWO partition tables, one at the beginning, and one at the end of the drive. Since I'd used the Gnome Partition Editor to create my partitions, and it supported the new standard, it had no trouble reading the second partition table at the end of the drive.

At this point my question was how to write that data back to the primary partition table, so that my OS recognized it. I ended up deciding to make a small change in the table (shrink a partition by a gig). That wrote the table back to the primary table.

And now everything works again, and my data is undamaged. Yay!!

Syndicate content