Many .iso images of DVDs and Blu-ray discs hold a UDF file system instead
of, or beside, ISO 9660. UDF (Universal Disk Format) is a profile of ECMA-167
(ISO/IEC 13346), Volume and File Structure for Write-Once and Rewritable Media using
Non-Sequential Recording. ECMA-167 defines the structures; the UDF specification
fixes which options are used, the character set, and extra partition types. All
numbers are little-endian.
Sources: ECMA-167 3rd edition (June 1997), Parts 1–4, cited below as “ECMA-167 3/10.2” for Part 3, clause 10.2; and the UDF specification revision 2.60 (1 March 2005), read in Ecma’s republication ECMA TR/112-2 (December 2023), cited as “UDF 2.2.3”.
Finding UDF in an image
- The volume recognition sequence starts in the first sector
after the first 32,768 bytes: sector 16 with 2,048-byte sectors, the same place as
ISO 9660’s volume
descriptors. An
NSR02orNSR03descriptor there says the volume may be recorded with ECMA-167. - An anchor volume descriptor pointer at sector 256 (and at the last sector, or 256 before it) gives the extent of the volume descriptor sequence.
- The volume descriptor sequence holds the primary volume descriptor, partition descriptors and the logical volume descriptor.
- The logical volume descriptor points to the file set descriptor, which points to the root directory’s ICB.
- Directories are files of file identifier descriptors, each pointing to a file’s ICB, whose file entry lists where the data is.
A disc that carries both ISO 9660 and UDF is what UDF calls a UDF Bridge disc (UDF 6.11.4): ISO 9660’s primary volume descriptor stays at sector 16, and its directories may refer to the same files as the UDF structures, or to different ones.
Volume recognition sequence
Each volume structure descriptor fills one sector (ECMA-167 2/9.1). The sequence ends at the first sector that is not a valid descriptor (2/8.3.1); UDF requires that sector to be unrecorded or zero (UDF 2.1.7).
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
0 | 1 | uint8 | Structure type | 0 for the descriptors below. |
1 | 5 | text | Standard identifier | See the table below. |
6 | 1 | uint8 | Structure version | 1. |
7 | 2,041 | bytes | Structure data | Zeros for BEA01, TEA01 and NSR0x (whose byte 7 is a reserved 0 and data starts at 8). |
| Identifier | Meaning (ECMA-167 2/9.1.2) |
|---|---|
CD001 | An ECMA-119 (ISO 9660) volume descriptor; these come first, as a CD-ROM volume descriptor set |
BEA01 | Beginning extended area descriptor |
NSR02 | Volume recorded according to ECMA-167 2nd edition |
NSR03 | Volume recorded according to ECMA-167 3rd edition |
BOOT2 | Boot descriptor (UDF defines none) |
CDW02 | An ECMA-168 volume |
TEA01 | Terminating extended area descriptor |
UDF 2.1.7 requires exactly one NSR descriptor, inside a single extended area that
starts with one BEA01 and ends with one TEA01; any other
descriptors, such as the ISO 9660 set, come before it.
00009000 00 42 45 41 30 31 01 00 00 00 00 00 00 00 00 00 .BEA01..........
00009800 00 4E 53 52 30 33 01 00 00 00 00 00 00 00 00 00 .NSR03..........
0000A000 00 54 45 41 30 31 01 00 00 00 00 00 00 00 00 00 .TEA01..........
Descriptor tag
Every descriptor from here on starts with a 16-byte tag (ECMA-167 3/7.2 and 4/7.2).
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
0 | 2 | uint16 | Tag identifier | The descriptor type; see below. |
2 | 2 | uint16 | Descriptor version | 3 for ECMA-167 3rd edition, 2 for the 2nd; writers record 3, readers accept both. |
4 | 1 | uint8 | Tag checksum | Sum modulo 256 of bytes 0–3 and 5–15 of the tag. |
5 | 1 | – | Reserved | 0. |
6 | 2 | uint16 | Tag serial number | Identifies a set of descriptors, for disaster recovery; 0 for none. UDF sets it to the anchors’ value (UDF 2.1.6). |
8 | 2 | uint16 | Descriptor CRC | CRC-ITU-T (x16 + x12 + x5 + 1) of the bytes after the tag; ECMA-167’s example: 70 6A 77 gives 0x3299. |
10 | 2 | uint16 | Descriptor CRC length | Bytes covered by the CRC. UDF: the descriptor size minus 16, at most 65,535; not to be used as the descriptor’s length. |
12 | 4 | uint32 | Tag location | The logical sector holding the descriptor (in Part 4, the logical block within its partition), which makes a consistent tag very likely to be a real one. |
| Tag | Descriptor | Tag | Descriptor |
|---|---|---|---|
| 0 | Not specified (UDF: the sparing table) | 256 | File set descriptor |
| 1 | Primary volume descriptor | 257 | File identifier descriptor |
| 2 | Anchor volume descriptor pointer | 258 | Allocation extent descriptor |
| 3 | Volume descriptor pointer | 259 | Indirect entry |
| 4 | Implementation use volume descriptor | 260 | Terminal entry |
| 5 | Partition descriptor | 261 | File entry |
| 6 | Logical volume descriptor | 262 | Extended attribute header descriptor |
| 7 | Unallocated space descriptor | 263 | Unallocated space entry |
| 8 | Terminating descriptor | 264 | Space bitmap descriptor |
| 9 | Logical volume integrity descriptor | 265 | Partition integrity entry |
| 65,280–65,535 | By agreement | 266 | Extended file entry |
Anchor volume descriptor pointer
ECMA-167 3/8.4.2.1 allows anchors at sectors 256, n − 256 and
n (the last sector), and at multiples of n ÷ 59; UDF 2.2.3
requires at least two of 256, n − 256 and n. (An unclosed
sequential write-once disc may have a single anchor at 256 or 512.) At 2,048 bytes per
sector, sector 256 is offset 0x80000.
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
0 | 16 | tag | Descriptor tag | Identifier 2. |
16 | 8 | extent_ad | Main volume descriptor sequence extent | Length in bytes (4), then the first sector (4). UDF: at least 16 sectors. |
24 | 8 | extent_ad | Reserve volume descriptor sequence extent | An equivalent copy, in a different ECC block; length 0 for none. |
32 | 480 | – | Reserved | Zeros. |
Volume descriptor sequence
One descriptor per sector, ending with a terminating descriptor (tag 8), a volume descriptor pointer (tag 3) to a further extent, or an unrecorded sector (ECMA-167 3/8.4.2). Each descriptor below begins with its tag and a 4-byte volume descriptor sequence number at 16.
Primary volume descriptor (tag 1)
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
20 | 4 | uint32 | Primary volume descriptor number | – |
24 | 32 | dstring | Volume identifier | See strings. |
56 | 2 | uint16 | Volume sequence number | Place in the volume set. |
58 | 2 | uint16 | Maximum volume sequence number | – |
60 | 2 | uint16 | Interchange level | UDF: 2, or 3 in a multi-volume set. |
62 | 2 | uint16 | Maximum interchange level | UDF: 3 unless the user chose otherwise. |
64 | 8 | uint32 × 2 | Character set list, maximum list | UDF: CS0 only. |
72 | 128 | dstring | Volume set identifier | UDF: the first 16 characters should be unique, starting with a hexadecimal 32-bit time. |
200 | 128 | charspec × 2 | Descriptor and explanatory character sets | UDF: OSTA CS0. |
328 | 16 | extent_ad × 2 | Volume abstract, copyright notice | Length 0 for none. |
344 | 32 | regid | Application identifier | – |
376 | 12 | timestamp | Recording date and time | – |
388 | 32 | regid | Implementation identifier | UDF: the writing software’s “*Developer ID”. |
420 | 64 | bytes | Implementation use | – |
484 | 4 | uint32 | Predecessor sequence location | 0 for none. |
488 | 2 | bits | Flags | Bit 0: the volume set identifier is common to all volumes of the set. |
490 | 22 | – | Reserved | Zeros. |
Partition descriptor (tag 5)
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
20 | 2 | bits | Partition flags | Bit 0: volume space has been allocated for the partition. |
22 | 2 | uint16 | Partition number | May be 0. |
24 | 32 | regid | Partition contents | +NSR03 (or +NSR02): a Part 4 file structure. ECMA-167 also defines +FDC01, +CD001 and +CDW02. |
56 | 128 | bytes | Partition contents use | For +NSR03, the partition header descriptor (space bitmaps and tables). |
184 | 4 | uint32 | Access type | 1 read-only, 2 write-once, 3 rewritable, 4 overwritable; 0 not specified (UDF: pseudo-overwritable). |
188 | 4 | uint32 | Partition starting location | First sector of the partition. Logical block numbers in Part 4 count from here. |
192 | 4 | uint32 | Partition length | In sectors. |
196 | 32 | regid | Implementation identifier | – |
228 | 128 | bytes | Implementation use | – |
356 | 156 | – | Reserved | Zeros. |
Logical volume descriptor (tag 6)
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
20 | 64 | charspec | Descriptor character set | UDF: OSTA CS0. |
84 | 128 | dstring | Logical volume identifier | The logical volume’s name. |
212 | 4 | uint32 | Logical block size | UDF: equal to the sector size (2,048 on DVD). |
216 | 32 | regid | Domain identifier | *OSTA UDF Compliant, with the UDF revision in the suffix. |
248 | 16 | long_ad | Logical volume contents use | Where the file set descriptor is (ECMA-167 4/3.1, UDF 2.2.4.4). |
264 | 4 | uint32 | Map table length | Bytes of partition maps. |
268 | 4 | uint32 | Number of partition maps | – |
272 | 32 | regid | Implementation identifier | – |
304 | 128 | bytes | Implementation use | – |
432 | 8 | extent_ad | Integrity sequence extent | The logical volume integrity descriptors. |
440 | varies | maps | Partition maps | See below. |
A partition map starts with its type and its length. Partition reference numbers in Part 4 addresses are indexes into this list, starting at 0.
| Map | Layout |
|---|---|
| Type 1 (ECMA-167 3/10.7.2) | Type 1, length 6, volume sequence number (2), partition number (2) of a partition descriptor. |
| Type 2 (3/10.7.3) | Type 2, length 64, then 62 bytes defined by agreement. UDF uses three: reserved (2), a partition type regid (32) at 4, volume sequence number (2) at 36, partition number (2) at 38, then fields of its own. |
| UDF virtual partition | *UDF Virtual Partition: for sequentially written media such as CD-R; recorded beside a type 1 map, it is resolved through the virtual allocation table (file type 248). |
| UDF sparable partition | *UDF Sparable Partition: packet length (2) at 40, 1–4 sparing tables (1) at 42, table size (4) at 44 and their locations at 48; for media without defect management, such as CD-RW. |
| UDF metadata partition | *UDF Metadata Partition: metadata file, mirror and bitmap file entry locations (4 each) at 40, 44, 48, allocation unit (4) at 52, alignment unit (2) at 56, flags at 58. Required on single-partition read-only, overwritable and pseudo-overwritable volumes (UDF 2.2.10). |
File set descriptor (tag 256)
In Part 4, addresses are logical block numbers within a partition: an
lb_addr is a 4-byte block number and a 2-byte partition reference number;
a long_ad is a 4-byte length, an lb_addr and 6 bytes of
implementation use (ECMA-167 4/7.1, 4/14.14.2).
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
0 | 16 | tag | Descriptor tag | Identifier 256. |
16 | 12 | timestamp | Recording date and time | – |
28 | 4 | uint16 × 2 | Interchange level, maximum | – |
32 | 8 | uint32 × 2 | Character set list, maximum list | – |
40 | 4 | uint32 | File set number | – |
44 | 4 | uint32 | File set descriptor number | – |
48 | 64 | charspec | Logical volume identifier character set | – |
112 | 128 | dstring | Logical volume identifier | – |
240 | 64 | charspec | File set character set | – |
304 | 32 | dstring | File set identifier | – |
336 | 64 | dstring × 2 | Copyright and abstract file identifiers | – |
400 | 16 | long_ad | Root directory ICB | Where the root directory’s file entry is. |
416 | 32 | regid | Domain identifier | *OSTA UDF Compliant. |
448 | 16 | long_ad | Next extent | Further file set descriptors; length 0 for none. |
464 | 16 | long_ad | System stream directory ICB | – |
480 | 32 | – | Reserved | Zeros. |
ICB tag
An information control block (ICB) holds a file’s entries. Each entry is a descriptor tag, then this 20-byte ICB tag at offset 16 (ECMA-167 4/14.6).
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
16 | 4 | uint32 | Prior recorded number of direct entries | – |
20 | 2 | uint16 | Strategy type | UDF: 4, or 4096 on non-sequential write-once media. |
22 | 2 | bytes | Strategy parameter | – |
24 | 2 | uint16 | Maximum number of entries | Greater than 0. |
26 | 1 | – | Reserved | 0. |
27 | 1 | uint8 | File type | See below. |
28 | 6 | lb_addr | Parent ICB location | UDF: zeros with strategy 4. |
34 | 2 | bits | Flags | Bits 0–2: allocation descriptor type, 0 short_ad, 1 long_ad, 2 ext_ad, 3 the data is stored in the entry itself. Bit 3 sorted directory, 4 non-relocatable, 5 archive, 6 setuid, 7 setgid, 8 sticky, 9 contiguous, 10 system, 11 transformed, 12 multi-versions, 13 stream. |
| File type | Meaning |
|---|---|
| 0 | Not specified |
| 1, 2, 3 | Unallocated space entry, partition integrity entry, indirect entry |
| 4 | Directory |
| 5 | Ordinary file, randomly accessible bytes (UDF uses 5, not 0) |
| 6, 7 | Block and character special device |
| 8 | Extended attributes file |
| 9, 10 | FIFO, socket |
| 11 | Terminal entry |
| 12 | Symbolic link; the data is a pathname |
| 13 | Stream directory |
| 248 | UDF: virtual allocation table |
| 249 | UDF: real-time file |
| 250, 251, 252 | UDF: metadata file, metadata mirror file, metadata bitmap file |
File entry (tag 261) and extended file entry (tag 266)
A file entry describes one file or directory and fits in one logical block (UDF 2.3.6). The extended file entry adds an object size, a creation time and a stream directory, which moves the later fields.
| File entry | Extended | Size | Name | Description |
|---|---|---|---|---|
0 | 0 | 16 | Descriptor tag | 261 or 266. |
16 | 16 | 20 | ICB tag | See above. |
36 | 36 | 4, 4 | Uid, gid | – |
44 | 44 | 4 | Permissions | Three groups of five bits (execute, write, read, change attributes, delete): bits 0–4 others, 5–9 group, 10–14 owner. |
48 | 48 | 2 | File link count | – |
50 | 50 | 1, 1, 4 | Record format, display attributes, length | Part 5 record structure. |
56 | 56 | 8 | Information length | The file’s size in bytes. |
| – | 64 | 8 | Object size | The sum of the information lengths of all the file’s streams, including the default one. |
64 | 72 | 8 | Logical blocks recorded | – |
72 | 80 | 12 | Access time | – |
84 | 92 | 12 | Modification time | – |
| – | 104 | 12 | Creation time | – |
96 | 116 | 12 | Attribute time | – |
108 | 128 | 4 | Checkpoint | – |
| – | 132 | 4 | Reserved | Zeros. |
112 | 136 | 16 | Extended attribute ICB | long_ad. |
| – | 152 | 16 | Stream directory ICB | long_ad. |
128 | 168 | 32 | Implementation identifier | – |
160 | 200 | 8 | Unique ID | – |
168 | 208 | 4 | Length of extended attributes (L_EA) | – |
172 | 212 | 4 | Length of allocation descriptors (L_AD) | – |
176 | 216 | L_EA | Extended attributes | – |
| then | then | L_AD | Allocation descriptors | Where the data is, or the data itself (ICB flags type 3). |
A short_ad is 8 bytes: a length whose low 30 bits are the bytes and top 2
bits the extent type (0 recorded and allocated, 1 allocated but not recorded, 2 neither,
3 the next extent of allocation descriptors), then a 4-byte logical block number in the
same partition (ECMA-167 4/14.14.1). A long_ad has the same length field
and a full lb_addr.
File identifier descriptor (tag 257)
A directory’s data is a run of these, each padded to a multiple of 4 bytes (ECMA-167 4/14.4).
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
0 | 16 | tag | Descriptor tag | Identifier 257. |
16 | 2 | uint16 | File version number | 1 to 32,767. |
18 | 1 | bits | File characteristics | Bit 0 hidden (existence need not be shown), 1 directory, 2 deleted, 3 parent (the entry for the parent directory, with an empty name), 4 metadata stream. |
19 | 1 | uint8 | Length of file identifier (L_FI) | 0 for the parent entry. |
20 | 16 | long_ad | ICB | The file’s ICB. |
36 | 2 | uint16 | Length of implementation use (L_IU) | A multiple of 4. |
38 | L_IU | bytes | Implementation use | If present, starts with a regid. |
| 38 + L_IU | L_FI | d-characters | File identifier | The name, in OSTA CS0. |
| then | 0–3 | – | Padding | Zeros, to a multiple of 4. |
Strings, times and identifiers
- OSTA CS0 (UDF 2.1.1): a compression ID byte, then the characters:
8 for one byte per character, 16 for two bytes per character, most significant byte
first; 254 and 255 mark an empty, unique name in deleted file identifiers. The
charspec naming it is type 0 followed by
OSTA Compressed Unicode. - dstring (UDF 2.1.3): a fixed-size field whose last byte holds the number of bytes used, including the compression ID; an empty string is all zeros.
- timestamp (ECMA-167 1/7.3, UDF 2.1.4): 12 bytes: type and time zone (2; top 4 bits type, 1 for local time; low 12 bits a signed offset from UTC in minutes, −2047 for none), year (2, signed), month, day, hour, minute, second, centiseconds, hundreds of microseconds, microseconds (1 each).
- regid, UDF’s EntityID (ECMA-167 1/7.4, UDF 2.1.5): flags (1, zero
in UDF), identifier (23) and identifier suffix (8). For
*OSTA UDF Compliantthe suffix starts with the UDF revision as a 16-bit number,0x0260for 2.60, then domain flags (bit 0 hard write-protect, bit 1 soft write-protect).