How to mount by UUID without using /etc/fstab

mount

I am looking for command like

mount 1234-SOME-UUID /some/mount/folder

I am connecting a couple of external USB hard drives. I want them to be mounted on specific folders during startup. I am unable to boot using /etc/fstab if one of the drive is not connected. so I am using an init script. But /dev/sdbx enumeration is not always same to use with mount /dev/sdX /some/mount/folder in the init script.

Best Answer

From the manpage of mount.

-U, --uuid uuid
       Mount the partition that has the specified uuid.

So your mount command should look like as follows.

mount -U 1234-SOME-UUID /some/mount/folder

or

mount --uuid 1234-SOME-UUID /some/mount/folder

A third possibility would be

mount UUID=1234-SOME-UUID /some/mount/folder
Related Question