From 2b40e0c8385d033d82592fd3b15ebd0e0dc805b2 Mon Sep 17 00:00:00 2001 From: Martin Blazik Date: Fri, 15 Apr 2022 16:53:05 +0200 Subject: [PATCH] Help with fsck and tune2fs --- scripts/fsck-help.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 scripts/fsck-help.sh diff --git a/scripts/fsck-help.sh b/scripts/fsck-help.sh new file mode 100755 index 0000000..227b71f --- /dev/null +++ b/scripts/fsck-help.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +# https://unixadminguide.blogspot.com/2013/12/how-to-disable-fsck-on-reboot-in-linux.html +# +# tune2fs: +# -l -> list +# -c max-mount-counts, 0 or -1 -> disabled +# -i interval-between-checks[d|m|w] , 0 -> disabled + +set -E -o errexit -o nounset -o pipefail + +readonly SCRIPT_NAME=$(basename "${BASH_SOURCE[0]}") + +function show() { + local device=$1 + tune2fs -l $device | egrep -i 'mount count|check' | egrep -i -v checksum +} + +if [[ $# -lt 1 ]]; then + echo "use: $SCRIPT_NAME " + exit 1 +fi + +show $1