UDFINFO(1)

πŸ“¦
version 2.3 Β· 2 versions
  • 2.3 Β· alpine 3.24, arch rolling, debian bookworm, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 2.2 Β· centos-stream 9
, in alpine 3.24, arch rolling, debian bookworm, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

UDFINFO(1) πŸ’Ώβœ¨

General Commands Manual β€” okay bestie, grab a snack, this is the manual for udfinfo, and it's a long one so we're doing it in parts 🫢


✨ NAME ✨

udfinfo β€” show information about UDF filesystem 🌸


✨ SYNOPSIS ✨

udfinfo [ options ] device

✨ DESCRIPTION ✨

So basically, udfinfo spills all the tea about a UDF filesystem β€” whether it lives on a block device or hides inside a disk file image. πŸ’…

And here's the slay part: the output is designed to be parsed by external applications or scripts. It's giving machine-readable, not just pretty-to-look-at. Periodt. πŸ”₯


✨ OPTIONS ✨

  • -h, --help β€” shows you the usage and the whole list of options. The classic "help me bestie" move. πŸ™ˆ
  • -b, --blocksize= block-size β€” sets the size of blocks, in bytes. For a UDF filesystem a valid block size is a power of two in the range from 512 to 32768, and it must match a device logical (sector) size. If you don't specify it, udfinfo tries to autodetect the block size: first it tries the logical (sector) size, then it tries all valid block sizes. Detective work, honestly. πŸ”
  • --startblock= start-block β€” tells it the block location where the UDF filesystem starts. This is used for calculating the block location of the Volume Recognition Sequence (32 kB after the start block) and the first Anchor Volume Descriptor Pointer (256 blocks after the start block).

Normally the start block is 0, but for Multisession UDF optical discs it's the block location where the last session of the Multisession UDF disc starts.

If you skip it, udfinfo tries β€” for optical discs β€” to detect the start block of the last session from the disc Table Of Contents. Otherwise, the value 0 is used.

If you want to access some previous session of a Multisession UDF optical disc, you have to specify the correct block where that previous session starts. And also specify where that session ends, via the --lastblock option. Both. No skipping. 🚨

For Multisession UDF disc images stored in a file, there is no way to detect where the last session starts, so you gotta specify the correct start block location manually, taken from the original optical disc Table Of Contents.

(Option available since udfinfo 2.3)

  • --lastblock= last-block β€” tells it the block location where the UDF filesystem ends. It's used for calculating the block location of the second and third Anchor Volume Descriptor Pointer (256 blocks prior the last block, and the last block itself).

Normally the last block is the number of disk blocks minus one, but for Multisession UDF optical discs, when you're reading a different session than the last one (the one specified by --startblock), it's the block location where the specified session ends.

If you skip it, udfinfo for optical discs tries to detect the last recorded block, with a fallback to the last block of the device or disk file image.

To access some previous session of a Multisession UDF optical disc, you must specify correct values for both --startblock and --lastblock. Both, bestie, I'm serious. 😀

(Option available since udfinfo 2.3)

  • --vatblock= vat-block β€” tells it the block location of the Virtual Allocation Table. The Virtual Allocation Table is present only on UDF disks with a Virtual Partition Map, and it must be at the last written/recorded disk block.

If you skip it, udfinfo for optical discs tries to detect the last recorded block, with a fallback to the last block of the block device or disk file image, or the block specified by --lastblock. In most cases this fallback does not have to work, and for disk file images with a Virtual Allocation Table you're gonna need to specify the correct location yourself.

The Virtual Allocation Table contains locations of UDF disk blocks needed to read data storage, determinate used and free space blocks, read the File Set Identifier, and calculate the Windows-specific Volume Serial Number. It also contains the Logical Volume Identifier, and it overwrites the one previously stored in the Logical Volume Descriptor. Iconic multitasker. πŸ‘‘

  • --locale β€” encodes UDF string identifiers on output according to current locale settings (this is the default).
  • --u8 β€” encodes UDF string identifiers on output to 8-bit OSTA Compressed Unicode format, without the leading Compression ID byte, which is equivalent to Latin1 (ISO-8859-1) encoding. Heads up though: this will work only for strings whose Unicode code points are all below U+100.
  • --u16 β€” encodes UDF string identifiers on output to 16-bit OSTA Compressed Unicode format, without the leading Compression ID byte, which is equivalent to UTF-16BE.
  • --utf8 β€” encodes UDF string identifiers on output to UTF-8. Simple. Clean. Slay. ✨

✨ EXIT STATUS ✨

udfinfo returns 0 if successful, and non-zero if there are problems β€” like, say, a block device that does not contain a UDF filesystem. Rude, but it happens. πŸ’€


✨ OUTPUT FORMAT ✨

