I don't understand the --object-path
option in the udisksctl
command
I want to unmount an USB thumb drive, but I don't want to have to lookup it's device name (for example /dev/sdb) at each mount. The device name can change across mounts. I want a static way to identify the drive, for example by its partition name or UUID. Does the --object-path
service this function?
How do I identify what the --object-path
is of a USB thumb drive so I can execute a command such as the following with a partition name that is static across mountings: udisksctl unmount --object-path /media/greg/FD-ext4
I was looking for the answer to the same question, but there isn't a clear answer because the object seems to be the internal D-Bus object that is created by
udisksd
(see: https://askubuntu.com/a/633045/49873). This is even more annoying when you have multiple disks mounted and you want to unmount one of them.My workaround to this is to continue to use the
--block-device
(or-b
) option, but by disk label, e.g. my external backup drive has the labelxbackup
, so I can mount it as:Note that this can be confusing if you have multiple drives with the same label. I believe in that scenario the first drive attached to the system retains the label as is, and subsequent devices get a numeric suffix, like
xbackup1
(unverified, trying to recall from memory).