Automatically fsck data paritition on boot

By default this runs e2fsck on the data partition on boot before
mounting.

A forced fsck can be enabled by adding `fsck.mode=force` to
/boot/cmdline.txt

Moved from https://github.com/ccrisan/motioneyeos/pull/2464
This commit is contained in:
Rowan Wookey 2020-10-13 11:55:26 +01:00
parent 301723acf5
commit 743d4c0b3e

View File

@ -41,7 +41,16 @@ case "$1" in
msg_done "${disk_dev}"
test -b ${data_dev} && exit 0
if [ -b ${data_dev} ]
then
if grep -q 'fsck.mode=force' /proc/cmdline
then
/sbin/e2fsck -fy ${data_dev}
else
/sbin/e2fsck -y ${data_dev}
fi
exit 0
fi
msg_begin "Creating data partition"
data_start=$((DATA_OFFS * 2048))