The first part of the udfinfo standard output contains information in key=value format. Here's the full list of all the keys and what they mean, no skips, no summaries:

  • filename β€” File name of the selected block device or disk file image
  • label β€” label is an alias for lvid, see udflabel(8) section UDF LABEL AND UUID
  • uuid β€” UUID are first 16 hexadecimal lowercase digits of fullvsid, but see udflabel(8) section UDF LABEL AND UUID
  • lvid β€” UDF Logical Volume Identifier stored in UDF Logical Volume Descriptor
  • vid β€” UDF Volume Identifier stored in UDF Primary Volume Descriptor
  • vsid β€” fullvsid after uuid part, typically 17.–127. character
  • fsid β€” UDF File Set Identifier stored in UDF File Set Descriptor
  • fullvsid β€” UDF Volume Set Identifier stored in UDF Primary Volume Descriptor
  • owner β€” UDF Logical Volume Info1 stored in UDF Implementation Use Volume Descriptor, represents Owner name, person creating the medium or filesystem (available since udfinfo 2.3)
  • organization β€” UDF Logical Volume Info2 stored in UDF Implementation Use Volume Descriptor, represents Organization name responsible for creating the medium or filesystem (available since udfinfo 2.3)
  • contact β€” UDF Logical Volume Info3 stored in UDF Implementation Use Volume Descriptor, represents Contact information for the medium or filesystem (available since udfinfo 2.3)
  • appid β€” UDF Application Identifier stored in UDF Primary Volume Descriptor, identifies application that created medium or filesystem (available since udfinfo 2.3)
  • impid β€” UDF Developer Identifier stored in UDF Implementation Identifier of UDF Primary Volume Descriptor, uniquely identifies the implementation which created medium or filesystem (available since udfinfo 2.3)
  • winserialnum β€” Windows-specific Volume Serial Number
  • blocksize β€” UDF block size
  • blocks β€” Number of all blocks on the selected block device or disk file image
  • usedblocks β€” Number of used space blocks on UDF disk for data storage
  • freeblocks β€” Number of free space blocks on UDF disk for data storage
  • behindblocks β€” Number of blocks which are behind the last block used by UDF disk
  • numfiles β€” Number of stored files on UDF disk
  • numdirs β€” Number of stored directories on UDF disk
  • udfrev β€” UDF revision needed for reading UDF disk
  • udfwriterev β€” UDF revision needed for writing or modifying UDF disk
  • startblock β€” Block location where the UDF filesystem starts (visible only when non-zero, available since udfinfo 2.3)
  • lastblock β€” Block location where the UDF filesystem ends (visible only when it is not same as the last block on disk, available since udfinfo 2.3)
  • vatblock β€” Block location of the UDF Virtual Allocation Table (visible only when available)
  • integrity β€” UDF integrity of Logical Volume, one of: opened, closed, unknown
  • accesstype β€” UDF Access Type, one of: overwritable, rewritable, writeonce, readonly, pseudo-overwritable, unknown
  • softwriteprotect β€” Status of UDF SoftWriteProtect flag, either yes or no (available since udfinfo 2.2)
  • hardwriteprotect β€” Status of UDF HardWriteProtect flag, either yes or no (available since udfinfo 2.2)
When UDF integrity is not closed it means that the UDF disk was not properly unmounted, is in an inconsistent state, and needs repairing. Not me being dramatic β€” that's just what it means. 😭
When either the softwriteprotect or hardwriteprotect flag is set, then the UDF disk should be treated as read-only. Do not mess with it. πŸ›‘

All UDF string identifiers are stored on the UDF disk in Unicode, therefore they are locale or code page agnostic. The options --locale, --u8, --u16 and --utf8 control how the identifiers are encoded on output.

All newline characters from the UDF string identifiers are removed, so it is guaranteed that the newline character is present only as a separator. Clean. 🌸

The second part of the udfinfo standard output contains a list of UDF block types stored on the device, one per line, in the following format:

start=block-num, blocks=block-count, type=block-type

Meaning that block-type starts at UDF block block-num and spans block-count blocks on the device. πŸ’«

The Windows-specific Volume Serial Number is a non-standard 32-bit checksum, calculated as four separate 8-bit XOR checksums of a 512 bytes long UDF File Set Descriptor. So therefore, it cannot be set or changed, as opposed to UUID which is 64-bit long. This non-standard checksum is used only by Windows systems (since the Windows 98 era, when it was introduced) and can be displayed on Windows systems by applications like vol, dir or fsutil.exe. Windows being Windows, iykyk. πŸͺŸ

πŸ’€ LIMITATIONS πŸ’€

okay bestie, story time, because the old versions of udfinfo had some moments. not their fault fr fr, but you need to know:

  • udfinfo prior to version 2.3 was unable to handle Multisession UDF discs correctly 😭. it always printed only info about the first session (the oldest one) and not about the last session (the most recent). so you'd be out here reading tea leaves about the wrong session. not it.
  • udfinfo prior to version 2.2 was unable to print Unicode strings with code points above U+FFFF correctly πŸ¦‹. the emoji-adjacent girlies were simply not rendering.
  • udfinfo prior to version 2.2 was unable to read Metadata Partition. therefore, determining used and free space blocks, reading File Set Identifier and calculating Windows-specific Volume Serial Number did not have to be available or correctly calculated for disks with UDF revisions higher than 2.01 which had Metadata Partition πŸ’…. like, the math was mathing wrong.
  • udfinfo prior to version 2.1 was unable to read Virtual Allocation Table stored outside of Information Control Block. therefore the above limitation applied also for some Write Once media πŸ™ˆ. yeah, it stacked. no cap.
moral of the story: upgrade your udftools, bestie. the glow-up is real. ✨

🫢 AUTHOR 🫢

Pali RohΓ‘r <pali.rohar@gmail.com>

the icon, the legend, the moment. πŸ’–


🌈 AVAILABILITY 🌈

udfinfo is part of the udftools package since version 2.0 and is available from https://github.com/pali/udftools/. go get it, it's giving open source excellence. πŸ‘‘


πŸ‘€ SEE ALSO πŸ‘€


and that's the whole page, bestie!! this one comes from the udftools package, section Commands, page UDFINFO(1) β€” go forth and inspect those filesystems with main character energy. slay, stay hydrated, and always read the LIMITATIONS. πŸ’…βœ¨πŸŽ€πŸ¦‹