Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
I recovered my partition table with app-admin/testdisk
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
petlab
Apprentice
Apprentice


Joined: 03 May 2004
Posts: 290
Location: Armpit, Oregon

PostPosted: Sat Dec 31, 2005 11:57 pm    Post subject: I recovered my partition table with app-admin/testdisk Reply with quote

I accidentally messed up my partition table with cfdisk. I deleted / by mistake. I read that "fdisk doesn't do anything to the data, just the partition table." That meant that my data was still okay, it just wasn't listed in the partition table anymore.

I tried qtparted which is gui based, but I couldn't find out how to have it fix this problem. It looks fine for making partitions, maybe resizing them, but that's not what I needed.

Then I tried gpart. Well, it just threw "seek error" at me, even on good disks. Gpart is supposed to do what I want, but somehow no luck atm.

Finally, I tried testdisk. At first, it looked pretty limited. I tried using the /list option:

Code:
# testdisk /list


and it confirmed what I knew, that only my /boot partition was still listed in the table. So, I tried
Code:
# testdisk /debug

Now, this is what I call excellent. The screen looked pretty much like cfdisk: partition info at the top, and a text menu at the bottom. I picked [ANALYZE] and it found my root partition (ext3) and my old swap, too. Then I used the [WRITE] item to finish up.

Hope this helps.
_________________
Get Serious - Get JAWA CZ
Back to top
View user's profile Send private message
Cintra
Advocate
Advocate


Joined: 03 Apr 2004
Posts: 2111
Location: Norway

PostPosted: Sun Jan 01, 2006 6:51 am    Post subject: Reply with quote

Thanks for the info petlab
..sounds like an app to tuck away in my memory bank ;-)

perhaps you should add it to https://forums.gentoo.org/viewtopic-t-29306-highlight-.html as well..
_________________
"I am not bound to please thee with my answers" W.S.
Back to top
View user's profile Send private message
syg00
l33t
l33t


Joined: 23 Aug 2004
Posts: 907
Location: Brisbane, AUS

PostPosted: Sun Jan 01, 2006 7:00 am    Post subject: Reply with quote

It's brilliant.

However, go look for NeddySeagoons sig ...
Back to top
View user's profile Send private message
Cintra
Advocate
Advocate


Joined: 03 Apr 2004
Posts: 2111
Location: Norway

PostPosted: Sun Jan 01, 2006 7:41 am    Post subject: Reply with quote

syg00 wrote:
It's brilliant.

However, go look for NeddySeagoons sig ...

ah yes, very true ;-)

happy to report I'm not in that situation
the only XP app I still rely on is Acronis True Image (version 8!)
_________________
"I am not bound to please thee with my answers" W.S.
Back to top
View user's profile Send private message
jonner
n00b
n00b


Joined: 25 Jul 2002
Posts: 42

PostPosted: Sat Jan 28, 2006 10:44 am    Post subject: Re: I recovered my partition table with app-admin/testdisk Reply with quote

petlab wrote:
Then I tried gpart. Well, it just threw "seek error" at me, even on good disks. Gpart is supposed to do what I want, but somehow no luck atm.

Were you running this on an amd64 system? I ran into the exact same problem from gpart, then I noticed that the author says he has to test it on 64-bit in the TODO. I moved the disk to a system that's still an i686 system (though it has an Athlon64 and is about to become an amd64 system) and emerged gpart, where it seems to be working.
Back to top
View user's profile Send private message
petlab
Apprentice
Apprentice


Joined: 03 May 2004
Posts: 290
Location: Armpit, Oregon

PostPosted: Sun Jan 29, 2006 5:53 pm    Post subject: Reply with quote

Yes, amd64. I pretend not to hear when something is unstable on amd64 :)
_________________
Get Serious - Get JAWA CZ
Back to top
View user's profile Send private message
Hauser
l33t
l33t


Joined: 27 Dec 2003
Posts: 650
Location: 4-dimensional hyperplane

PostPosted: Sun Jan 29, 2006 6:00 pm    Post subject: Reply with quote

Still, it's safer to do a
Code:
# dd if=/dev/hda of=mbr.bak bs=512 count=1
Keep the mbr.bak file in a safe place, then if anything bad happens,
Code:
# dd of=/dev/hda if=mbr.bak bs=512 count=1
would bring the partition table back.
_________________
AMD Athlon XP 2600+; 512M RAM;
nVidia FX5700LE; Hitachi 120Gb
2.6.9-nitro4, reiser4, linux26-headers+nptl

Do I like to compile everything?
Positive definite!
Back to top
View user's profile Send private message
jonner
n00b
n00b


Joined: 25 Jul 2002
Posts: 42

PostPosted: Fri Feb 03, 2006 8:22 am    Post subject: Backup MBR Reply with quote

Backing up the MBR is certainly a good idea, but you have to think of it before you make a dumb mistake, like I did. It seems that tools like gpart are good at saving one from one's own dumb mistakes. Also, most of my filesystems are in LVM volumes (the one I lost was the only one that happened to be in a DOS-style partition), so backing up the MBR doesn't help in recovering them, though backing up LVM metadata might.

Also, I contacted the author of gpart, who told me that he hasn't tried to make it work on x86_64 and that it's almost unsupported. He sent me the newest, unreleased version, which I'll look at. I don't know if I'll make any progress, since it'll be delving into areas that are completely new to me.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum