A good boot-time FSCK script?
I've installed LFS Linux lately and everything is great... Except the boot-time fsck script. Basically that script assumes there's someone there to push enter any time something goes wrong. I do remote administration a lot and it's not good for me to have servers hang on reboot because a "failed fsck" alert appears on the screen and requires a keystroke to continue booting.
I've fleshed out some requirements I have for a good boot-time fsck script. I'm wondering if anyone here has seen anything that comes close the the following:
*Boot script (or fsck portion of boot script) will not require a keystroke to continue under any circumstances.
*Successful boot up is top priority. No condition (including failed fsck) will prevent system from at least trying to mount / and boot.
*Errors running fsck will be logged or perhaps mailed to root.
Any ideas folks? Thanks in advance.
Depending on what filesystems you use you will have different options for the fscking tool for that specific filesystem. e2fsck for ext2fs for instance supports the -p ("preen") that will automatically repair the filesystem without asking any questions. This flag is considered safe, and the -a flag supported by some other fsck tools and which does basically the same thing, is *not* considered safe. You may want to read up on the man pages for the fscking tools you want to use.
This is probably not what you wanted to hear/read, but there's a reason why fsck behaves this way.
Even if the -a -A (-p -A) options are set (they probably are), fsck will ask you to make choices if it's 'confused'. The use of the -a (-p) options is regarded as 'dangerous', although just about every distro uses it.
If your system gets to the point where it cannot repair the fs by itself, it's not a good idea to ignore this and (try to) mount partions. Depending on the errors that surfaced, you will have a very unstable (disk)situation on your hands and (unrepairable) errors may be the result. Worst case: 1 (or more) partitions become unusable.
If you still want to walk this path, take a look at the fsck script and reprogram the part that handles the errorhandling (please don't...... :) )
Hope this helps.
|All times are GMT -5. The time now is 07:54 AM.|