You can mount PARTUUID="c4db5f86-45b2-43d3-8983-fedeb71da5cd"
because mount
recognizes the format of the argument, extracts the PARTUUID from it and acts accordingly; it does not treat the argument as a pathname in the directory tree.
/dev/update
gets recognized as a pathname. Even if it's a symlink and its target starts with PARTUUID=
, this does not change anything: mount
will try to mount the file pointed to. In your case it so happens there is no such file, the symlink is invalid.
Modern Linux distros contain the following udev rule:
ENV{ID_PART_ENTRY_UUID}=="?*", SYMLINK+="disk/by-partuuid/$env{ID_PART_ENTRY_UUID}"
(In my Kubuntu this rule is in /usr/lib/udev/rules.d/60-persistent-storage.rules
.)
If this is implemented also in your Linux then a directory /dev/disk/by-partuuid/
with a file named dbd18617-ff94-44c7-b6a2-f520004258e0
should already be there for you. This is what your new symlink can point to. It is an existing file in the directory tree, so the symlink will be valid. The file is itself a symlink to ../../sda3
in your case. If the device gets disconnected then the symlink will disappear and your symlink will become invalid. If the device gets reconnected (and maybe gets a different name) then the symlink will reappear (and it will point to the new name) and your symlink will become valid again.
Note that IDs like PARTUUID are case-insensitive by themselves, but pathnames in Linux are case-sensitive. This means your symlink should point to the exact pathname that appears in the directory tree.
Still, if /dev
is devtmpfs
then your /dev/update
will not survive a reboot. A similar symlink in a permanent location should work as you expect though, if only it points to /dev/disk/by-partuuid/dbd18617-ff94-44c7-b6a2-f520004258e0
.
If you really need /dev/update
that appears even after reboot then you should write an udev rule that creates it as a symlink for the partition with the right PARTUUID automatically. The code below will create a file /etc/udev/rules.d/60-update-device.rules
with the right content. Before testing, remove your old /dev/update
.
sudo tee /etc/udev/rules.d/60-update-device.rules >/dev/null <<'EOF'ENV{ID_PART_ENTRY_UUID}=="c4db5f86-45b2-43d3-8983-fedeb71da5cd", SYMLINK+="update"EOF
Now if you connect the right device or if you reboot with the device connected (or if you reload without rebooting) then udev will create the desired symlink. The symlink will point directly to the right special file (like sda3
), not to a symlink in /dev/disk/by-partuuid/
.
In the title you also mentioned UUID. If you want to do this by UUID then:
- when creating a symlink manually, make it point to a file in
/dev/disk/by-uuid/
(instead of/dev/disk/by-partuuid/
); - when building a udev rule, use
ENV{ID_FS_UUID_ENC}==
(instead ofENV{ID_PART_ENTRY_UUID}==
).