systemd-mount systemd Developer Lennart Poettering lennart@poettering.net systemd-mount 1 systemd-mount Establish a mount or auto-mount point transiently systemd-mount OPTIONS WHAT WHERE systemd-mount OPTIONS Description systemd-mount may be used to create and start a transient .mount or .automount unit of the file system WHAT on the mount point WHERE. In many ways, systemd-mount is similar to the lower-level mount8 command, however instead of executing the mount operation directly and immediately, systemd-mount schedules it through the service manager job queue, so that it may pull in further dependencies (such as parent mounts, or a file system checker to execute a priori), and may make use of the auto-mounting logic. The command takes either one or two arguments. If only one argument is specified it should refer to a block device containing a file system (e.g. /dev/sdb1), which is then probed for a label and other metadata, and is mounted to a directory whose name is generated from the label. In this mode the block device must exist at the time of invocation of the command, so that it may be probed. If the device is found to be a removable block device (e.g. a USB stick) an automount point instead of a regular mount point is created (i.e. the option is implied, see below). If two arguments are specified the first indicates the mount source (the WHAT) and the second indicates the path to mount it on (the WHERE). In this mode no probing of the source is attempted, and a backing device node doesn't have to exist yet. However, if this mode is combined with , device node probing for additional metadata is enabled, and – much like in the single-argument case discussed above – the specified device has to exist at the time of invocation of the command. Use the command to show a terse table of all local, known block devices with file systems that may be mounted with this command. Options The following options are understood: Do not synchronously wait for the requested operation to finish. If this is not specified, the job will be verified, enqueued and systemd-mount will wait until the mount or automount unit's start-up is completed. By passing this argument, it is only verified and enqueued. Suppresses additional informational output while running. Enable probing of the mount source. This switch is implied if a single argument is specified on the command line. If passed, additional metadata is read from the device to enhance the unit to create. For example, a descriptive string for the transient units is generated from the file system label and device model. Moreover if a removable block device (e.g. USB stick) is detected an automount unit instead of a regular mount unit is created, with a short idle time-out, in order to ensure the file-system is placed in a clean state quickly after each access. Specifies the file system type to mount (e.g. vfat, ext4, …). If omitted (or set to auto) the file system is determined automatically. Additional mount options for the mount point. Takes a boolean argument, defaults to on. Controls whether to run a file system check immediately before the mount operation. In the automount case (see below) the check will be run the moment the first access to the device is made, which might slightly delay the access. Provide a description for the mount or automount unit. See Description= in systemd.unit5. Sets a unit property for the mount unit that is created. This takes an assignment in the same format as systemctl1's set-property command. Takes a boolean argument. Controls whether to create an automount point or a regular mount point. If true an automount point is created that is backed by the actual file system at the time of first access. If false a plain mount point is created that is backed by the actual file system immediately. Automount points have the benefit that the file system stays unmounted and hence in clean state until it is first accessed. In automount mode the switch (see below) may be used to ensure the mount point is unmounted automatically after the last access and an idle period passed. If this switch is not specified it defaults to false. If not specified and is used (or only a single argument passed, which implies , see above), and the file system block device is detected to be removable, it is set to true, in order to increase the chance that the file system is in a fully clean state if the device is unplugged abruptly. Equivalent to . Takes a time value that controls the idle timeout in automount mode. If set to infinity (the default) no automatic unmounts are done. Otherwise the file system backing the automount point is detached after the last access and the idle timeout passed. See systemd.time7 for details on the time syntax supported. This option has no effect if only a regular mount is established, and automounting is not used. Note that if is used (or only a single argument passed, which implies , see above), and the file system block device is detected to be removable, is implied. Similar to , but applies additional properties to the automount unit created, instead of the mount unit. Takes a boolean argument, defaults to off. This option only has an effect in automount mode, and controls whether the automount unit shall be bound to the backing device's lifetime. If enabled, the automount point will be removed automatically when the backing device vanishes. If disabled the automount point stays around, and subsequent accesses will block until backing device is replugged. This option has no effect in case of non-device mounts, such as network or virtual file system mounts. Note that if is used (or only a single argument passed, which implies , see above), and the file system block device is detected to be removable, this option is implied. Instead of establishing a mount or automount point, print a terse list of block devices containing file systems that may be mounted with systemd-mount, along with useful metadata such as labels, etc. Exit status On success, 0 is returned, a non-zero failure code otherwise. The udev Database If is used, systemd-mount honors a couple of additional udev properties of block devices: SYSTEMD_MOUNT_OPTIONS= The mount options to use, if is not used. SYSTEMD_MOUNT_WHERE= The file system path to place the mount point at, instead of the automatically generated one. See Also systemd1, mount8, systemctl1, systemd.unit5, systemd.mount5, systemd.automount5, systemd-run1