Drive mounting changes

XFCE in use.

When I boot normally my 1TB HD mounts as /dev/sdaX. When I boot with my backup USB drive connected my 1TB HD mounts as /dev/sdbX. If my USB drive is connected before boot its /dev/sdax and after boot /dev/sdbX. This creates havoc with programs I have written to automate backups and seems to me quite dangerous.

Since I can mount the USB drive by uuid…

localhost:/home/ion #mount --uuid 7eb699e7-4313-450b-9520-d6d959bea492 /mnt/SERVER
localhost:/home/ion #

…to avoid any confusion, why can’t I…

localhost:/home/ion #umount --uuid 7eb699e7-4313-450b-9520-d6d959bea492
umount: unrecognized option '--uuid'
Try 'umount --help' for more information.
localhost:/home/ion #

Any suggestions will be appreciated/

You can probably use:

umount /dev/disk/by-uuid/7eb699e7-4313-450b-9520-d6d959bea492

Note that I have not tested this.

Well, did you follow the advice? Or did you study

man umount

The --uuid option is simply not there, thus you can not use it.

This should anser your question.

But why don’t you simply use

umount /mnt/SERVER

For mounting you need to point to the correct container (partition in this case) to mount the file system on the mount point… But once it is mounted the mount point is the unique identifier, isn’t it?

BTW, one normaly does not type such UUIDs in a mount statement every time. There are two ways I see as helping:

  • Hang a label on the file system, a short but telling one like SERVER (in this case) and use that with --label=SERVER, much less prone to typing difficulties;
  • Or use the configuration file of mount to prepare your mount fields and options. In which case you could mount by using he mount point /mnt/SERVER, because the configuration file will provide all details. And it makes mount - umount mirror each other, in both you use the mount point.

BTW the name of the configuration file is /etc/fstab. An entry would look like

UUID=7eb699e7-4313-450b-9520-d6d959bea492 /mnt/SERVER <type of the file system> noauto 0 0

You have to fill in the type of the file system here (ext4, xfs, …).
From now on you can mount using

mount /mnt/SERVER

and unmount with

umount /mnt/SERVER

I have the noauto, because from your post I understand that the disk is not always connected to the system and thus must not be mounted during boot. When this interpretation is wrong, then replace noauto with defaults and you will never ever have to type that mount statement again.