Portál AbcLinuxu, 13. května 2025 17:31
# Pass any arguments to fsck. # By default we preen. # Linux systems also force -C0 and -T. # If fsck_args is not specified then Linux systems also use -A # (and -R if / is rw) #fsck_args="-p" # We can also specify the passno in /etc/fstab to check # If you multiplex fsck (ie ln -s fsck /etc/init.d/fsck.late) then you can # do an fsck outside of the normal scope, say for /home. # Here are some exampes:- #fsck_passno="=1 =2" #fsck_passno=">1" #fsck_passno="<2" # Most modern fs's don't require a full fsck on boot, but for those that do # it may be advisable to skip this when running on battery. # WARNING: Do not turn this off if you have any JFS partitions. fsck_on_battery="YES" # fsck_shutdown causes fsck to trigger during shutdown as well as startup. # The end result of this is that if any periodic non-root filesystem checks are # scheduled, under normal circumstances the actual check will happen during # shutdown rather than at next boot. # This is useful when periodic filesystem checks are causing undesirable # delays at startup, but such delays at shutdown are acceptable. fsck_shutdown="NO"
#!/sbin/runscript
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
depend() {
need checkroot modules
}
start() {
local retval=0
# Setup dm-crypt mappings if any
start_addon dm-crypt
if [[ -f /fastboot ]] || [[ -n ${CDBOOT} ]] ; then
rm -f /fastboot 2>/dev/null || : # ignore ro errors #267094
else
ebegin "Checking all filesystems"
if [[ -f /forcefsck ]] ; then
ewarn "A full fsck has been forced"
fsck -C -T -R -A -a -f
retval=$?
rm -f /forcefsck
else
fsck -C -T -R -A -a
retval=$?
fi
if [[ ${retval} -eq 0 ]] ; then
eend 0
elif [[ ${retval} -eq 8 ]] ; then
ewend 1 "Operational error, continuing"
# Everything should be ok, so return a pass
return 0
elif [[ ${retval} -ge 1 && ${retval} -le 3 ]] ; then
ewend 1 "Filesystem errors corrected."
# Everything should be ok, so return a pass
return 0
else
if [[ ${RC_FORCE_AUTO} == "yes" ]] ; then
eend 2 "Fsck could not correct all errors, rerunning"
fsck -C -T -R -A -y
retval=$?
fi
if [[ ${retval} -gt 3 ]] ; then
eend 2 "Fsck could not correct all errors, manual repair needed"
sulogin ${CONSOLE}
fi
fi
fi
}
# vim:ts=4
AUTOFSCK_DEF_CHECK=yes
PROMPT=yes
AUTOFSCK_TIMEOUT=5
AUTOFSCK_OPT="-y"
Rekl bych, ze je to presne to, co poptavate. Sam to tak pouzivam na vzdalenych boxech, kde nikdo nesedi (i s rizikem, ze tim vynucenim oprav u nejake vetsi nekonzistence to muze uplne zmrvit disk - je proste treba zalohovat)
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.