LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 08-02-2004, 09:11 AM   #1
SYakush
LQ Newbie
 
Registered: Aug 2004
Distribution: SuSE9.0
Posts: 3

Rep: Reputation: 0
Partition table recovery


Hi,

I've run into problems with my 120 GB Seagate HDD. It used to hold four primary partitions
(hdb1 -reiserfs, hdb2 - swap, hdb3 - reiserfs, hdb4 - ext2). I took the disk out of computer for a while, then put it back and found it wouldn't boot. fdisk says

> fdisk /dev/hdb

The number of cylinders for this disk is set to 19483.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

Unable to seek on /dev/hdb

Here is what sfdisk says:

-----------------------------------------------------
> sfdisk -l /dev/hdb

Disk /dev/hdb: 14593 cylinders, 255 heads, 63 sectors/track
Warning: extended partition does not start at a cylinder boundary.
DOS and Linux will interpret the contents differently.
llseek: Invalid argument

sfdisk: seek error on /dev/hdb - cannot seek to 2180031657
Warning: The partition table looks like it was made
for C/H/S=*/191/63 (instead of 14593/255/63).
For this listing I'll assume that geometry.
Units = cylinders of 6160896 bytes, blocks of 1024 bytes, counting from 0

Device Boot Start End #cyls #blocks Id System
/dev/hdb1 178468+ 1749- 180213- 1084248621+ 83 Linux
start: (c,h,s) expected (1023,190,63) found (128,129,1)
end: (c,h,s) expected (1023,190,63) found (959,190,63)
/dev/hdb2 180212+ 1837- 178558- 1074288353 82 Linux swap
start: (c,h,s) expected (1023,190,63) found (959,190,63)
end: (c,h,s) expected (1023,190,63) found (959,190,63)
/dev/hdb3 180299+ 2707- 179341- 1079003430+ 83 Linux
start: (c,h,s) expected (1023,190,63) found (959,190,63)
end: (c,h,s) expected (1023,190,63) found (959,190,63)
/dev/hdb4 181171+ 19482- 195245- 1174686251+ f Win95 Ext'd (LBA)
start: (c,h,s) expected (1023,190,63) found (959,190,63)
end: (c,h,s) expected (1023,190,63) found (959,190,63)

---------------------------
> sfdisk -d /dev/hdb
Warning: extended partition does not start at a cylinder boundary.
DOS and Linux will interpret the contents differently.
llseek: Invalid argument

sfdisk: seek error on /dev/hdb - cannot seek to 2180031657
# partition table of /dev/hdb
unit: sectors

/dev/hdb1 : start=2147516479, size=2168497243, Id=83
/dev/hdb2 : start=2168497306, size=2148576706, Id=82
/dev/hdb3 : start=2169541212, size=2158006861, Id=83
/dev/hdb4 : start=2180031657, size=2349372503, Id= f

It seems to me the partition table gone mad. Does anybody have a clue if the partition table can be recovered somehow or, at least, how to recover the data from the disk.
Any help is very much appreciated!
 
Old 08-02-2004, 12:32 PM   #2
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,300

Rep: Reputation: 138Reputation: 138
Have you changed anything in your bios setup since you removed an reinstalled the drive? In particular, if you changed from/to lba/auto mode for your hard drives in your bios that could cause a problem. Try switching that and see if it detects properly.
 
Old 08-03-2004, 08:16 AM   #3
SYakush
LQ Newbie
 
Registered: Aug 2004
Distribution: SuSE9.0
Posts: 3

Original Poster
Rep: Reputation: 0
No, I haven't changed anything in bios, always used auto detection. The disk still detects as 120GB in POST. Do you think it is safe to change BIOS settings (C/H/S) and try to read the disk? I mean, can this damage anything if I try just to read the disk?

Also, I was thinking about changing the start address of partition /dev/hdb1 to 63 with sfdisk (this is what I have on /dev/hda1) and then perhaps using gpart to find partition boundaries. But as I am totally newbie on this, I do not know if this could help or all my data will be destroyed.
 
Old 08-03-2004, 11:38 AM   #4
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,300

Rep: Reputation: 138Reputation: 138
You apparently have two hard drives, hda and hdb. Was that the original configuration? Are you using a drive overlay program on any of the drives? Overlay programs are used to get around hard drive size limitations in the bios; they can frequently cause problems since they use a different method for sector translation than the bios.

Changing anything in the partition table risks losing the data on the drive so that's the last thing I would try. If you have any livecds around like knoppix, try booting off that and see if it can read the data on hdb. If it can, back anything on hdb that you want to save since your at risk of losing the data. If you have space on hda, knoppix has a partition imaging program included called partimage which can be used to image each partition on hdb assuming hdb can be read in knoppix. If you can do this, it would be the safest since you can image the hdb partitons and save them on hda then if you screw things up on hdb you can repartition it and restore the the hdb partitions from the image files. Partimage has about 2 to 1 compression.

If the data on hdb is important your first priority should be to access and back up the data since it's in danger of being lost.

Here's a link that discusses sector translation problems from a windows perspective that you might find useful in troubleshooting:

http://service1.symantec.com/SUPPORT.../1996112575859

After backing up, I think the first thing I would try is setting the bios to lba and see if that helps.
 
Old 08-04-2004, 04:55 AM   #5
SYakush
LQ Newbie
 
Registered: Aug 2004
Distribution: SuSE9.0
Posts: 3

Original Poster
Rep: Reputation: 0
Hi,
Writing to say that my nightmare is over! When no bios manipulations helped (actually, auto was equivalent to lba, so setting it manually had no effect), I desperately googled around one more time and was lucky to come across a small GPL(!) utility named testdisk

http://www.cgsecurity.org/index.html?testdisk.html

This utility has miraculously discovered what partitions I had on /dev/hdb and wrote the corrected partition table. I got all my data back intact. Highly recommended!

Anyway, many thanks for the advice and response I received on my post!
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"No partition table or unknown signature on partition table" 10.1 install madcow007 Slackware 4 02-09-2009 11:04 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
Slack 10: S-ATA = "No partition table or unknown signature on partition table"? dissolved soul Slackware - Installation 11 08-05-2004 02:12 PM
File recovery after partition table damage - XFS file system gracecourt Linux - General 2 01-13-2004 03:53 PM


All times are GMT -5. The time now is 10:47 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration