Re: 2.2.x corruption solved (Was Re: Statically linked 'tar')

Andrea Arcangeli (andrea@suse.de)
Tue, 12 Oct 1999 15:21:52 +0200 (CEST)


?On Tue, 12 Oct 1999, Martin Lucina wrote:

>Actually, I've figured it out now. What happened was that when I was
>installing the box, 'fdisk' somehow gave me a default end cylinder for the
>last partition on the disklabel which was actually one cylinder past the
>end of the disk. Hence the mysterious crash every time I did a make install

Ahhh I created a bogus partition on my machine too due the fdisk bug! And
to check if that was the case for me too I had the bad idea to:

cp /dev/zero /var/tmp

where /var is the last partition with the additional (out of bound) sector
included.

After some time the kernel crashed and I destroyed all partitions of my
hard disk. _all_. Note that the partition table was still fine. Only the
contents of the partitons (superblocks mainly) was completly screwed up.

fsck was complaining no-magic number.

fsck -B4096 -b xxx -y using a rasonable correct backup-superblock (it had
at least the magic number in the right place ;) continued running for 5/10
minutes then exited complaining something. Then fsck using the backup
superblock wasn't working anymore. So i run fsck with the master
superblock and it worked but then after 10/15 minutes of `yes` fsck
started complaining WARNING ERROR IN FSCK OR YOU HAVE THE DISK MOUNTED or
something like that. I hadn't the disk mounted at all...

Now (after some hour wasted in restoring the system completly :() I
removed 1 sector from the last partition and cp /var/tmp works fine.

This is my current partition that now works:

BSD label for device: /dev/sda

5 partitions:
# size offset fstype [fsize bsize cpg]
a: 1226752 2048 ext2 # (Cyl. 2 - 600)
b: 8192000 1228800 ext2 # (Cyl. 601 - 4600)
c: 17772544 0 unused 0 0 # (Cyl. 1 - 8678)
d: 6144000 9420800 ext2 # (Cyl. 4601 - 7600)
e: 2207744 15564800 ext2 # (Cyl. 7601 - 8678)

The old partition looked like this:

BSD label for device: /dev/sda

5 partitions:
# size offset fstype [fsize bsize cpg]
a: 1226752 2048 ext2 # (Cyl. 2 - 600)
b: 8192000 1228800 ext2 # (Cyl. 601 - 4600)
c: 17772544 0 unused 0 0 # (Cyl. 1 - 8678)
d: 6144000 9420800 ext2 # (Cyl. 4601 - 7600)
e: 2207744 15564800 ext2 # (Cyl. 7601 - 8679)
^

The partition `c' had the right vaue, while fsck suggested me to use 8679
for the end of the last partiton `e'. I didn't cared about the correct
partition c limit as partition c is a kind of black magic that I don't
like and I have to ignore in first place....

So this is a warning for people having partition c stopping before one of
your partition. fdisk is right about partition c. Trust its end and not
what fdisk suggests as end of other partitions.

I think the fix is simply a -1 in some line of fdisk... Looks like a
silly/typo bug. I cc'ed to the author of the bsdlabel in our fdisk. If he
can't fix that I can do that myself.

Andrea

-
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/