Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFE: support for FS_IOC_SETFSLABEL #757

Open
cmurf opened this issue Jun 10, 2021 · 5 comments
Open

RFE: support for FS_IOC_SETFSLABEL #757

cmurf opened this issue Jun 10, 2021 · 5 comments
Assignees

Comments

@cmurf
Copy link

cmurf commented Jun 10, 2021

This ioctl will get and set labels on mounted filesystems. Currently f2fs, btrfs, xfs support it.
https://man7.org/linux/man-pages/man2/ioctl_fslabel.2.html

Most useful would be GNOME Disks (and similar) being able to do file system label changes while the file system is mounted, in particular system root which can't be unmounted. But also generally leads to a better user experience, and is hopefully more maintainable.

@vojtechtrefny
Copy link
Member

We are currently using filesystem tools to set label (for example xfs_admin for XFS) so I'd expect these tools to support online label change using this ioctl. Unfortunately this is not the case with xfs_admin. I guess we could do that (or more precisely libblockdev could do that, we are currently working on moving as much of the filesystem management code as possible to libblockdev), but I really think btrfs, xfs and f2fs tools are the right place for this.

@cmurf
Copy link
Author

cmurf commented Jun 17, 2021

Unfortunately this is not the case with xfs_admin
I mentioned it to @djwong (XFS maintainer) and he said it's an oversight that it was missed, xfs_io did get this enhancement. So I suspect it'll happen in a near future xfsprogs. @sandeen Let's see if my @'s work.

For btrfs it's btrfs filesystem label and it can be directed to either a block device if unmounted or to a mountpoint if mounted.

@tbzatek
Copy link
Member

tbzatek commented Jun 21, 2021

Those ioctls looks interesting, however their use should be placed in lower layers below UDisks. Getting a label should be a blkid task propagating the value further in the udev database.

As for setting the label this could be a nice complement to the specific filesystem tools as called from libblockdev. Furthermore for a generic and not fully supported filesystem type in libblockdev this might be a way to go. Or, in case the tools are not installed, this might work instead. In any case, this issue should be moved to https://github.com/storaged-project/libblockdev.

@tbzatek tbzatek transferred this issue from storaged-project/udisks Jul 29, 2022
@tbzatek tbzatek added this to the libblockdev 3.0 milestone Jul 29, 2022
@tbzatek
Copy link
Member

tbzatek commented Jul 29, 2022

@vojtechtrefny: do you plan to make use of this in relation to #621? Either as a fallback or as a first step prior to calling the fs-specific tool. Given the wide range of kernels our code is running on, we need to support both cases.

@vojtechtrefny vojtechtrefny self-assigned this Jul 29, 2022
@vojtechtrefny
Copy link
Member

I plan to take a look at this, but probably not as a part of #621, it could be a separate change.

@vojtechtrefny vojtechtrefny removed this from the libblockdev 3.1 milestone Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants