20

Can I set an /etc/fstab with options=auto to be skipped if mounting fails?

The manual says, it will break the boot process if an entry with options=auto fails.

Without auto, it does not automatically mount the device on boot.

So how to make the auto entry to be ignored on failures?

ledy
  • 515
  • 1
  • 6
  • 15
  • Related: [How do I avoid the “S to Skip” message on boot?](http://askubuntu.com/q/120/78223) at Ubuntu SE – kenorb May 28 '15 at 16:32

4 Answers4

15

I created a partition called /dev/sdb1 in my Ubuntu VM. But I didn’t create a filesystem for this partition and so of course it will not get mounted.

Then put following entry in fstab.

/dev/sdb1   /mnt/       auto    defaults,nobootwait     0   2

And rebooted VM. Server got rebooted with following error msg in syslog

suku@ubuntu-vm:~$ grep sdb1 /var/log/syslog
Jan 11 16:32:58 ubuntu-vm kernel: [    2.263540]  sdb: sdb1
Jan 11 16:32:59 ubuntu-vm kernel: [    4.403527] EXT3-fs (sdb1): error: can't find ext3 filesystem on dev sdb1.
Jan 11 16:32:59 ubuntu-vm kernel: [    4.410341] EXT4-fs (sdb1): VFS: Can't find ext4 filesystem
Jan 11 16:32:59 ubuntu-vm kernel: [    4.413978] FAT-fs (sdb1): bogus number of reserved sectors
Jan 11 16:32:59 ubuntu-vm kernel: [    4.414073] FAT-fs (sdb1): Can't find a valid FAT filesystem

What is nobootwait:

nobootwait can be applied to non-remote filesystems to explicitly instruct mountall(8) not to hold up the boot for them.

Giacomo1968
  • 3,522
  • 25
  • 38
Suku
  • 2,006
  • 13
  • 15
2

Maybe it will be better to write a script to mount something after boot? For example, put string with noauto to fstab and mount it via rc.local

dr-evil
  • 377
  • 1
  • 5
1

For some flavors nobootwait and for for example xfs file systems no work

Below work with UUID

UUID=718ef17e-5502-4a74-81fe-930d21f5507d /data xfs rw,noquota,nofail  0 2
abkrim
  • 407
  • 6
  • 18
0

I am not sure about your distro, but usually booting just waits with a timeout and then will boot without mounting. You can mount it automatically on run time using an udev rule, e.g. on pluggin in.

To bind directories in fstab use:

/from    /to   none bind 0 0 
Giacomo1968
  • 3,522
  • 25
  • 38
Steffen
  • 21
  • 2