Trying to avoid incompatability on a mount enhancement
Hello,
I've been thinking about adding a feature to Busybox mount, but I'd like to check on options that are already claimed in util-linux so I don't cause a major incompatability.
The feature I'm thinking about is roughly analogous to "mkdir -p" or "cpio -d":
it creates the mountpoints if needed.
This could be done by calling mkdir -p, or by calling mkdir() from mount. The point is to allow one to mount /dev, /sys and all their subsystems in one pass by using
mount -T /etc/vfstab -a -d
or something like that where /etc/vfstab contains (for example):
===
# Kernel filesystems to mount for bringing up the system
proc /proc proc noexec,nodev,nosuid 0 0
sysfs /sys sysfs noexec,nodev,nosuid 0 0
devfs /dev devtmpfs defaults 0 0
devshm /dev/shm tmpfs nodev,nosuid 0 0
devpts /dev/pts devpts noexec,nodev,nosuid 0 0
===
I'm thinking that the option should be ignored with -o bind, because that may take a file or a directory.
Do you have any comments about the concept?
As far as I can see, -d, -m, and -p are all available (at least in the version of util-linux mount that ships in Jessie). Are there any plans to use any of these options?
Also, is there any interest in seeing this in util-linux mount? (I'd assume some of the corresponding code would be added to libmount, but I haven't really looked at util-linux code before--just Busybox and Toybox mount(8) implementations.)
Thanks,
Isaac Dunham
Karel Zak
maintainerQuoted 8 lines · Isaac Dunham
Hello,
I've been thinking about adding a feature to Busybox mount, but I'd like to check on options that are already claimed in util-linux so I don't cause a major incompatability.The feature I'm thinking about is roughly analogous to "mkdir -p" or "cpio -d":
it creates the mountpoints if needed.
man mount:
x-mount.mkdir[=mode]
Allow to make a target directory (mountpoint). The optional argument mode specifies the filesystem access mode
used for mkdir(2) in octal notation. The default mode is
0755. This functionality is supported only for root users.
... so:
mount /dev/sda1 /mnt/foo -o x-mount.mkdir
Karel
Signature · 2 lines
Karel Zak <[email protected]> http://karelzak.blogspot.com
Quoted 20 lines · Karel Zak
Quoted 8 lines · Isaac Dunham
Hello,
I've been thinking about adding a feature to Busybox mount, but I'd like to check on options that are already claimed in util-linux so I don't cause a major incompatability.The feature I'm thinking about is roughly analogous to "mkdir -p" or "cpio -d":
it creates the mountpoints if needed.man mount:
x-mount.mkdir[=mode]
Allow to make a target directory (mountpoint). The optional argument mode specifies the filesystem access mode
used for mkdir(2) in octal notation. The default mode is
0755. This functionality is supported only for root users.
Quoted 4 lines
... so:
mount
/dev/sda1/mnt/foo-o x-mount.mkdir
Thank you for responding.
I read about that some time after I sent the email; now comes the question of whether Busybox will accept it.
I've already gotten a comment to the effect that x-mount.mkdir is "ugly" (no clarifications provided), and that it's lacking the ability to set owner/group for the mountpoint.
(The individual who opposes this is arguing in favor of adding a similar but more expanded capability to mdev, the Busybox hotplugger.)
Thanks,
Isaac Dunham
Karel Zak
maintainerQuoted 11 lines · Isaac Dunham
Quoted 10 lines · Karel Zak
x-mount.mkdir[=mode]
Allow to make a target directory (mountpoint). The optional argument mode specifies the filesystem access mode
used for mkdir(2) in octal notation. The default mode is
0755. This functionality is supported only for root users.... so:
Quoted 8 lines
Quoted 2 lines
mount
/dev/sda1/mnt/foo-o x-mount.mkdirThank you for responding.
I read about that some time after I sent the email; now comes the question of whether Busybox will accept it.I've already gotten a comment to the effect that x-mount.mkdir is "ugly"
Well, x-* prefixes are generic solution for userspace mount options, we already use it for more things (for example systemd).
Quoted 2 lines
(no clarifications provided), and that it's lacking the ability to set owner/group for the mountpoint.
Good point, it would be possible to extend it for example to
x-mount.mkdir[=mode:user:group]
where :user and :group are optional and may be specified by UID/GID or by username/groupname.
Quoted 2 lines
(The individual who opposes this is arguing in favor of adding a similar but more expanded capability to mdev, the Busybox hotplugger.)
I have no clue about busybox hotplugger, for standard udev we usually don't want to do things like "mount" in udev context.
Karel
Signature · 2 lines
Karel Zak <[email protected]> http://karelzak.blogspot.com