init: e2fsck /storage

This commit is contained in:
Stefan Saraev 2014-05-29 00:24:07 +03:00 committed by Stephan Raue
parent 112697518d
commit f7d87a2380

View File

@ -445,6 +445,8 @@
mount_storage() {
progress "Mounting storage"
check_part $disk
wakeonlan
if [ -n "$disk" ]; then
@ -469,6 +471,24 @@
fi
}
check_part() {
case $1 in
# skip if non local fs
LABEL=*|UUID=*|/*)
progress "checking $1"
# assuming /storage is ext234, e2fsck -p is safe
# if not ext234, I dont care. I dont want to support non-ext234 /storage
/sbin/e2fsck -p $1 &>/dev/null
if [ $? -eq 4 -o $? -eq 8 ] ; then
# TODO: e2fsck -y (a call for disaster)
# or debug shell + some info for how to manualy repair
: # k0p k0p placeholder. do nothing
fi
;;
esac
}
check_update() {
progress "Checking for updates"