GoalI have a USB drive -- let's say the drive's ID is /dev/disk/by-id/thediskid I would like to mount the drive -- by ID -- to a folder (let's call it /MOUNT_FOLDER)QuestionWhat is the best way to do this using autofs?Current Attempt/etc/auto.master:+auto.master/localam auto.linux/[another mount]  [auto.othermount] --timeout=5 -- ghost/MOUNT_FOLDER auto.ext-usb --timeout=5/ -/etc/auto.ext-usb:/MOUNT_FOLDER /dev/disk/by-id/thediskidI know I'm missing something but I can't seem to get a good lead on what the proper syntax is.New to Linux; appreciate a pass if I'm overlooking something simple. Thanks!
How Do I use autofs to map a USB drive by its ID?
linux;rhel;automounting;external hdd;autofs
In your constellation /MOUNT_FOLDER is the base directory where subdirectories will be mounted by the indirect mount-map auto.ext-usb.See man 5 autofs for further details.Example:usbdisk -fstype=vfat,uid=yourworkingusername :/dev/disk/by-id/thediskidIf you cd /MOUNT_FOLDER/usbdisk your usbdisk will be mounted there (I assume it is vfat formatted).You can use /etc/fstab instead - but then you will to have to mount by hand.The entry in /etc/fstab looks like this:/dev/disk/by-id/thediskid /MOUNT_FOLDER vfat defaults,user,noauto 0 0After that you can mount the USB-Disk as ordinary user with mount /MOUNT_FOLDER. 