From 2334bd3ae56a4a8eff8e129da3c7aeec9672c6e1 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Sat, 5 Sep 2015 22:21:35 -0400 Subject: [PATCH] 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 --- misc/tune2fs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/tune2fs.c b/misc/tune2fs.c index f9ce38c..2f27d6f 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); -- 1.8.3.1