From 8dc08031f2cd1b8c19229cc1e4dcac65103f8c95 Mon Sep 17 00:00:00 2001 From: V10lator Date: Wed, 8 Jul 2015 18:14:57 +0200 Subject: [PATCH] fschk before mounting. To detect and fix corruption. --- scripts/mount-sd.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/mount-sd.sh b/scripts/mount-sd.sh index 1148215..7792101 100755 --- a/scripts/mount-sd.sh +++ b/scripts/mount-sd.sh @@ -31,6 +31,16 @@ if [ "$ACTION" = "add" ]; then exit 0 fi + case "${TYPE}" in + f2fs) + FSCK_OPTS="-a" + ;; + *) + FSCK_OPTS="-p" + ;; + esac + fsck $FSCK_OPTS ${DEVNAME} + test -d $MNT/${UUID} || mkdir -p $MNT/${UUID} chown $DEF_UID:$DEF_GID $MNT $MNT/${UUID}