systemd-mount(1)
Establish and manage temporary mount points for filesystems.
Synopsis
systemd-mount [OPTIONS] WHAT [WHERE]Description
systemd-mount is a utility for temporarily mounting filesystems at specified mount points. It creates systemd mount units on-the-fly and manages their lifecycle, providing a convenient alternative to traditional mount commands with automatic cleanup and proper systemd integration.
The WHAT argument specifies what to mount (a device, path, or remote location), and WHERE specifies the mount point. If WHERE is omitted, a temporary directory is created. Mount points are automatically unmounted when no longer needed or when the system shuts down.
Common options
| Flag | What it does |
|---|---|
-t, --fstype=TYPE | specify filesystem type (ext4, nfs, tmpfs, etc.) |
-o, --options=OPTIONS | comma-separated mount options (ro, noexec, etc.) |
--no-block | return immediately without waiting for mount to complete |
--automount=BOOL | enable automatic mounting of the filesystem (yes/no) |
-p, --property=NAME=VALUE | set additional systemd unit properties |
--description=TEXT | set a human-readable description for the mount unit |
--timeout-idle-sec=TIME | automatically unmount after idle time (e.g. 5min) |
-H, --host=USER@HOST | execute remotely via systemd-run on specified host |
--owner=USER | set ownership of the mount point |
-q, --quiet | suppress status output |
Examples
mount USB device at /mnt/usb with automatic systemd management
systemd-mount /dev/sdb1 /mnt/usbcreate a 1GB RAM disk mounted at /tmp/ramdisk
systemd-mount -t tmpfs -o size=1G tmpfs /tmp/ramdiskmount CD-ROM as read-only in a temporary directory
systemd-mount -o ro /dev/cdrommount NFS share with soft mount and custom timeout options
systemd-mount -t nfs -o soft,timeo=10 192.168.1.100:/export /mnt/nfsmount device and automatically unmount after 30 minutes of inactivity
systemd-mount --timeout-idle-sec=30min /dev/sdc1mount device non-blocking and set a descriptive name in systemd
systemd-mount --no-block --description='Backup Drive' /dev/sdd1 /mnt/backup