I want my USB filesystems to automount when I connect the device.
How do I setup automount with systemd
via /etc/fstab
?
autofsautomountingsystemd
I want my USB filesystems to automount when I connect the device.
How do I setup automount with systemd
via /etc/fstab
?
Best Answer
Connect your device and find out the UUID of the filesystem by running either
blkid
orlsblk -f
.Add a line to
/etc/fstab
such as:Then execute:
Explanation:
noauto
- don't mount withmount -a
nofail
- boot will continue even if this mount point is not mounted successfullyx-systemd.automount
tellsystemd
to automount this etnryx-systemd.idle-timeout=2
- wait 2 seconds before unmounting the device after last usagex-systemd.device-timeout=2
- wait only 2 seconds before givingNo such device
if the device is not connectedNote:
UUID
number.For more information about the options available, see systemd.mount(5)