From 8de5e32c05926a0bd0c593c97093c2ad5431a2a4 Mon Sep 17 00:00:00 2001 From: Mikhail Pershin Date: Wed, 6 Nov 2024 21:26:57 +0300 Subject: [PATCH] LU-18427 script: allow llog removal scripts on ZFS Make both scripts working also for ZFS mounts Lustre-change: https://review.whamcloud.com/c/fs/lustre-release/+/56906 Lustre-commit: 783d6a4677bad0cd85fe24510310a3844dbe13bd Signed-off-by: Mikhail Pershin Change-Id: I713548caa2f11af334c7bd10c07ecc81c387f5e1 Reviewed-by: Andreas Dilger Reviewed-by: Olaf Faaland Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/58013 Reviewed-by: Brian Behlendorf Reviewed-by: Oleg Drokin Tested-by: jenkins Tested-by: Maloo --- lustre/scripts/remove_changelog | 17 ++++++----------- lustre/scripts/remove_updatelog | 17 ++++++----------- 2 files changed, 12 insertions(+), 22 deletions(-) diff --git a/lustre/scripts/remove_changelog b/lustre/scripts/remove_changelog index 07650c6..1079123 100755 --- a/lustre/scripts/remove_changelog +++ b/lustre/scripts/remove_changelog @@ -12,20 +12,20 @@ # # Steps to cleanup problematic llogs: # -# 1. mount MDT filesystem locally on server as ldiskfs mount +# 1. mount MDT filesystem locally on server as ldiskfs/ZFS mount # 2. run script first in dry-run mode to make sure it parses llogs as needed: -# # bash remove_changelog -n +# # bash remove_changelog -n # 3. save all llogs for analysis: -# # bash remove_changelog -n -z /tmp/llogs_saved +# # bash remove_changelog -n -z /tmp/llogs_saved # 4. check that /tmp/llogs_saved.tar.gz exists and has all llogs inside: # # ls -ali /tmp/llogs_saved.tar.gz # # tar -tf /tmp/llog_saved.tar.gz # 5. finally run script to delete all llogs: -# # bash remove_changelog +# # bash remove_changelog # # For better llogs compression xz can be used as well, pass it to the script # via GZIP env variable: -# # GZIP=xz bash remove_changelog -n -z /tmp/llogs_saved +# # GZIP=xz bash remove_changelog -n -z /tmp/llogs_saved # Archive name will ends with .xz in that case instead of .gz @@ -48,7 +48,7 @@ usage: remove_changelog [--dry-run|-n] [--help|-h] [--quiet|-q] name prefix using gzip by default. Other compression tools can be used via GZIP env variable. -The 'localmount' argument should be an ldiskfs mounted MDT device mountpoint. +The 'localmount' argument should be an locally mounted MDT device mountpoint. Examples: remove_changelog /mnt/mdt0 @@ -82,11 +82,6 @@ remove_changelog() { local users=${mntpoint}/changelog_users local arch=$OPT_ARCH - if [[ -z $(df -t ldiskfs $mntpoint 2>/dev/null) ]] ; then - echo "$PROG: '$mntpoint' is not ldiskfs mount." - exit 1 - fi - if $OPT_DRYRUN; then $ECHO "Dry run was requested, no changes will be applied" fi diff --git a/lustre/scripts/remove_updatelog b/lustre/scripts/remove_updatelog index 1d41f88..37472b0 100755 --- a/lustre/scripts/remove_updatelog +++ b/lustre/scripts/remove_updatelog @@ -16,20 +16,20 @@ # # Steps to cleanup problematic llogs: # -# 1. mount MDT filesystem locally on server as ldiskfs mount +# 1. mount MDT filesystem locally on server as ldiskfs/ZFS mount # 2. run script first in dry-run mode to make sure it parses llogs as needed: -# # bash remove_updatelog -n +# # bash remove_updatelog -n # 3. save all llogs for analysis: -# # bash remove_updatelog -n -z /tmp/llogs_saved +# # bash remove_updatelog -n -z /tmp/llogs_saved # 4. check that /tmp/llogs_saved.tar.gz exists and has all llogs inside: # # ls -ali /tmp/llogs_saved.tar.gz # # tar -tf /tmp/llog_saved.tar.gz # 5. finally run script to delete all llogs: -# # bash remove_updatelog +# # bash remove_updatelog # # For better llogs compression xz can be used as well, pass it to the script # via GZIP env variable: -# # GZIP=xz bash remove_updatelog -n -z /tmp/llogs_saved +# # GZIP=xz bash remove_updatelog -n -z /tmp/llogs_saved # Archive name will ends with .xz in that case instead of .gz ECHO=echo @@ -48,7 +48,7 @@ usage: remove_updatelog [--dry-run|-n] [--help|-h] [--quiet|-q] name prefix using gzip by default. Other compression tools can be used via GZIP env variable. -The 'localmount' argument should be an ldiskfs mounted MDT device mountpoint. +The 'localmount' argument should be an locally mounted MDT device mountpoint. Examples: remove_updatelog /mnt/mdt0 @@ -84,11 +84,6 @@ remove_updatelog() { local arch=$OPT_ARCH local length=0 - if [[ -z $(df -t ldiskfs $mntpoint 2>/dev/null) ]] ; then - echo "$PROG: '$mntpoint' is not ldiskfs mount." - exit 1 - fi - if $OPT_DRYRUN; then $ECHO "Dry run was requested, no changes will be applied" fi -- 1.8.3.1