From: Eric Sandeen Date: Mon, 18 Nov 2013 16:02:05 +0000 (+0000) Subject: xfsprogs: suggest "-d" option for repair of RO mount X-Git-Tag: v3.2.0-rc1~83 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=03091fc253963891c728cf362c0f9700294b6dfd;p=thirdparty%2Fxfsprogs-dev.git xfsprogs: suggest "-d" option for repair of RO mount 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 Reviewed-by: Dave Chinner Signed-off-by: Rich Johnston --- diff --git a/repair/init.c b/repair/init.c index c3f380b30..d0940aaef 100644 --- a/repair/init.c +++ b/repair/init.c @@ -97,8 +97,17 @@ xfs_init(libxfs_init_t *args) else 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 filesystem\n")); + } do_error(_("couldn't initialize XFS library\n")); + } ts_create(); increase_rlimit();