Linux 2.6.x UDF / DVD-RAM hints

Attention

Some older Linux kernels had a file size limit of 1 GB due to a bug in UFS. Newer kernels (2.6.25.4 is known to work) allow bigger files.

Preparation

On most distributions like Arch Linux, you won't have to configure anything but just install the right packets - for Arch Linux e.g you need udftools from the AUR.

Kernel configuration

Device Drivers  --->
  [*]  Block devices  --->
       <M>  Packet writing on CD / DVD media
       [ ]  Enable write caching (experimental as of 2.6.25.4)
Filesystems --->
  CD-ROM/DVD filesystems --->
       <M>  UDF file system support

Udev configuration for packet writing

For newer pktsetup, the naming scheme changed and I suggest to put this somewhere in your /etc/udev/rules.d/ to fix this:
/etc/udev/rules.d/20-pktcdvd.rules
# packet writing interface KERNEL=="pktcdvd", NAME="pktcdvd/control" KERNEL=="pktcdvd[0-9]*", NAME="pktcdvd/%k"
This HOWTO assumes the new naming scheme.

Low level formatting

This is normally not needed unless you really want to clear a DVD-RAM or DVD-RW completely or if a medium causes problems.

$ dvd+rw-format -force=full -ssa=default /dev/dvdram

This re-formats the medium and creates also the reserved sectors.

Create an UDF filesystem

Note: Most DVD-RAMs are delivered preformated with an UDF V2.0 filesystem.

$ mkudffs --udfrev=0x0201 --vid="My DVD" --media-type=dvdram /dev/dvdram
Warning: Changing the UDF version also deletes all data on the medium !!!

Packet writing

If you enabled packet writing in the kernel, you can make use of it like this:

$ modprobe pktcdvd $ modprobe udf

Use 'pktsetup' to link the physical device with the packet writing module:

$ cdrwtool -d /dev/sr0 -q $ pktsetup 0 /dev/sr0 $ mount -t udf /dev/pktcdvd/0 /mnt
an undo this with:
$ umount /dev/pktcdvd/0 $ pktsetup -d 0

DVD image mastering

Use the growisofs command to write the ISO onto the DVD: # growisofs -Z /dev/dvd=/tmp/example-image.iso To append more data for same DVD: # growisofs -M /dev/dvd /tmp/file.1

Misc

http://dvdisaster.net/

Unsorted stuff

Windows uses the Logical Volume Identifier (LVID) as Laufwerksbezeichnung.
Linux uses instead the Volume Identifier (vid) as Mediumbezeichnung.
If you don't specify the VID then the name will be set to 'LinuxUDF'.
The following UDF versions can be created:
    * Version 1.02 with	--udfrev=0x0102
    * Version 1.50 with	--udfrev=0x0150
    * Version 2.00 with	--udfrev=0x0200
    * Version 2.01 with	--udfrev=0x0201
Compatibilität Linux - Windows
Nicht jede Windows bzw. Linux Version kann jede UDF Version lesen und schreiben.
Wenn Sie also zwischen Windows und Linux mit einer DVD Daten austauschen möchten,
müssen Sie unbedingt auf die UDF Version achten. Ein neues DVD-RAM Medium ist
ab Werk formatiert und wird fast immer mit UDF Version 2.0 ausgeliefert.
Beschreiben Sie dieses Medium mit Linux 2.6, dann können Sie die DVD-RAM unter
z.B. Windows 2000 ohne Zusatzsoftware nicht lesen.
    * cdrwtool - Low-level drive management (e.g. set writing speed, format)
    * pktsetup - Set up a packet writing device (/dev/pktcdvd0) for a drive
    * wrudf - Maintains a UDF filesystem
Folgende Kernel Module werden für ATAPI DVD-RAM Brenner benötigt:
	Device Drivers → Block devices → Packet writing on CD/DVD media (Optional)
	Device Drivers → ATA/ATAPI/MFM/RLL support → IDE/ATA-2 DISK support
	Device Drivers → ATA/ATAPI/MFM/RLL support → IDE/ATAPI CDROM support
	File systems → CD-ROM/DVD Filesystems → UDF file system support
Mit folgendem Befehl können Sie auch ohne fstab bzw. HAL Eintrag das Medium als root User mounten:
	mount -t udf -o rw,noatime,async,user /dev/pktcdvd0 /media/dvdram (mit Packet Writing)
	mount -t udf -o rw,noatime,async,user /dev/dvdram /media/dvdram (ohne Packet Writing)
-----------
6. If you compiled it as a module, edit /etc/modules.d/aliases and add the
following lines
# vim /etc/modules.d/aliases
alias block-major-97 pktcdvd
7. For newer kernels and udftools (1.0.0b-r4)
# mkdir /dev/pktcdvd
if there are any /dev/pktcdvd* character or block devices, just delete them!
Formatting Disks
For CD-RWs do
$ cdrwtool -d /dev/scd0 -q
For DVD+RW (and probably DVD-RW) do
$ mkudffs /dev/pktcdvd/0
where "0" is the name you assigned during pktsetup, e.g.
$ pktsetup 0 /dev/hdc
If you get the error message "trying to change type of multiple extents"
after trying to format a virgin dvd+rw, use dvd+rw-format e.g
$ dvd+rw-format /dev/hdc
this will "pre-format" the blank medium. After that, try mkudffs again.