...making Linux just a little more fun!

<-- 2c Tips | TAG Index | 1 | 2 | 3 | 4 | 5 | 6 | 7 | Knowledge Base

The Answer Gang

By Jim Dennis, Jason Creighton, Chris G, Karl-Heinz, and... (meet the Gang) ... the Editors of Linux Gazette... and You!

(?) Fsck woes

From James Scott-Brown

Answered By: Thomas Adam, Sindi Keesan, Heather Stern

Recently, My GNU/Linux system (Fedora Core 3) was shut down uncleanly. It booted to single-user mode and told me to run fsck manually, which I did. After asking whether it should correct a number of error (to which I replied 'y'), it reported that the file system was altered and the system should be rebooted. So, I entered the 'exit' command and the system rebooted.
When it rebooted, the system again reported the system had shut down uncleanly. It ran fsck again, and it produced the same error messages. It fixed these, and I rebooted. This happened again . and again . and again.. more than 5 times. I booted off a live CD (KNOPPIX) and verified that all the system files were actually there - they were. What should I do?
(!) [Thomas] Yup, this sometimes happen. I'd boot off the knoppix CD, chroot over to your FC installation and use "tune2fs":
tune2fs -c 100 -C 1
(!) [Sindi] I had a crash with Slackware one time and was able eventually to get it booting by reading the manual for e2fsck and typing
e2fsck -b 16385 -n /dev/hdb2
(linux is on hdb2, not mounted)
-b means use alternate superblocks because the regular one got messed up during the crash. Linux keeps extra copies.
16385 is one of my alternate superblocks. When you first run mke2fs it gives you a list of about five of them spread out over the partition. My partition was 1 or 2G. Larger partitions have them in different places and you can probably look up likely superblocks on the web and try this approach.
-n means answer no to all questions, or you can do that manually
superblocks seem to be multiples of a base number plus 1: 8193 16385 (and probably 3 and 4x 8192 + 1, etc.)
Maybe someone else with your size drive can suggest where they are.
I have e2fsck on a 2-floppy linux for this sort of use.
(!) [Heather] According to the man page for mke2fs, you could ask it where it put them:
-n     causes mke2fs to not actually create a filesystem, but display
       what  it  would do if it were to create a filesystem.  This can
       be used to determine the location of the backup superblocks for
       a  particular filesystem, so long as the mke2fs parameters that
       were passed when the filesystem was originally created are used
       again.  (With the -n option added, of course!)

This page edited and maintained by the Editors of Linux Gazette
HTML script maintained by Heather Stern of Starshine Technical Services, http://www.starshine.org/

Each TAG thread Copyright © its authors, 2005

Published in issue 118 of Linux Gazette September 2005

<-- 2c Tips | TAG Index | 1 | 2 | 3 | 4 | 5 | 6 | 7 | Knowledge Base