Best way to auto mount external usb drives at boot time?

I have 2 external usb drives permanently connected to a PC running oS11.2 which I intend using as an unattended server. So I need to have the 2 external usb drives mount at boot time.

I’ve read in other posts in this forum that one should not put usb devices in fstab. So what it the best way to mount these during boot? The drives crrently have FAT32 file systems and both have labels. These drives will eventually be reformatted to ext4.

If these drives are always powered BEFORE the PC is switched ON, and are left powered, and never unplugged NOR switched OFF while the PC is powered, then it is fine to put them in the fstab. You may wish to ensure they are mounted by drive ID, so that they do not get swapped around inappropriately when mounting.

Well both drives are permanently connected to a power source but only one usb drive’s LED remains lit when the system is turned off. I’ve checked and it appears the drive is still spinning though. I’m not sure if it’ll power off after a while though. Will need to check in the morning after the PC has been off over night.

What’s the alternative if one of the drives does in fact power off?

One can not read everything on the subject, but I have stated in more then one thread that, opposed to what somew think here, there is nothing against putting mass storage devices of any kind in /etc/fstab. It is about the USAGE, not about if they are physicaly in- or outside the metal case of the box, or if they are connected through USB, SCSI or whatever.

So my (personal) adivice is:: when they are always there, they are not to be handled different from your otrher disks (disk partitions). Put them in /etc/fstab and mount them where you want them and mount them by volume label (using /dev/disk/by-label/… as device file) because then you are sure they are not mixed up by any USB devices added/removed.

OK, I’ll place them in fstab. One question, does fstab try mount the drives after all the udev stuff is up and running? What I’m asking is, is there any chance that the USB drives don’t mount during boot because the USB interface isn’t fully up before the attempted mount?

The USB devices should come up before it tries to mount the drives, so that shouldn’t be an issue. If it is a problem, let us know, because there are ways to delay the mounting in fstab if needed.

Thanks for confirming. I’ll see how it goes.