Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I managed to mess up the partition table of my main media HDD. gParted cannot recognize it anymore. There's everything I ever had since my first PC. I ran "attempt data recovery" in gParted (it required gpart so I installed it), and now it's showing "searching for file systems on *my_hdd*".

Can anyone tell me if I did it right, or should I stop this process and use some of the solutions posted all around here? I activated "attempt data recovery" on instict, and then Googled out everythihg else. I also know that nothing has been written to my HDD, I messed it up trying to remove MBR from it, and deleted first 512bytes using "dd".

Anything you can say about this is helpful, as this computer is family shared.

Thanks in advance.

I already ran testdisk and it's processing the HDD already, much faster then gParted. It's on 15% already. I cannot find a hard drive to backup my existing one, but I'm hoping by reviews I've seen for testdisk that it will help without backing up my data...

Yes, the only thing I've done was erasing the first 512 bytes trying to erase MBR because I moved my OS's to a new smaller drive, and expanded the media partition of my old drive to fully utilise it's 500GB capacity only for media. But gParted screwed me along the way...

I believe that testdisk will help, I'll just give it time and post the results here.

Thank you!

I managed to fix it by just restoring the MBR using testdisk. For anyone that may have such problems in the future, there actually IS an option to restore MBR from the MBR backup. After that, I just set the partition type from BOOT to Primary, and all of my data is here, untouched.

Also, my primary disk that Ubuntu couldn't access, well the problem was some RAID metadata, that I erased. There are guides on the web on how to do this. After a reboot, my system works like nothing ever happenned.

share|improve this question
I am in the exact situation that you were in, in the first paragraph. Is it safe to stop the gpart tool while it is still "Searching for file systems on /dev/sdX? Should I just close gparted (there doesn't seem to be a cancel button)? – snapfractalpop Feb 16 '13 at 16:42
up vote 1 down vote accepted

I don't know anything about what you are currently running, but it should be possible to recover the partitions.

First: Get an empty hard disk that's big enough to hold a copy of your HDD. If those files have any value to you, you'll want to play safe and only work on a copy of the drive.

With the HDD and it's backup drive attached, run

sudo dd if=/dev/sdX of=/dev/sdY bs=1M

where sdX is your messed up drive and sdY the backup.

Now detach the original HDD and run testdisk (sudo apt-get install testdisk, then run sudo testdisk) on the copy like described in this detailed guide on the author's home page:

Basically, this will search for your partitions and allow you to write the partition table back on the drive. If you haven't done anything but borked the first 512 Byte, there shouldn't be any problems recreating the table.

share|improve this answer

Your Answer


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.