Create symlink to drive using static identifier, not OS-generated UUID?

Due to How to use #DigiKam without importing everything into `$HOME`? - #3 by rokejulianlockhart, I want to be able to add to my configuration script a command that creates a symbolic link, to my external drive where all of my media is stored, that doesn’t need to take into account whatever UUID the my OS generates for it.

Surely drives have an internal ID which one can reference in the path field, right (I think it accepts code compliant with whatever the system shell is)? I just don’t seem to be able to find this ID via partitionmanager, and I’m not entirely sure what the code is to reference it, if it’s possible.

I know this isn’t stricly KDE specific, but with Reddit’s shenanigans, I can’t expect many responses over at

If you have a specific drive in mind, then can you make the target of the symlink simply be the mountpoint of the drive?

e.g. if your drive gets mounted to /media/rokejulianbeedellockhart/MyDisk then you make a link that points to /media/rokejulianbeedellockhart/MyDisk.

whatever UUID the my OS generates for it

If you label the external drive partition, that will be used rather than some generated id. (The partition manager can label partitions; go to Properties for the partition.)

1 Like