From: Theodore Ts'o <tytso@mit.edu>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: linux-ext4@vger.kernel.org
Subject: Re: [PATCH] tune2fs: don't change UUID on a mounted metadata_csum fs
Date: Tue, 29 Sep 2015 18:46:21 -0400 [thread overview]
Message-ID: <20150929224621.GC2989@thunk.org> (raw)
In-Reply-To: <20150929153122.GJ10390@birch.djwong.org>
On Tue, Sep 29, 2015 at 08:31:22AM -0700, Darrick J. Wong wrote:
> It's not safe to change the UUID on a mounted filesystem when the
> metadata_csum feature is enabled because there's (currently) no
> way to update the kernel's CRC seeds, which precompute the UUID
> component of the checksum for all metadata blocks. Not to mention
> that we'd have to rewrite /all/ metadata blocks, and any kernel disk
> accesses will race with tune2fs, thus destroying the filesystem.
It's not safe, but if you know what you're doing, it can work if the
root file system is quiscent (or preferably, mounted read-only) and if
you reboot immediately afterwards.
In point of fact, the use case that inspired me to add this was
wanting to change the UUID right before creating a GCE image such that
it has a different UUID from the UUID from the base OS image that you
used to create the image. And with metadata_csum, you can't even use
'debugfs -R "ssv uuid random"' to reset the uuid, since it won't
update the all of the metadata blocks. The only way to update the
uuid while the root file system is mounted is to use "tune2fs -f -U
random".
If the concern is that it's too dangerous to do this even with the -f
option, maybe we could require two -f option --- i.e., "tune2fs -f -f
-U random /dev/sda1". Or maybe we could require that the root file
system be mounted read-only, and adding a warning that this the
sytstem should be rebooted immediately afterwards.
In retrospect, we should have used a separate superblock field
containing the UUID for the metadata checksum seed. This would allow
us to change the UUID used to find the root file system without
needing to jump through hoops. Unfortunately, as in many things,
hindsight is 20-20.
- Ted
next prev parent reply other threads:[~2015-09-29 22:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-29 15:31 [PATCH] tune2fs: don't change UUID on a mounted metadata_csum fs Darrick J. Wong
2015-09-29 22:46 ` Theodore Ts'o [this message]
2015-09-30 1:21 ` Andreas Dilger
2015-09-30 16:11 ` Theodore Ts'o
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150929224621.GC2989@thunk.org \
--to=tytso@mit.edu \
--cc=darrick.wong@oracle.com \
--cc=linux-ext4@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).