Archive for the ‘Magic’ Category

Jan
04
iled Under (Restore, Magic, Software, Console) by Οὐρανός on 04-01-2008

Screenshot of TestdiskIf you’ve played around with installing a lot of distributions you’ve made a mistake atleast once, and broken your partition table. Or atleast I hope so, because I’ve done it more than my fair share of times. The most recent was when I was installing Ubuntu 7.10 64-bit and I crashed GPartEd while partitioning. My problem was that I already had four partitions [1] on the hard drive and I also wanted a swap partition but I made a mistake somewhere along the line and ended up with a logical partition outside of an extended partition. This is very bad stuff.

What happened next was terrifying, both GPartEd and Ubuntu’s ubiquity installer claimed the entire drive was empty. Now this is very bad, because there are files on this computer that I adore and would hate losing. I was just about ready to kill myself when I found a forum thread on the Ubuntu Forums[2] that mentioned testdisk. It’s in the universe repositories and you can get it by enabling Universe in System » Administration » Software Sources and then running:
sudo aptitude install testdisk
It also creates a backup of your partition table if you want. I had a broken one but I wanted more than one shot at it so I emailed myself the backup and got ready to put my hope to the test. When it happened it was almost anticlimactic, three menus later (all in a simple user friendly style) I had my partition table back! And all the data stored on the drive was accessible once more. I was incredibly happy about that, and made a small donation to the software author. The single most useful piece of software I’ve ever used on Linux.

[1] Ankit Chaturvedi on Partitions
[2] My Forum Thread with the problem.