udisks icon indicating copy to clipboard operation
udisks copied to clipboard

[Feature request] /run/media/username/ID or path etc/ instead of UUID

Open jebez1 opened this issue 1 year ago • 6 comments

I'm on Arch Linux KDE.

E.g. mount nvme0n1p3 via Dolphin or udisksctl mount -b /dev/nvme0n1p3 : /run/media/a/DB49-54E7/ but is it possible to have /run/media/a/nvme-WDS250G3X0C-00SJG0_185250422455-part3/ instead?

Thanks.

jebez1 avatar Dec 16 '24 12:12 jebez1

The name is created from several sources - first the filesystem label, then the filesystem UUID, falling back to plain disk, see https://github.com/storaged-project/udisks/blob/8ffd11c8c4e865413fba80e7fe20ca1db95797db/src/udiskslinuxfilesystem.c#L790-L801

In practice almost every filesystem has an UUID. I think there's currently no other way to specify custom mountpoint name, other than putting it in /etc/fstab.

tbzatek avatar Dec 18 '24 16:12 tbzatek

Impossible? Why?

Although it's possible to have 2 partitions with the same UUID, on a PC, e.g. if I plug an USB flash drive from a friend (then we play the lottery).

On the contrary an ID depends on the unique hardware serial number, then the number of the partition https://wiki.archlinux.org/title/Persistent_block_device_naming.

It would be nice to have the setting, why not the path etc too.

jebez1 avatar Dec 18 '24 18:12 jebez1

I didn't say it's impossible, just currently not possible. Generally dynamically created mountpoints are not stable and never were. If there's a directory with the same name, UDisks will choose a new name, typically with -1, -2, etc. suffix. If you need stable names for your further operations, having a /etc/fstab record is the preferred way. Or just take a reference to the UDisksBlockObject and fetch actual mountpoint path from the org.freedesktop.UDisks2.Filesystem.MountPoints interface property.

tbzatek avatar Dec 19 '24 12:12 tbzatek

Editing /etc/fstab is a bad patch for me, e.g. I don't wanna do it every time I plug a new drive.

I still don't understand why it's currently not possible: ls -l /dev/disk/by-id|grep nvme0n1p3|head -n 1|awk '{print$9}' nvme-WDS250G3X0C-00SJG0_185250422455-part3 ...

Or just take a reference to the UDisksBlockObject and fetch actual mountpoint path from the org.freedesktop.UDisks2.Filesystem.MountPoints interface property.

How? I edit the code of udisks myself?

jebez1 avatar Dec 19 '24 13:12 jebez1

https://bbs.archlinux.org/viewtopic.php?id=302709 request for close by discard

n0xena avatar Feb 18 '25 13:02 n0xena

?

jebez1 avatar Feb 18 '25 15:02 jebez1