Reformat file system when .lustre/lost+found/ has garbage
Test-Parameters: trivial testlist=sanity-lipe-find3
Signed-off-by: Alexandre Ioffe <aioffe@ddn.com>
Change-Id: Ib78b06e685aaeabb8356662747285ed7a27dde15
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/49385
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
which jq || skip_env "jq is not installed"
build_test_filter
-check_and_setup_lustre
-
+if [ -d $MOUNT/.lustre/lost+found ] && [ "$(ls -A $MOUNT/.lustre/lost+found)" ]
+then
+ echo "Reformat file system"
+ REFORMAT="yes" cleanup_and_setup_lustre
+else
+ check_and_setup_lustre
+fi
# Try to support running from the build directory.
if [[ "$mds_HOST" == "$HOSTNAME" ]]; then
# Fixup GUILE_LOAD_PATH to support running from the build directory.