Skip to content

set systemd device timeout to 1 second for volume mounts

Overview

Exosphere currently sets up 10 mount points in /etc/fstab with systemd automount. These are for volumes that a user may or may not attach. When a volume is not attached at a given mountpoint, the instance tries to mount it, and times out. The default timeout value for each volume is way too long (about a minute), which means an ls -l (or opening Nautilus) in the /media/volume directory causes a very long (several minutes) delay.

This MR sets x-systemd.device-timeout=1s for each of these mount points. which reduces the delay to about 10 seconds.

Before

exouser@vol-test-before:~$ time ls -l /media/volume
ls: cannot access 'vdf': No such device
ls: cannot access 'sdc': No such device
ls: cannot access 'sdd': No such device
ls: cannot access 'vdc': No such device
... several minutes later, tired of waiting

After

exouser@vol-test-after-2:~$ time ls -l /media/volume
ls: cannot access '/media/volume/vdf': No such device
ls: cannot access '/media/volume/sdc': No such device
ls: cannot access '/media/volume/sdd': No such device
ls: cannot access '/media/volume/vdc': No such device
ls: cannot access '/media/volume/sdf': No such device
ls: cannot access '/media/volume/vde': No such device
ls: cannot access '/media/volume/vdb': No such device
ls: cannot access '/media/volume/vdd': No such device
ls: cannot access '/media/volume/sde': No such device
ls: cannot access '/media/volume/sdb': No such device
total 0
d????????? ? ? ? ?            ? sdb
d????????? ? ? ? ?            ? sdc
d????????? ? ? ? ?            ? sdd
d????????? ? ? ? ?            ? sde
d????????? ? ? ? ?            ? sdf
d????????? ? ? ? ?            ? vdb
d????????? ? ? ? ?            ? vdc
d????????? ? ? ? ?            ? vdd
d????????? ? ? ? ?            ? vde
d????????? ? ? ? ?            ? vdf

real	0m11.953s
exouser@vol-test-after-2:~$ grep device-timeout /etc/fstab | head -n 1
/dev/sdb	/media/volume/sdb	ext4	user,exec,rw,auto,nofail,x-systemd.makefs,x-systemd.automount,x-systemd.device-timeout=1s,comment=cloudconfig	0	2

Partial fix for #521 (closed). Mitigates a problem that @SlicerMorph reminded us of (Nautilus taking a long time to open).

How to Test

Run the time ls commands above.

Screenshots

N/A

Edited by Chris Martin

Merge request reports