21

Using Fedora 24, I had configured in /etc/fstab an external usb drive:

UUID=6826692e-79f4-4423-8467-cef4d5e840c5 /backup/external      ext4    defaults  0 0

When I unplugged the usb disk and reboot, it does not boot

That is the error message:

[ TIME ] Timed out waiting for device dev-disk-by\x2duuid-6826692e\x2d79f4\x2d4423\x2d8467\x2dcef4d5e840c5.device.
[DEPEND] Dependency failed for /backup/external.
[DEPEND] Dependency failed for Local File Systems.
[DEPEND] Dependency failed for Relabel all filesystems, if necessary.
[DEPEND] Dependency failed for Mark the need to relabel after reboot.

Why does not boot? is it a bug? a feature? of systemd? I know that was a mistake of me, I had to set options to "noauto", but anyway Why booting process stops because a non-critical directory of FHS is missing?

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
sebelk
  • 4,209
  • 10
  • 35
  • 54
  • 1
    Because it doesn't know what's a critical directory and what's not unless you tell it. All it knows is that there's a filesystem it can't mount. The installer probably should be written to ignore USB on installs to hdd but that's about the most you can do. – Bratchley Nov 29 '16 at 13:05
  • So, what's the purpose of FHS? Let's say that external disk drive is broken, why should it stop of booting? – sebelk Nov 29 '16 at 13:21
  • Because the system doesn't know if any essential (say "critical") binaries/configfiles are there. The only owner of the knowledge is you, the mounting script haven't implemented basic ai yet. – Ipor Sircer Nov 29 '16 at 13:25
  • So, the conclusion is: if I set "auto(mount)" systemd thinks is "critical" doesn't it? Or systemd thinks every filesystem is critical unless I told it? – sebelk Nov 29 '16 at 13:52
  • The latter. The general rule of thumb with *nix is to not do something unless you're sure of the result. In this case it doesn't know if that filesystem being missing is important unless you tell it somehow. The installer should probably do that for you though tbh. Probably worth mentioning to them since I don't know the use case for adding a USB stick to the fstab as part of the initial install. Certainly not one that couldn't just be done post-install. – Bratchley Nov 29 '16 at 14:27
  • In fact, I just did it :) – sebelk Nov 29 '16 at 14:35
  • 3
    Many distros have support for `nofail` you might try adding that to the mount options. That way it will mount on boot automatically but only if it's there. – Bratchley Nov 29 '16 at 14:35

1 Answers1

25

Using the nofail mount option will ignore missing drives during boot. See man pages fstab(5) and mount(8).

nofail Do not report errors for this device if it does not exist.

So your fstab line should instead look like:

UUID=6826692e-79f4-4423-8467-cef4d5e840c5 /backup/external ext4 defaults,nofail 0 0
etskinner
  • 595
  • 6
  • 10