Understanding the UDF file system specification

Last Modified: Wed, 24 Dec 2008 17:09:00 +0000 ; Created: Wed, 24 Dec 2008 17:09:00 +0000

I've been working on a project to write a Java program that can create UDF ISO using the 2.01 specification. My main desire is to utilize filename lengths of 254 characters which is the longest length you can get for an optical file system such as UDF. All the other ISO creators I've tried either only supported ISO9660 with extensions up to 207 characters or UDF with only 127 characters.

I want the longer filename support so I can burn things to CD without having to worry about truncation of long names. This commonly happens with photos and MP3's.

I thought about modifying the source to mkisofs, but it doesn't provide true UDF support.

So I've been reading the specification for the UDF file system along with some helpful sites on how to parse through it. Below is a table of what I've understood thus far from the specification. I can't promise it isn't without errors yet.

Byte Offset Content
Start of Media Volume Recognition Space (aka base)
Empty Gap? – 32KB in size
32769 Volume Recognition Sequence (VRS)

Contains the following 3 contiguous sectors:

Beginning Extended Area Descriptor (BEA)
Volume Sequence Descriptor (VSD) with id "NSR02" or "NSR03"
Terminating Extended Area Descriptor (TEA)
Sector 256 Anchor Volume Descriptor Pointer (AVDP)

Contains start address & size of Volume Descriptor Sequence (VDS) and reserve VDS

? – Depends VDS

Contains many descriptors that are all sector aligned (see next below)

Sector Aligned Descriptors inside VDS with each start address sector aligned

Types: PD, LVD, TD

  • Most are smaller than a sector
  • Some have pointers to other descriptors
  • Chained together in a certain order
Partition Descriptor (PD)

Attributes:

  • Partition Number
  • Partition Start LSN
  • Partition Length
  • Access Type: Read-only, write-once, rewritable, or over-writable

Normally you have 1 PD, but you can have 2 PD (ex: read-only and overwritable)

Logical Volume Descriptor (LVD)

Contents:

  • Name of the volume care of Logical Volume Identifier
  • Partition Map – all physical & logical partitions
  • File Set – location of the root directory
  • Integrity Sequence Extent – address of LVID
    • LVID may be replaced with Virtual Allocation Table (VAT) File Entry (FE) for write-once media

Partition Map (inside LVD)

PD #

Type: 1 or 2

Various Attributes if type 2

End VDS Terminating Descriptor (TD)
? – Varies Partitions with data

TODO: File and directory descriptors

Some helpful sites:

Credits to Wenguang Wang explanation of UDF at http://homepage.mac.com/wenguangwang/myhome/udf.html

Useful specifications for UDF:

http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-167.pdf

http://www.osta.org/specs/index.htm