From: Theodore Ts'o Date: Sun, 6 Sep 2015 02:21:35 +0000 (-0400) Subject: tune2fs: allow changing the UUID mounted file systems with the -f option X-Git-Tag: v1.43-WIP-2016-03-15~53 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2334bd3ae56a4a8eff8e129da3c7aeec9672c6e1;p=thirdparty%2Fe2fsprogs.git tune2fs: allow changing the UUID mounted file systems with the -f option There are times when it is necessary to update the UUID on a mounted root file system (for example). So when we add this this safety check to e2fsprogs 1.43, we will likely break some scripts. Allow the -f option to force an override of this safety check. Signed-off-by: Theodore Ts'o --- diff --git a/misc/tune2fs.c b/misc/tune2fs.c index f9ce38cb4..2f27d6ff3 100644 --- a/misc/tune2fs.c +++ b/misc/tune2fs.c @@ -2960,7 +2960,7 @@ retry_open: * Changing the UUID requires rewriting all metadata, * which can race with a mounted fs. Don't allow that. */ - if (mount_flags & EXT2_MF_MOUNTED) { + if ((mount_flags & EXT2_MF_MOUNTED) && !f_flag) { fputs(_("The UUID may only be " "changed when the filesystem is " "unmounted.\n"), stderr);