]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_{admin,repair},man5: tell the user to mount with nouuid for snapshots
authorDarrick J. Wong <djwong@kernel.org>
Fri, 7 Mar 2025 17:55:01 +0000 (09:55 -0800)
committerAndrey Albershteyn <aalbersh@kernel.org>
Tue, 11 Mar 2025 10:16:18 +0000 (11:16 +0100)
Augment the messaging in xfs_admin and xfs_repair to advise the user to
replay a dirty log on a snapshotted filesystem by mounting with nouuid
if the origin filesystem is still mounted.  A user accidentally zapped
the log when trying to mount a backup snapshot because the instructions
we gave them weren't sufficient.

Reported-by: Kjetil Torgrim Homme <kjetilho@ifi.uio.no>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Bill O'Donnell <bodonnel@redhat.com>
[add missing whitespace in 'the nouuid option.If you are']

db/sb.c
man/man5/xfs.5
repair/phase2.c

diff --git a/db/sb.c b/db/sb.c
index aa8fce6712e571ae85ed4e2ab6b246fe96ec5045..52ac48d45d5ae63337d9260af4418a712971f7d2 100644 (file)
--- a/db/sb.c
+++ b/db/sb.c
@@ -266,10 +266,11 @@ sb_logcheck(void)
                dbprintf(_(
 "ERROR: The filesystem has valuable metadata changes in a log which needs to\n"
 "be replayed.  Mount the filesystem to replay the log, and unmount it before\n"
-"re-running %s.  If you are unable to mount the filesystem, then use\n"
-"the xfs_repair -L option to destroy the log and attempt a repair.\n"
-"Note that destroying the log may cause corruption -- please attempt a mount\n"
-"of the filesystem before doing this.\n"), progname);
+"re-running %s.  If the filesystem is a snapshot of a mounted filesystem,\n"
+"you may need to give mount the nouuid option.  If you are unable to mount\n"
+"the filesystem, then use the xfs_repair -L option to destroy the log and\n"
+"attempt a repair.  Note that destroying the log may cause corruption --\n"
+"please attempt a mount of the filesystem before doing this.\n"), progname);
                return 0;
        }
        /* Log is clean */
index 0c1edc53e227ce59e6ea5c8b330c882e282ef304..f9c046d4721a14e3e88b342e084e86aed96bc609 100644 (file)
@@ -91,6 +91,11 @@ may become confused when doing incremental and resumed dumps.
 and
 .BR xfsrestore (8)
 are recommended for making copies of XFS filesystems.
+To mount a snapshot of an already-mounted filesystem, you may need to supply
+the
+.B nouuid
+option to
+.BR mount " (8)."
 .SH OPERATIONS
 Some functionality specific to the XFS filesystem is accessible to
 applications through the
index 71576f5806e473b44279cea92513995dc9d7d861..e249980527a0a9a6810c45b5f7f2de5c09c53306 100644 (file)
@@ -72,10 +72,11 @@ zero_log(
                                do_warn(_(
 "ERROR: The filesystem has valuable metadata changes in a log which needs to\n"
 "be replayed.  Mount the filesystem to replay the log, and unmount it before\n"
-"re-running xfs_repair.  If you are unable to mount the filesystem, then use\n"
-"the -L option to destroy the log and attempt a repair.\n"
-"Note that destroying the log may cause corruption -- please attempt a mount\n"
-"of the filesystem before doing this.\n"));
+"re-running xfs_repair.  If the filesystem is a snapshot of a mounted\n"
+"filesystem, you may need to give mount the nouuid option. If you are unable\n"
+"to mount the filesystem, then use the -L option to destroy the log and\n"
+"attempt a repair.  Note that destroying the log may cause corruption --\n"
+"please attempt a mount of the filesystem before doing this.\n"));
                                exit(2);
                        }
                }