Whamcloud - gitweb
LU-18427 script: allow llog removal scripts on ZFS 13/58013/2
authorMikhail Pershin <mpershin@whamcloud.com>
Wed, 6 Nov 2024 18:26:57 +0000 (21:26 +0300)
committerOleg Drokin <green@whamcloud.com>
Fri, 9 May 2025 01:46:27 +0000 (01:46 +0000)
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 <mpershin@whamcloud.com>
Change-Id: I713548caa2f11af334c7bd10c07ecc81c387f5e1
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Olaf Faaland <faaland1@llnl.gov>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/58013
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/scripts/remove_changelog
lustre/scripts/remove_updatelog

index 07650c6..1079123 100755 (executable)
 #
 # 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 <ldiskfs_mount>
+#    # bash remove_changelog -n <local_mount>
 # 3. save all llogs for analysis:
-#    # bash remove_changelog -n -z /tmp/llogs_saved <ldiskfs_mount>
+#    # bash remove_changelog -n -z /tmp/llogs_saved <local_mount>
 # 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 <ldiskfs_mount>
+#    # bash remove_changelog <local_mount>
 #
 # 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 <ldiskfs_mount>
+#    # GZIP=xz bash remove_changelog -n -z /tmp/llogs_saved <local_mount>
 # 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
index 1d41f88..37472b0 100755 (executable)
 #
 # 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 <ldiskfs_mount>
+#    # bash remove_updatelog -n <local_mount>
 # 3. save all llogs for analysis:
-#    # bash remove_updatelog -n -z /tmp/llogs_saved <ldiskfs_mount>
+#    # bash remove_updatelog -n -z /tmp/llogs_saved <local_mount>
 # 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 <ldiskfs_mount>
+#    # bash remove_updatelog <local_mount>
 #
 # 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 <ldiskfs_mount>
+#    # GZIP=xz bash remove_updatelog -n -z /tmp/llogs_saved <local_mount>
 # 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] <localmount>
                        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