Bug 1322930
| Summary: | [RFE] Allow xfs to modify labels on mounted filesystem | |||
|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | smazul | |
| Component: | kernel | Assignee: | Eric Sandeen <esandeen> | |
| kernel sub component: | XFS | QA Contact: | Zorro Lang <zlang> | |
| Status: | CLOSED ERRATA | Docs Contact: | Marek Suchánek <msuchane> | |
| Severity: | medium | |||
| Priority: | low | CC: | csieh, dwysocha, esandeen, fsumsal, misterbonnie, mthacker, riehecky, smbrannon1, swhiteho, xzhou, zlang | |
| Version: | 7.2 | Keywords: | FutureFeature | |
| Target Milestone: | rc | |||
| Target Release: | --- | |||
| Hardware: | All | |||
| OS: | Linux | |||
| Whiteboard: | ||||
| Fixed In Version: | kernel-3.10.0-914.el7 | Doc Type: | Release Note | |
| Doc Text: |
XFS now supports modifying labels on mounted file systems
You can now modify the label attribute of mounted XFS file systems using the *xfs_io* utilit
# xfs_io -c "label -s new-label" /mount-point
Previously, it was only possible to modify labels on unmounted file systems using the *xfs_admin* utility, which is still supported.
|
Story Points: | --- | |
| Clone Of: | ||||
| : | 1584912 (view as bug list) | Environment: | ||
| Last Closed: | 2018-10-30 08:10:33 UTC | Type: | Bug | |
| Regression: | --- | Mount Type: | --- | |
| Documentation: | --- | CRM: | ||
| Verified Versions: | Category: | --- | ||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
| Cloudforms Team: | --- | Target Upstream Version: | ||
| Embargoed: | ||||
| Bug Depends On: | ||||
| Bug Blocks: | 1298243, 1477664, 1546181, 1546815, 1584912 | |||
|
Description
smazul
2016-03-31 17:04:02 UTC
This isn't related to xfsdump... e2label happily writes to a mounted block device; that's pretty dodgy, and something xfs won't do. To implement this we'd need a kernel interface to change the label on a mounted fs. It would likely also need to handle changing other superblock details like the UUID. So, moving to kernel component, though we'd also need an xfs tool to use the new interface. That said, every filesystem already has a unique UUID. Would using the existing unique UUID to look up filesystem content details (elsewhere) not suffice? What sort of labeling scheme is actually in use today? FWIW, back in 2014 Dave didn't seem opposed to such an interface. So that's good at least. :) From previously asked questions on comment 2 1) Would using the existing unique UUID to look up filesystem content details (elsewhere) not suffice? Unfortunately the UUIDs are universally unique. Tracking them would create more complexity. Additionally, I'm unable to change the UUID of a mounted XFS volume so that doesn't really address my primary issue. 2) What sort of labeling scheme is actually in use today? As for labeling scheme: / - contains / /(data) - contains / and has data we should preserve (ie. /home) /(tool) - contains / and has data that we should preserve, but is best exported via a tool (ie. mysq/postgresql) Well, in any case, I am looking into adding online labeling ability to xfs. btrfs has it, and we can hoist that interface to the vfs and make it available to more filesystems including xfs. I had preliminary patches to do this, but something was behaving oddly w.r.t. block device caching (I think) - labels would successfully update, but they weren't always immediately visible. It'll take some more investigation. Adding this to the approval for 7.4, but it's not as high of a priority. There's no code yet for this but I had a (buggy) prototype. I'll take another stab at it, acking for now but ultimately depends on upstream acceptance. Note, xfs_admin is exclusively an off-line / unmounted tool today, so it's unlikely that we'll use xfs_admin as the user interface to the online label feature. For now, a new command will be added to xfs_io, i.e. # xfs_io -c "label mynewlabel" /mount/point Thanks, -Eric Sent to rhkernel-list on 22 May 2018 Patch(es) committed on kernel repository and an interim kernel build is undergoing testing Patch(es) available on kernel-3.10.0-914.el7 Sure, I think this counts as an enhancement. # xfs_io -c "label mynewlabel" /mount/point is correct, using whatever style you'd like to denote that "mynewlabel" is the label for the XFS filesystem mounted at "/mount/point" Thanks, -Eric I've written a release note based on how I understand this. If there's anything in the doc text that's incorrect or misleading, please let me know. Thanks! I think that's pretty much fine. One tweak you might want is that "previously" the label change was made with the xfs_admin tool, not xfs_io. (So today, xfs_admin is used for unmounted label operations, xfs_io is used for mounted operations - a little odd but that's how it stands today) You're right, I should have mentioned that there are two tools for this with different use cases. I've edited the doc text to (hopefully) make that clear. This feature has been supported by current el7 kernel, xfstests generic/492 to be basic test case test passed on kernel 934.el7 with xfsprogs 4.5.0-18.el7 Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2018:3083 (In reply to Eric Sandeen from comment #28) > Sure, I think this counts as an enhancement. > > # xfs_io -c "label mynewlabel" /mount/point > > > is correct, using whatever style you'd like to denote that "mynewlabel" is > the label for the XFS filesystem mounted at "/mount/point" > > Thanks, > -Eric There is a mistake in this example. It should be: xfs_io -c "label -s mynewlabel" /mount/point label alone displays label label -c clears a label label -s sets a new label |