Summary

Ubuntu lacks proper support for packet-writing. This spec is an implementation plan for adding such support.

Rationale

The only way to write to CD/DVD media is using the CD/DVD creator in Nautilus. While this is useful, it does not give the ability to remove or modify files using standard tools such as text and image editors. What packet-writing gives us is the ability to treat the CD like a normal file system, including reclaiming freed space.

Use cases

Scope

Basic support in the kernel and udftools seem to be present. However, pktsetup doesn't integrate with hal and pmount as it should. In addition, gnome-volume-manager needs support for handling packet-written CD/DVDs and mounting them as such rather than as UDF media. Nautilus-cd-burner or similar needs additional code to handle formatting of media.

Design

Currently the udftools package can be installed and configured, which will set up the kernel packet writer module to create a new device which allows full read/write access to a cd/dvd+-rw disk that has been formatted for packet writing. This device can be mounted with any filesystem, but udf is prefered. Currently the package uses a configuration file that you must edit to list the devices which should have a pktcdvd device created and associated with them. This should be removed and instead the hal should invoke pktsetup to configure cd/dvd+-rw drives as they are detected. The pktsetup program needs modified slightly to be more plug and play friendly. Gnome-volume-manager needs modified to give the user an option to format the media for packet mode when a blank is inserted and to detect when a disc already formatted for packet mode is inserted and mount it via the corresponding pktcdvd device instead.

Implementation

The kernel pktcdvd driver seems to have hard limit on the maximum packet length that is set at compile time. Right now that size is 32 sectors ( 64 KB ) and when a 700 MB cdrw disc is formatted using packets of this size, it yields only 575 MB of usable space. Increasing the packet length to 128 sectors gives a usable space of 666.25 MB. I believe that the driver should be fixed so that it can dynamically use the correct packet length specified in the track header on the disc, but in the mean time, increasing the compile time constant from 32 to 128 should be sufficient.

The kernel udf filesystem driver currently does not update the on disc owning uid/gid if they match the value specified in the mount options. For removable media such as this, the logged in user id will be specified in the mount options because it is assumed that the media will be used in other computers which won't have the same meanings of uids/gids. This bug was causing files owned by the desktop user to revert to being owned by the previous user ( root if newly created ) when the disc was unmounted and remounted.

I fixed this by patching the code to allways save the owning uid/gid to disc, but substitute -1 if the id matches that in the mount option. The filesystem already substitutes the mount id when it reads a -1 from the disc, so this has the net effect of allowing the desktop user to allways own the file, even if a different user logs in and uses the disc, or if the disc is used in another computer. Any ownerships other than the id specified in the mount options will be retained on disc as is.

The udftools package has a few bugs which I have already fixed. They included:

Code

Data preservation and migration

Outstanding issues

BoF agenda and discussion


CategorySpec

PacketCD (last edited 2008-08-06 16:26:04 by localhost)