$linuxjunkies
>

systemd-mount(1)

Establish and manage temporary mount points for filesystems.

UbuntuDebianFedoraArch

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

FlagWhat it does
-t, --fstype=TYPEspecify filesystem type (ext4, nfs, tmpfs, etc.)
-o, --options=OPTIONScomma-separated mount options (ro, noexec, etc.)
--no-blockreturn immediately without waiting for mount to complete
--automount=BOOLenable automatic mounting of the filesystem (yes/no)
-p, --property=NAME=VALUEset additional systemd unit properties
--description=TEXTset a human-readable description for the mount unit
--timeout-idle-sec=TIMEautomatically unmount after idle time (e.g. 5min)
-H, --host=USER@HOSTexecute remotely via systemd-run on specified host
--owner=USERset ownership of the mount point
-q, --quietsuppress status output

Examples

mount USB device at /mnt/usb with automatic systemd management

systemd-mount /dev/sdb1 /mnt/usb

create a 1GB RAM disk mounted at /tmp/ramdisk

systemd-mount -t tmpfs -o size=1G tmpfs /tmp/ramdisk

mount CD-ROM as read-only in a temporary directory

systemd-mount -o ro /dev/cdrom

mount NFS share with soft mount and custom timeout options

systemd-mount -t nfs -o soft,timeo=10 192.168.1.100:/export /mnt/nfs

mount device and automatically unmount after 30 minutes of inactivity

systemd-mount --timeout-idle-sec=30min /dev/sdc1

mount device non-blocking and set a descriptive name in systemd

systemd-mount --no-block --description='Backup Drive' /dev/sdd1 /mnt/backup

Related commands