corrupted partition table and Ext2fs superblocks

Peter Chang (peter@eexpc.eee.nott.ac.uk)
Wed, 28 Jul 1999 16:17:39 +0100 (BST)


Hi all,

I am trying to recover a corrupted disk and (needless to say) require
some help.

It seems that my home system (a Pentium MMX 166, VX chipset running RH5.1
with 2.0.36 kernel) intermittently corrupts the partition tables (PTs). This
happens after a clean shutdown and reboot the following day/night. I can
cope with this, though it's tiresome, by booting from an emergency floppy
boot/root set and using fdisk to repair the table (from hardcopy).

The latest corruption to occur is a lot worse: it seems that not only has
the PT been corrupted but the superblocks on the ext2 filesystems are out of
sync with the repaired PT.

Why does the corruption occur? How do I go about repairing it?

Here's the nitty gritty:

-------------------------------------------------------------------------

1) The drive is a Fujitsu M1624TAU 2Gb. It has 64H, 63S, 1023C in LBA mode
with cylinders of 4032 sectors.

-------------------------------------------------------------------------

2) Output from sfdisk -l -x /dev/hda on repaired PT:

# partition table of /dev/hda
unit: sectors

/dev/hda1 : start= 63, size= 1612737, Id= 6, bootable
/dev/hda2 : start= 1612800, size= 68544, Id=82
/dev/hda3 : start= 1681344, size= 2443392, Id= 5
/dev/hda4 : start= 0, size= 0, Id= 0

/dev/hda5 : start= 1685376, size= 133056, Id=83
- : start= 1818432, size= 133056, Id= 5
- : start= 1681344, size= 0, Id= 0
- : start= 1681344, size= 0, Id= 0

/dev/hda6 : start= 1818495, size= 132993, Id=83
- : start= 1951488, size= 790272, Id= 5
- : start= 1818432, size= 0, Id= 0
- : start= 1818432, size= 0, Id= 0

/dev/hda7 : start= 1951551, size= 790209, Id=83
- : start= 2741760, size= 790272, Id= 5
- : start= 1951488, size= 0, Id= 0
- : start= 1951488, size= 0, Id= 0

/dev/hda8 : start= 2741823, size= 790209, Id=83
- : start= 3532032, size= 592704, Id= 5
- : start= 2741760, size= 0, Id= 0
- : start= 2741760, size= 0, Id= 0

/dev/hda9 : start= 3532095, size= 592641, Id=83
- : start= 3532032, size= 0, Id= 0
- : start= 3532032, size= 0, Id= 0
- : start= 3532032, size= 0, Id= 0

-------------------------------------------------------------------------

3) Output from findsuper /dev/hda (cleaned up and annotated):

thisoff block fs_blk_sz blksz grp last_mount

862913536 842689 66528 0 0 Sun Jul 25 20:20:54 1999
[hda5: 1st SB is on sector 1685378 = hda5 start + 2 ]
871302144 850881 66528 0 0 Fri Jul 23 00:40:04 1999
[plus 7 more copies 8192 blocks apart]

931038208 909217 66528 0 0 Thu Jul 22 01:29:45 1999
[hda6: 1st SB on sector 1818434 != hda6 start + 2 ]
939426816 917409 66528 0 0 Thu Jul 22 01:29:45 1999
[plus 7 more copies 8192 blocks apart]

999162880 975745 395136 0 0 Thu Jul 22 01:29:42 1999
[hda7: 1st SB on sector 1951490 != hda7 start + 2 ]
1007551488 983937 395136 0 0 Sun Jul 4 16:52:46 1999
[plus 47 more copies 8192 blocks apart]

1403782144 1370881 395136 0 0 Thu Jul 22 01:29:43 1999
[hda8: 1st SB on sector 2741762 != hda8 start + 2 ]
1412170752 1379073 395136 0 0 Sun Jul 4 16:52:47 1999
[plus 47 more copies 8192 blocks apart]

1808401408 1766017 296352 0 0 Thu Jul 22 01:29:41 1999
[hda9: 1st SB on sector 3532034 != hda9 start + 2 ]
1816790016 1774209 296352 0 0 Sun Jul 4 16:52:45 1999
[plus 35 more copies 8192 blocks apart]

-------------------------------------------------------------------------

Summary & analysis:

hda contains a FAT16, a Linux swap and an extended partition on the primary
entries. The 5 logical partitions are all Linux.

Only hda5 (the root fs) is recognised by e2fsck. The other (hda[6-9])
partitions are misaligned -- that is, the 1st SB = start - 63 + 2.
In other words the start of the misaligned partitions are 1 track (63
sectors) too late. Is this the fault of fdisk?

Any help appreciated.

Peter

PS please CC me as I'm not on l-k

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/