You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think it would be fantastic if one could use a simple mount command to mount a subdir of some file system, instead of the root. i.e.
mount /dev/sda6 -t ext4 /foo/bar -o X-mount.subdir=/waldo/quux
Which would internally open a new mount namespace, create a temporary directory in /tmp, turn off propagation for it, then mount /dev/sda6 into it (so that it won't be visible in the host namespace), then use the /wald/quux subdir of it and bind mount it to host's /foo/bar, and exit. The namespace and the mount of the root of the file system will then be cleaned up. so that the rest of the system only sees the /foo/bar mount show up, atomically.
This would be be a more generic version of btrfs' subvol= switch: it would work for all file system types, and for all directories, not just subvolumes.
There are many usecases thinkable, including many where btrf's subvol= mount option is useful. But others come to mind:
You format a file system, and want to mount it somewhere, but want to avoid lost+found to show up. So you create a subdir in it, and just want to use that. lost+found would then still exist but never show up
systemd-homed can manage user's home directories inside LUKS volumes. It places the home directory inside a subdir inside the file systems inside them, and with the above suggested switch one can mount the home directory with one line.
One could mount specific ostree hierarchies right away without any further work.
and so on.
The text was updated successfully, but these errors were encountered:
I think it would be fantastic if one could use a simple mount command to mount a subdir of some file system, instead of the root. i.e.
mount /dev/sda6 -t ext4 /foo/bar -o X-mount.subdir=/waldo/quux
Which would internally open a new mount namespace, create a temporary directory in /tmp, turn off propagation for it, then mount /dev/sda6 into it (so that it won't be visible in the host namespace), then use the /wald/quux subdir of it and bind mount it to host's /foo/bar, and exit. The namespace and the mount of the root of the file system will then be cleaned up. so that the rest of the system only sees the /foo/bar mount show up, atomically.
This would be be a more generic version of btrfs' subvol= switch: it would work for all file system types, and for all directories, not just subvolumes.
There are many usecases thinkable, including many where btrf's subvol= mount option is useful. But others come to mind:
and so on.
The text was updated successfully, but these errors were encountered: