This is a discussion on Trashed partition table within the Linux General forums, part of the Linux Forums category; I've destroyed the partition table on /dev/hda on a dual-boot machine and am unable to access /home &...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I've destroyed the partition table on /dev/hda on a dual-boot machine
and am unable to access /home & /opt, which were on that drive, and the Windows OS plus data files which are on the VFAT partition. I can boot into Linux from a floppy (everything else is on /dev/hdb, including a recent backup of most of /home), but I have so far been unable to fix the problem with rescuept, parted, or gpart. I'm running RedHat 7.3. Any help appreciated. The problem happened when I'd removed hdb to put it into another machine to install Linux: I tried to reboot the old machine without hdb and the boot manager (BootMagic - a hangover from when I used Caldera Open Linux!) complained that one of the OSs was missing, then tried (several times) to boot into the default OS (which was Linux on /dev/hdb2, i.e. the missing one), then died. Since then it's impossible to boot from the MBR on /dev/hda. Booting from the Win 95 startup disk or the BootMagic rescue disk both get you into DOS, and it's possible to get a directory listing for the VFAT partition and to read at least some of the files. It's not possible to run Win95: the system complains that himem.sys is missing (it isn't, but of course it may be unreadable). DOS dir command gives the volume label as well as a file list, DOS fdisk however sees the disk as unformatted. This may mean that I could use DOS copy command to salvage files to a VFAT partition on /dev/hdb, although I have held back from doing this until I could first seek advice. Booting Linux I get these errors in dmesg (timestamp and hostname etc snipped): Partition check: hda:hda: dma_intr: status=0x51 { DriveReady SeekComplete Error } hda: dma_intr: error=0x40 { UncorrectableError }, LBAsect=0, sector=0 end_request: I/O error, dev 03:00 (hda), sector 0 unable to read partition table Linux fdisk just says "Unable to read /dev/hda" Gnu parted 1.4.24 says: Using /dev/hda Error: Unable to open /dev/hda - unrecognised disk label. Information: The operating system thinks the geometry on /dev/hda is 1023/64/63. gpart /dev/hda gives "*** Fatal error: cannot get sector size on dev(/dev/hda)." and if you set the sector size to 512 bytes (which I'm sure is correct given the geometry and size of the drive) you get "*** Fatal error: failed trying to use sector size 512." This happens even if you try to skip a number of sectors instead of starting at the beginning. /sbin/rescuept gives the following: # partition table of /dev/hda # total size 4124736 sectors unit: sectors read: Input/output error /sbin/rescuept: error reading sectors 0-1999 I don't know what the hell BootMagic did to cause the problem, but badblocks now reports the first 4 1k blocks as bad on a read-only test. I haven't yet tried using the rescue function of parted (I need a slightly newer build, but that's not a problem), so I don't know if it would work. I don't have a copy of the partition table, but I do know the approximate layout - /dev/hda1 VFAT 1 - 800 (approx); /dev/hdb2 Linux swap 800 - 880 (approx); /dev/hda3 ext3 880 - 2112 (approx). Would I need to mklabel first? Should I try doing a raw copy using dd (there's lots of space on the drive in the newer machine -- if so, what should I then do to get at the data? If at all possible I'd like to salvage the Win95 installation as well, although that may not be possible and I might have to settle for the data (assuming I can get that back). Many, many thanks for any help anyone can offer! -- Richard M Buck |