[Top] [All Lists]

[PATCH V2] xfsprogs: suggest "-d" option for repair of RO mount

To: Eric Sandeen <sandeen@xxxxxxxxxx>, xfs-oss <xfs@xxxxxxxxxxx>
Subject: [PATCH V2] xfsprogs: suggest "-d" option for repair of RO mount
From: Eric Sandeen <sandeen@xxxxxxxxxxx>
Date: Mon, 18 Nov 2013 10:02:05 -0600
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <528261AD.50501@xxxxxxxxxx>
References: <528261AD.50501@xxxxxxxxxx>
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.1.0
We can offer the suggestion of a "-d" repair, if we're
in single-user mode with i.e. the root fs mounted readonly.

This change suggests -d to repair any RO mounted fs.

e2fsck allows this, and users are used to being able to
do it in single-user mode.  A separate patch will recommend
a reboot after repair completes.

Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>

V2: Now with more danger!

diff --git a/repair/init.c b/repair/init.c
index c3f380b..a7a7613 100644
--- a/repair/init.c
+++ b/repair/init.c
@@ -97,8 +97,17 @@ xfs_init(libxfs_init_t *args)
                args->isreadonly = LIBXFS_EXCLUSIVELY;
-       if (!libxfs_init(args))
+       if (!libxfs_init(args)) {
+               /* would -d be an option? */
+               if (!no_modify && !dangerously) {
+                       args->isreadonly = (LIBXFS_ISINACTIVE |
+                                           LIBXFS_DANGEROUSLY);
+                       if (libxfs_init(args))
+                               fprintf(stderr,
+_("Unmount or use the dangerous (-d) option to repair a read-only mounted 
+               }
                do_error(_("couldn't initialize XFS library\n"));
+       }

xfs mailing list

<Prev in Thread] Current Thread [Next in Thread>