From 72d1aef4715c3a2f31562cdc9fac27b04b33f8b0 Mon Sep 17 00:00:00 2001 From: Justin Cormack Date: Tue, 1 Nov 2016 16:01:08 +0000 Subject: [PATCH] fsck filesystem before mount Use fsck -p to fix errors that are fixable. Note this will recreate the filesystem on fatal errors. Fix #665 Signed-off-by: Justin Cormack --- alpine/packages/automount/etc/init.d/automount | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alpine/packages/automount/etc/init.d/automount b/alpine/packages/automount/etc/init.d/automount index 58961a9ae..43f1f7cb6 100755 --- a/alpine/packages/automount/etc/init.d/automount +++ b/alpine/packages/automount/etc/init.d/automount @@ -45,7 +45,7 @@ start() ERASE_DISKS="${DRIVE}" setup-disk -m data ${DRIVE} blockdev --rereadpt "${DRIVE}" 2> /dev/null else - ( mount "${DATA}" /var && ([ -z "${SWAP}" ] || swapon "${SWAP}") ) || \ + ( e2fsck -p "${DATA}" && mount "${DATA}" /var && ([ -z "${SWAP}" ] || swapon "${SWAP}") ) || \ ( ERASE_DISKS="${DRIVE}" setup-disk -m data ${DRIVE}; blockdev --rereadpt ${DRIVE} 2> /dev/null ) fi # boot2docker compat, has /var and /tmp on partition