You are not logged in.
Just a simple question:
What is the difference between ID_FS_LABEL and ID_FS_LABEL_ENC in udev rules?
They are both environment variables and usually appear the same in
udevadm info
Thanks.
Last edited by cyker (2015-05-19 20:53:20)
.
Offline
They are both variables containg the label of a filesystem and are defined by udev (see udev-builtin-blkid.c) using the functions blkid_encode_string and blkid_safe_string, which are provided by libblkid. Basically ID_FS_LABEL contains plain ascii, with hex-escaped and any valid utf8 characters but all whitespaces are replaced with '_' , while in ID_FS_LABEL_ENC all potentially unsafe characters are replaced by the corresponding hex value prefixed by '\x'.
For example if the file system label is "Simple Label", then the two variables will be
ID_FS_LABEL=Simple_Label
ID_FS_LABEL_ENC=Simple\x20Label
In older versions of udev, ID_FS_LABEL actually contained the unmodified label of the filsystem and a third variable (ID_FS_LABEL_SAFE) was used for the "safe" lable
Last edited by mauritiusdadd (2015-05-19 18:41:45)
Offline