From 2874f20657d59cfca4cd41dfb904a2c55c7e68bd 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..e1377fb 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" + ;; + fi + fsck $FSCK_OPTS ${DEVNAME} + test -d $MNT/${UUID} || mkdir -p $MNT/${UUID} chown $DEF_UID:$DEF_GID $MNT $MNT/${UUID}