LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
 
Search this Thread
Old 03-03-2008, 09:40 AM   #1
1veedo
Member
 
Registered: Dec 2004
Location: WV, USA
Distribution: Gentoo, Debian
Posts: 186

Rep: Reputation: 34
Harddrive Partition Table errased?? (data recovery)


This is strange for a while I didn't think my harddrive was working. Recently though I pluged the broken hd back in and noticed that the bios recognized 200-oddgb HD so I booted a liveCD and ran cat /dev/hda. My data is clearly there but there's no partition table or any way to actually read the harddrive.

Like I can cat for things I know are on the hd and it finds it.
Code:
cat /dev/hda | grep bookmarks.html
Binary file (standard input) matches
cat /dev/hda | grep "Civilization 4"
Binary file (standard input) matches
I can also look at it and I see grub close to the begining, reiserfs, and even entire text files like bash scrips I've written. I also saw a file that I'm pretty sure I deleated but I guess that makes sense because deleated files aren't actually explicitely removed.

I know there are plenty of other threads about recovering data but this seems like I could almost create a reiserfs and two ext2 partitions and everything would be there (the other two were actually ext3).
 
Old 03-03-2008, 09:51 AM   #2
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
The kernel obviously detects the HDD so use the Live CD and post here the output of
Code:
fdisk -l
 
Old 03-03-2008, 09:55 AM   #3
Lenard
Senior Member
 
Registered: Dec 2005
Location: Indiana
Distribution: RHEL/CentOS/SL 5 i386 and x86_64 pata for IDE in use
Posts: 4,790

Rep: Reputation: 56
Have attempted to use parted to possible recover the partition table???

http://www.gnu.org/software/parted/m...ted.html#SEC24
 
Old 03-03-2008, 10:06 AM   #4
1veedo
Member
 
Registered: Dec 2004
Location: WV, USA
Distribution: Gentoo, Debian
Posts: 186

Original Poster
Rep: Reputation: 34
fdisk didn't have anything too useful is why I didn't post it.
Code:
[root@localhost live]# fdisk -l

Disk /dev/hda: 203.9 GB, 203928109056 bytes
255 heads, 63 sectors/track, 24792 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/hda doesn't contain a valid partition table
Quote:
Originally Posted by Lenard View Post
Have attempted to use parted to possible recover the partition table???

http://www.gnu.org/software/parted/m...ted.html#SEC24
I don't know exactly where the partitions used to be.

Btw when trying print parted says "Error: Unable to open /dev/hda - unrecognised disk label."

Last edited by 1veedo; 03-03-2008 at 10:09 AM.
 
Old 03-03-2008, 10:47 AM   #5
1veedo
Member
 
Registered: Dec 2004
Location: WV, USA
Distribution: Gentoo, Debian
Posts: 186

Original Poster
Rep: Reputation: 34
I ran testdisk and all my data appears to be back. The mbr doesn't work though and I tried installing grub with these error messages,
Code:
grub-install --root-directory=/media/disk-1/boot /dev/hda1
Probing devices to guess BIOS drives. This may take a long time.
Unknown partition table signature
Unknown partition table signature
Unknown partition table signature
Unknown partition table signature
Unknown partition table signature
Unknown partition table signature
The file /media/disk-1/boot/boot/grub/stage1 not read correctly.
 
Old 03-03-2008, 11:23 AM   #6
Lenard
Senior Member
 
Registered: Dec 2005
Location: Indiana
Distribution: RHEL/CentOS/SL 5 i386 and x86_64 pata for IDE in use
Posts: 4,790

Rep: Reputation: 56
Well the first partition should start at sector zero, so try that as your starting point. Choose the ending point of your hard drive (24792) for the first partition. Choose the end of the first partition plus one for the next partition and so on.
 
Old 03-03-2008, 12:03 PM   #7
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by 1veedo View Post
Code:
grub-install --root-directory=/media/disk-1/boot /dev/hda1
You really want
Code:
grub-install --root-directory=/media/disk-1/boot /dev/hda
You want to GRUB on the disk, not on the first partition of the disk.
 
Old 03-03-2008, 03:10 PM   #8
1veedo
Member
 
Registered: Dec 2004
Location: WV, USA
Distribution: Gentoo, Debian
Posts: 186

Original Poster
Rep: Reputation: 34
Thanks. It still gave me the same errors but I tried a different liveCD and it worked just fine.

I cant believe it was so easy testdisk works really well.
 
Old 03-03-2008, 03:18 PM   #9
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 656Reputation: 656Reputation: 656Reputation: 656Reputation: 656Reputation: 656
Was this hard drive in the system when you installed linux? Is it the main drive with the system on it? When you install Linux, often an MBR backup is stored in /boot. If you backed up the /boot directory in the past, and this is the drive that the system booted from when you installed, you can use dd to restore the backup_mbr file to the first block of the drive.

If you saved a backup of the fdisk -l listing, you could use that info to recreate the partition table.

---

Sorry, I was slow typing and didn't see that you had the situation resolved. When you get it going again, be sure to run fdisk -l and print it out. This could help in the future.

Last edited by jschiwal; 03-03-2008 at 03:21 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Partition Table recovery Tools? moeFEAR Linux - Software 5 11-01-2007 05:51 PM
Changed Partition Table Data Recovery Ext3 demmylls Linux - General 1 03-07-2007 05:44 AM
partition table recovery phoenix7 Linux - Distributions 8 08-10-2005 12:47 AM
HDD Partition Table Recovery nikhil Linux - Hardware 10 03-04-2005 10:08 AM
Partition table recovery SYakush Linux - General 4 08-04-2004 04:55 AM


All times are GMT -5. The time now is 04:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration