Plain ISO 9660 allows only short upper-case names. Two extensions give long names:
Joliet adds a second directory tree with Unicode names; Rock Ridge adds Unix names,
permissions, links and times to the records of the main tree. The sources are Microsoft’s
Joliet Specification (Extensions for Unicode, version 1, 22 May 1995, read as
the copy at littlesvr.ca), and the IEEE P1281 (System Use Sharing Protocol) and P1282
(Rock Ridge Interchange Protocol) drafts, version 1.12, of 1994, which
are unapproved IEEE drafts (the approved IEEE standards were not available, and the
drafts say they are subject to change). The behaviour of two widely used readers,
Linux’s ISO 9660 driver (fs/isofs/rock.h, rock.c,
inode.c, joliet.c) and libarchive’s
archive_read_support_format_iso9660.c, is noted where it differs.
Joliet
Joliet is a supplementary volume descriptor with particular escape sequences, with its own path tables and directory records pointing to the same file data as the primary tree. Linux and libarchive both recognise it by these escape sequences at the start of the descriptor’s escape sequences field (offset 88):
| Escape sequence | Bytes | Linux’s name |
|---|---|---|
%/@ | 25 2F 40 | Microsoft Joliet Level 1 |
%/C | 25 2F 43 | Level 2 |
%/E | 25 2F 45 | Level 3 |
The three sequences are UCS-2 levels 1, 2 and 3 (ISO 10646), recorded as the ISO 2022
escape sequences %/@, %/C and %/E. Rules from
the specification:
- Which fields are UCS-2. In a Joliet descriptor the system, volume, volume set, publisher, data preparer and application identifiers, the copyright, abstract and bibliographic file identifiers, every file and directory identifier, and the system identifier of an extended attribute record hold UCS-2 characters, 16 bits each, most significant byte first (big-endian; Linux and libarchive agree).
- Volume flags. Bit 0 of the supplementary descriptor’s volume flags is zero (the escape sequences count as registered under ISO 2735).
- Forbidden characters. Code points
0000–001Fand*/:;?\are not allowed in names. - Special names. The root, current (
00) and parent (01) identifiers stay single bytes, as in ISO 9660. The separators.and;become 16-bit characters002Eand003B. - Sorting. Path table records and directory records are sorted by
comparing bytes as in ISO 9660 clauses 6.9.1 and 9.3, with the justification pad byte
changed to
00(it was20, and30in 9.3(c)); there is no natural-language sorting, and correct order is mandatory. - Limits relaxed. A file identifier (name plus extension) may be up to 128 bytes (64 characters), not 30; a directory identifier up to 128 bytes, not 31, and may contain an extension; the hierarchy may be deeper than eight levels, though for each file the file identifier length plus the directory identifier lengths of all its directories plus the number of those directories must not exceed 240.
- Multisession. The volume recognition sequence is at logical sector 16 of the first track of the last session and replaces earlier ones. Logical sector addresses run on across sessions (address = ((minutes × 60) + seconds) × 75 − 150, with 00:02:00 of session 1 as sector 0), and a volume may refer to sectors of earlier sessions. Data sectors are Mode 1 (single session only) or Mode 2 Form 1.
- CD-XA. A disc that also has Mode 2 Form 2 or CD-DA extents carries
the label
CD-XA001(43 44 2D 58 41 30 30 31) at offset 1024 of the Joliet descriptor. Per “System Description CD-XA” section 2.7, bit 12 of the XA attributes marks a Mode 2 Form 2 file and bit 14 a CD-DA extent; the directory record’s data length is then 2,048 times the number of sectors. CD-DA tracks only in the first session. - SUSP and Rock Ridge may be combined with Joliet, but the specification does not say how.
System Use Sharing Protocol
The System Use Sharing Protocol (SUSP) divides the system use field at the end of a directory record into entries, each with a 4-byte header:
| Offset | Size | Name | Description |
|---|---|---|---|
0 | 2 | Signature | Two letters naming the entry. |
2 | 1 | Length | Length of the whole entry, header included. |
3 | 1 | Version | Version of the entry, usually 1. |
4 | length − 4 | Data | Depends on the signature. |
| Signature | Name | Data |
|---|---|---|
SP | SUSP indicator (mandatory; length 7, version 1) | Two check bytes BE EF, then LEN_SKP, the number of bytes to skip at the start of the system use field of every directory record except the root’s . entry before the entries begin. Recorded at byte 1 of the system use field of the first record (.) of the root directory, or at byte 15 on a CD-XA disc. Only one per hierarchy. |
CE | Continuation area (length 28, version 1) | Three both-endian 32-bit numbers: the logical block, the byte offset in it and the length of a further area of entries, on the same volume, processed after the current field. At most one CE per field or area; an area may itself end in a CE. |
PD | Padding | Any bytes, ignored. |
ST | Terminator (length 4, version 1) | No data. Must be the last entry of a field or area unless fewer than four bytes remain; at most one per field or area. |
ER | Extensions reference (mandatory for each extension used) | Identifier length LEN_ID, descriptor length LEN_DES, source length LEN_SRC, extension version (1 byte each), then the identifier (d-characters), descriptor and source (a-characters). Length is 8 + LEN_ID + LEN_DES + LEN_SRC. In the . entry of the root directory only, one per extension. |
ES | Extension selector (length 5, version 1) | One byte, the extension sequence number: the position, counting from 1, of the extension’s ER in the root. Mandatory when more than one extension is used; the entries that follow belong to that extension. |
Rules (IEEE P1281 draft 1.12 sections 4 and 6): entries sit back to back starting at
byte LEN_SKP + 1 of the system use field, or at the first byte of a
continuation area; the 4-byte header length counts the whole entry; entries with the same
signature may repeat unless their definition forbids it; on a multi-extent file the
entries of the last extent apply to all extents; a reader ignores entries it does not
know, and everything after an ES naming an extension it does not know. The
signatures defined by SUSP may not be reused by extensions. The root descriptor in the
primary volume descriptor cannot carry a system use field, so the . entry of
the root directory holds the root’s SP and ER.
Rock Ridge
The Rock Ridge Interchange Protocol (RRIP) defines these SUSP entries (IEEE P1282
draft 1.12, with differences in Linux and libarchive noted); “both 32” means a 32-bit
number stored little-endian then big-endian (8 bytes). All text in them is, in a
primary volume hierarchy, POSIX portable file name characters; in a supplementary
volume it uses the character set of that descriptor’s escape sequences. The root
directory’s ER for RRIP has extension version 1 and the identifier
IEEE_P1282 (length 10), with the recommended descriptor “THE IEEE P1282
PROTOCOL PROVIDES SUPPORT FOR POSIX FILE SYSTEM SEMANTICS.” (73) and source “PLEASE
CONTACT THE IEEE STANDARDS DEPARTMENT, PISCATAWAY, NJ, USA FOR THE P1282
SPECIFICATION.” (94); the draft says the two lengths drop by one on adoption. A
PX entry must be in every directory record, and all PX and
TF entries with the same serial number must be identical.
| Signature | Name | Data |
|---|---|---|
RR | Rock Ridge in use | One flag byte saying which of PX, PN, SL, NM, CL, PL, RE, TF are present (bits 0 to 7 in that order, Linux’s RR_PX … RR_TF). libarchive calls it obsolete and ignores it. |
PX | POSIX attributes | Both 32: file mode (as in st_mode), number of links, user ID, group ID; libarchive also reads a fifth, the file’s inode number, when the entry is long enough. |
PN | POSIX device number | Both 32: high and low halves of the device number, for device files. |
SL | Symbolic link | A flag byte (bit 0: continues in the next SL), then components: each a flag byte, a length and text. Component flags: 1 continues, 2 the current directory (.), 4 the parent (..), 8 the root (/). |
NM | Alternate name | A flag byte then the name (bytes, no terminator). Flags: 1 continues in the next NM, 2 is ., 4 is ... |
CL | Child link | Both 32: the block where a relocated directory really is. |
PL | Parent link | Both 32: the real parent of a relocated directory. |
RE | Relocated directory | No data; marks a relocated directory (libarchive treats the rr_moved directory that holds them specially). |
TF | Time stamps | A flag byte then one time per set flag, in this order: 1 creation, 2 modification, 4 access, 8 attribute change, 16 backup, 32 expiration, 64 effective. Flag 128 (LONG_FORM) means each time is the 17-byte form of ISO 9660 8.4.26.1; otherwise the 7-byte form of 9.1.5. Times are local time. Modification, access and attribute change are st_mtime, st_atime and st_ctime. Each time may be recorded once per directory record, across all TF entries. |
SF | Sparse file | Length 21, version 1: both-32 high half and both-32 low half of the 64-bit virtual file size, then a 1-byte table depth. See sparse files. |
PX is 44 bytes: signature, length 44, version 1, then the
both-32 fields at bytes 5, 13, 21, 29 and 37: file mode, links, user ID, group ID and
file serial number (st_ino; records sharing a serial number are links to the same
file). The mode bits are the POSIX ones: owner read/write/execute 0400
0200 0100, group 0040 0020
0010, other 0004 0002 0001, set
user ID 04000, set group ID (also enforced locking) 02000,
sticky 01000, and the type in the high bits: socket 0140000,
symbolic link 0120000, regular 0100000, block device
0060000, directory 0040000, character device
0020000, FIFO 0010000. The draft’s length is 44, with the
file serial number as the fifth field. (The RR flag entry in the table is
not in the 1.12 draft; it comes from Linux and libarchive.)
PN (20 bytes, mandatory for character and block devices,
ignored otherwise): the high and low 32 bits of the 64-bit device number, both-32 each.
SL: flags byte at byte 5 (bit 0 CONTINUE: the link
continues in the next SL of the area; the rest must be zero), then
component records to the end; length is 5 plus the component area. Multiple
SL entries are joined until one has CONTINUE clear. A component record is
a flag byte, a length byte (not counting those two) and the text. Component flags:
bit 0 CONTINUE (this component carries on in the next record, whose text is appended),
bit 1 CURRENT (.), bit 2 PARENT (..), bit 3 ROOT (/),
bit 4 the directory the volume is mounted on (implementation-specific; historically),
bit 5 the network node name from uname (implementation-specific;
historically), others zero. At most one of bits 0 to 3 is set, and when any of bits 1 to
5 is set the length is 0 and there is no text. The components, in order, are joined with
/ to form the link. Only a record whose PX mode says symbolic
link uses it.
NM: flags at byte 5, then the name; length is 5 plus the
name (just 5 when bit 1, 2 or 5 is set). Flags: bit 0 CONTINUE (the name continues in the
next NM), 1 CURRENT, 2 PARENT, 5 the network node name (historically,
implementation-specific), 3 and 4 and the rest zero; at most one of bits 0 to 2. For the
00 and 01 records the matching bit must be set. With no
NM, the ISO identifier is the name. Records are still sorted by ISO identifier,
not by alternate name.
CL, PL, RE: deep directories.
ISO 9660 allows eight levels, so a deeper directory is moved up. The moved directory keeps
all its attributes in its own . entry at its new place. In its old place a
file record of the same name carries CL (12 bytes: both-32 block of the moved
directory); everything in that record except its identifier, alternate name and the
CL location is ignored. The moved directory’s .. record carries
PL (12 bytes: both-32 block of its original parent), and its record in the new
parent carries RE (4 bytes). All three are recorded for each relocated
directory.
Sparse files (SF)
A sparse file stores blocks only for non-zero data. The record’s data length covers the
whole file section: block 0 (2,048 bytes) is the SF header, whose first 21 bytes copy the
SF entry and the rest are zero; block 1 is the first index block. An index block
is a 2,048-byte block of 256 eight-byte table entries, each holding a both-32 number whose
low 32 bits are:
| Bits | Name | Meaning |
|---|---|---|
| 0–23 | BLOCK | With TABLE set: the 2,048-byte block offset, from the start of the file section, of the next index block (depth one less). With TABLE clear: the offset in 256-byte blocks, from the start of the file section, of a contiguous run of data. Zero if EMPTY is set. |
| 24–29 | – | Zero. |
| 30 | TABLE | The entry points to another index block. Not allowed at depth 1. Not with EMPTY. |
| 31 | EMPTY | The entry stands for a region of zeros. |
Table depth, which fixes the largest virtual size and what one entry covers, is: 1: 64 KB (an entry covers 256 B); 2: 16 MB (64 KB); 3: 4 GB (16 MB); 4: 1 TB (4 GB); 5: 256 TB (1 TB); 6: 64K TB (256 TB); 7: 16M TB (64K TB). Data block 0 is the first 256 bytes of block 0 of the file section, so the header block holds data block numbers 0 to 7. Data need not be in increasing order.
Other system use entries
| Signature | Name | Data |
|---|---|---|
ZF | zisofs | Marks a compressed file: a 2-byte algorithm (Linux accepts only pz), 2 bytes of parameters (header size, then the block size as a power of two; Linux refuses more than 217) and the both-32 uncompressed size. |
Other signatures occur in images, such as AL, AS,
AA and BA; their layouts were not found in any source read
and are not described here. (SF and ES are described above;
ER and ES are in the SUSP table above.)
Hybrid images and UDF
- Hybrid images that also boot from a USB stick put a master boot record (and often a GPT) in the 32 KB system area before sector 16, so the same file is both a disc image and a hard disk image.
- UDF (ECMA-167, OSTA Universal Disk Format) is the file system of
DVDs and Blu-ray discs. Its volume recognition sequence sits after the ISO 9660
descriptors, with the identifiers
BEA01,NSR02orNSR03andTEA01in the same 2,048-byte descriptor slots, and its anchor volume descriptor pointer is at sector 256. Its structures are described on the UDF page.