Home Explore Blog CI



man-pages

17th chunk of `mount.man`
3f32becda6f77499e446348539360a794657718cef3e33180000000100000fa8
 for more
           details). Only specified filesystem types are allowed, or all
           specified types are forbidden if the list is prefixed by "no".

           For example, X-mount.auto-fstypes="ext4,btrfs" accepts only ext4 and
           btrfs, and X-mount.auto-fstypes="novfat,xfs" accepts all filesystems
           except vfat and xfs.

           Note that comma is used as a separator between mount options, it
           means that auto-fstypes values have to be properly quoted, don’t
           forget that the shell strips off quotes and thus double quoting is
           required. For example:

          mount -t auto -o’X-mount.auto-fstypes="noext2,ext3"'  /dev/sdc1
          /mnt/test

       X-mount.mkdir[=mode]
           Allow to make a target directory (mountpoint) if it does not exist
           yet. 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 or when mount is
           executed without suid permissions. The option is also supported as
           x-mount.mkdir, but this notation is deprecated since v2.30. See also
           --mkdir command line option.

       X-mount.subdir=directory
           Allow mounting sub-directory from a filesystem instead of the root
           directory. For now, this feature is implemented by temporary
           filesystem root directory mount in unshared namespace and then bind
           the sub-directory to the final mount point and umount the root of
           the filesystem. The sub-directory mount shows up atomically for the
           rest of the system although it is implemented by multiple mount(2)
           syscalls.

           Note that this feature will not work in session with an unshared
           private mount namespace (after unshare --mount) on old kernels or
           with mount(8) without support for file-descriptors-based mount
           kernel API. In this case, you need unshare --mount --propagation
           shared.

           This feature is EXPERIMENTAL.

       X-mount.owner=username|UID, X-mount.group=group|GID
           Set mountpoint's ownership after mounting. Names resolved in the
           target mount namespace, see -N.

       X-mount.mode=mode
           Set mountpoint's mode after mounting.

       X-mount.idmap=id-type:id-mount:id-host:id-range
       [id-type:id-mount:id-host:id-range], X-mount.idmap=file
           Use this option to create an idmapped mount. An idmapped mount
           allows to change ownership of all files located under a mount
           according to the ID-mapping associated with a user namespace. The
           ownership change is tied to the lifetime and localized to the
           relevant mount. The relevant ID-mapping can be specified in two
           ways:

           •   A user can specify the ID-mapping directly.

               The ID-mapping must be specified using the syntax
               id-type:id-mount:id-host:id-range. Specifying u as the id-type
               prefix creates a UID-mapping, g creates a GID-mapping and
               omitting id-type or specifying b creates both a UID- and
               GID-mapping. The id-mount parameter indicates the starting ID in
               the new mount. The id-host parameter indicates the starting ID
               in the filesystem. The id-range parameter indicates how many IDs
               are to be mapped. It is possible to specify multiple
               ID-mappings. The individual ID-mappings must be separated by
               spaces.

               For example, the ID-mapping X-mount.idmap=u:1000:0:1 g:1001:1:2
               5000:1000:2 creates an idmapped mount where UID 0 is mapped to
               UID 1000, GID 1 is mapped to GUID 1001, GID 2 is mapped to GID
               1002, UID and GID 1000 are mapped to 5000, and UID and GID 1001
               are mapped to 5001 in the

Title: Filesystem-Independent Mount Options (cont. 2)
Summary
This section details additional filesystem-independent mount options for the `mount` command. It covers: `X-mount.mkdir` for creating mountpoint directories, `X-mount.subdir` for mounting subdirectories, `X-mount.owner` and `X-mount.group` for setting mountpoint ownership, `X-mount.mode` for setting mountpoint mode, and `X-mount.idmap` for creating idmapped mounts that change file ownership according to ID mappings in user namespaces.