Configure mounting timeout at boot

9,022

Solution 1

Now it is 2020 and this question can be updated to represent current status. In a nutshell, the timeout can be set by using x-systemd.mount-timeout parameter:

From manpages:

Mount units may either be configured via unit files, or via /etc/fstab (see fstab(5) for details). Mounts listed in /etc/fstab will be converted into native units dynamically at boot and when the configuration of the system manager is reloaded. In general, configuring mount points through /etc/fstab is the preferred approach.

and:

x-systemd.mount-timeout= Configure how long systemd should wait for the mount command to finish before giving up on an entry from /etc/fstab. Specify a time in seconds or explicitly append a unit such as "s", "min", "h", "ms".

Thus, for example:

/dev/sdc     /mnt/backupdir     ext4     defaults,x-systemd.mount-timeout=30 0 2

waits atmost for 30 seconds during the boot for that entry to be mount before give up.

Solution 2

Thanks for the hint with the console message; it saved me having to plug-in a monitor to the console of a test server (keyboard sufficed...)

That said, up to at least 14.04, Ubuntu supported a nobootwait option for fstab entries, which would achieve what you want; smth like this:

UUID=8b481900-fb7a-4e9e-929c-e940a6b913a4 /data   ext4   nobootwait  0  2

Alas as mentioned in this other question, the nobootwait option was removed in 16.04 with currently no viable substitute other than the /etc/rc.local workaround described in the other answer.

Solution 3

Remove the mount by editing or commenting it out in /etc/fstab and replace it with an explicit mount command in /etc/rc.local.

Share:
9,022

Related videos on Youtube

Chaitya Shah
Author by

Chaitya Shah

Updated on September 18, 2022

Comments

  • Chaitya Shah
    Chaitya Shah 8 months

    On remotely rebooting a 12.04 machine I found it hanging at the "unable to mount soandso: Skip, Manual Abort? " (That's pretty much how I remember the message) The machine was basically stopped there until I hooked up a keyboard and pressed "s". I can see the rationale for the question, but I'd really like to know where to configure it or turn it off altogether. A mandatory question like this makes sense in a desktop environment but for servers I'd like more flexibility. So where do I fiddle and tweak this?