RPi: automount USB drives via fstab

for mounting external usb drives one can use fstab. each column has its specific meaning (see here for definitions).

for external usb drives it is important to set some specific options:

  • auto: do automatic mounting
  • users: users can mount themselfs
  • nofail: dont expect that drive is attached at boot up
  • x-systemd.device-timeout=1: dont wait no longer than 1s for drive at boot up

full line looks like the following
$ cat /etc/fstab
...
UUID=ffd9b0a1-931f-4795-85ba-28c58719a938 /mnt/USBBkupDisk ext4 auto,rw,users,nofail,x-systemd.device-timeout=1 0 2

raspi: mount usb drives on bootup

to auto mount usb drives on bootup one can simply add some lines to the /etc/fstab file:

UUID=e0a4c8da-67d1-423d-939c-4dc8249079f0 /mnt/small btrfs rw,defaults,nofail 0 0

you need to change the following:

  • the UUID you can find out through: ls -l /dev/disk/by-uuid/
  • change the mount point
  • change the file system
  • pay attention: the nofail option will mount the drive only if it is plugged in