fsck -c usage question

Mark C. Allman mcallman at allmanpc.com
Wed Nov 7 18:09:47 UTC 2007


System: 2.6.22.9-91.fc7, Dell XPS M1710 laptop, 80GB HD, 2G ram

>From what I've read, it's a good idea to occasionally have fsck run when
you reboot a system.  Also, I've had Fedora lock up a few times (over
the past year, BTW, so I'm not complaining!) such that I had to power
off and back on to restart.

What I do to have fsck run on startup:
1.  Create /fsckoptions with the switches I want to supply to fsck
2.  Run "shutdown -rF 0' to create /forcefsck and reboot.
Note: When fsck is finished after the reboot the /fsckoptions
and /forcefsck files are removed automatically.

In reading about scanning for bad blocks, the recommended way is to run
fsck with the -c switch.  Since I hadn't checked for bad blocks before,
I decided last night to run that check as well.  So I
created /fsckoptions with the one line of options I wanted fsck to use.
The options are  "-p -c -V."  BTW, I think the "-p" switch isn't
necessary (it's there on the fsck command line anyway) but it isn't a
problem to explicitly specify it.

What resulted is that, on restart, fsck ran the bad block check (or
appeared to), ran the several-step file system check, then printed two
or three lines and quickly rebooted.  The first line looked something
like "************ LINUX REBOOT **************" from what I could catch.
The problem is that the /forcefsck and /fsckoptions files aren't removed
as they should be, so the reboot just starts the process all over again,
then again, and on and on.

So what am I missing?  If I left something out in my description please
ask!

Thanks,

-- Mark C, Allman, PMP
-- Allman Professional Consulting, Inc.
-- www.allmanpc.com, 617-947-4263

BusinessMsg -- the secure, managed, J2EE/AJAX Enterprise IM/IC solution







More information about the fedora-list mailing list