On 2011-12-23 18:36:05 (-0800), John Andersen wrote:
On 12/23/2011 4:27 PM, Carlos E. R. wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 2011-12-24 00:26, Istvan Gabor wrote:
Following the drives' states (actual mount count) is not an option as I have ~15 partitions, some mounted automatically, some by users if necessary.
It would if you can track the mount count and the maximal count, so as to predict “next time will fsck one drive”. If this is checked by an script on boot, it might help.
Good idea.
s/Good/Great/
Why not check this on shutdown, and offer the ability to fsck and shutdown when completed?
something on the order of this (untested) bit, could go in the logout 'function' (somewhere before interaction with the user is lost): for FS in $(mount | grep ext | cut -f 1 -d \ ); do eval $(tune2fs -l /dev/${FS} | grep -i "mount count" |\ sed -e 's/ /_/g ;s/:/=/ ; s/=_+/=/') if [ ${Mount_count} -eq ${Maximum_mount_count} ] ; then echo "$FS will be fsck'ed at next mount, blablabla, now?" read Answer if [ "${Answer}" = "y" ] ; then FsckNow="$FS ${FsckNow}" fi fi done the challenge is to convey the contents of $FsckNow to something that happens *after* the filesystems have been unmounted
After all, you are not planning to use the computer when you tell it to shut down and you can be safely logged out, the partition dismounted and checked without inconveniencing the user.
except for the 'shut the laptop down in a hurry, planning to continue work on $public_transportation' or 'shut down laptop, which is on batteries' scenarios - in which fsck'ing at either shutdown or boot would be undesirable... These days I rarely use 'ext' filesystems for anything but /boot/, but I've walked into the "unexpected fsck" enough times that I can see some value in at least being forewarned. /jon -- YMMV -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org