UDFLABEL(8) | System Manager's Manual | UDFLABEL(8) |
udflabel — show or change UDF filesystem label
udflabel [encoding-options] [block-options] [identifier-options] device [new-label]
When udflabel is invoked without identifier-options and without specifying new-label then it shows current label of UDF filesystem on device to standard output terminated by new line. Otherwise it updates UDF filesystem (up to the revision 2.60) on device with new specified identifiers from identifier-options. Specifying new-label is synonym for both --lvid and --vid, see section UDF LABEL AND UUID.
If omitted, udflabel for optical disc tries to detect the last recorded block with fallback to the last block of block device or disk file image. In most cases, this fallback does not have to work and for disk file images with Virtual Allocation Table it is necessary to specify the correct location.
Virtual Allocation Table contains Logical Volume Identifier (UDF Label).
UDF specification does not say anything about a disk label but it describes that UDF Logical Volume Identifier is an extremely important field for media identification in a jukebox as that field is displayed to the user. And based on this statement it is a common practice for the majority of UDF implementations to use UDF Logical Volume Identifier as a UDF disk label.
UDF specification does not have a concept of disk UUID like other filesystems. But mandates that the first 16 characters of UDF Volume Set Identifier are unique, a non-fixed and a non-trivial value. Plus first eight characters are hexadecimal digits. Windows application format.exe and Mac OS X application newfs_udf are known to violates this requirement and set only the first 8 characters as unique (others are fixed). Since, there are still a lot of UDF implementations which use in the first 16 characters only hexadecimal digits and all compliant UDF implementations have hexadecimal digits in the first 8 characters, the following algorithm for generating stable UUID was informally chosen and now is used by udftools, util-linux, grub2 and other projects:
Which means that this generated UUID has always 16 hexadecimal lowercase digits. In most cases, this UUID matches case-insensitively the first 16 characters of UDF Volume Set Identifier and for all disks compliant to the UDF specification the first 8 bytes of UUID matches case-insensitively the first 8 characters of UDF Volume Set Identifier. In that algorithm was chosen UTF-8 encoding because it is the only commonly used Unicode transformation to bytes with fixed points in all hexadecimal digits.
udflabel returns 0 if successful, non-zero if there are problems like block device does not contain UDF filesystem or updating failed.
udflabel is not able to set new Label, Logical Volume Identifier and File Set Identifier for disks with Metadata Partition (used by UDF revisions higher then 2.01) or Virtual Allocation Table (used by Write Once media).
udflabel prior to version 2.1 was not able to read Label correctly if the disk has Virtual Allocation Table stored outside of Information Control Block.
Pali Rohár <pali.rohar@gmail.com>
udflabel is part of the udftools package since version 2.0 and is available from https://github.com/pali/udftools/.
udftools | Commands |