PacketCD
Launchpad Entry: https://launchpad.net/distros/ubuntu/+spec/foo
Created: Date(2006-01-02T21:06:48Z) by PhillipSusi
Contributors: PhillipSusi
Packages affected: udftools
Summary
This specification describes the plan to add support to ubuntu for writing to cdrw type media in packet mode
Rationale
Currently ubuntu supports writing to cd media using track/session at once mode via growisofs. This allows adding files to a cdr or cdrw easily, but can not remove files to reclaim the space, or edit files in place. Use of packet mode allows the cdrw to be used like a giant floppy. This means you can mount it as a true filesystem so command line tools can see it, and you can delete files from the disc and reuse that space without having to reformat the entire disc.
Use cases
- Joe needs to transport files he works on between work and home. He used to use floppies for this, but these days his files are much too large to fit on a floppy. Using the growisofs solutions on cdrw media is a pain because of the limited number of sessions which can be added and inability to reuse space from deleted files.
- Cindy has important documents on her hard drive and is worried that they would be lost if her hard drive crashed. She would like to be able to easily copy these documents to a cdrw for backup.
Scope
Changes are needed to the udftools package to integrate better with the hal and gnome-vfs. Eventually the kernel pktcdvd device driver needs to be improved. The kernel udf filesystem also needs a bug fix.
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 cdrw disk that has been formatted for packet writing. This device can be mounted with any filesystem, but udf is prefered. The hal should recognize media which is formatted for packet mode and auto mount it read/write. Gnome-volume-manager should also give the user an option to format the media for packet mode when a blank is inserted.
Implementation
The udftools package should be modified so that it auto configures ( right now you have to explicitly dpkg-reconfigure it ) and when it does so, it needs to add hal fdi policy files to replace the raw device with the pktcdvd virtual device so it can be correctly mounted. The policy should be able to detect when the media is formatted for packet mode and replace the block.device attribute and friends so that pmount correctly mounts the volume and it appears on the desktop. At this time I am not sure how to implement this, but I have created fdi policy files by hand that allow such media to auto mount.
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.
Gnome-volume-manager needs modified to present the user with the option to format a disc for packet mode when they insert a blank.
The udftools package has a few bugs which I have already fixed. They included:
- Document the -z ( packet size ) parameter to cdrwtool in the man page
- Fix bug in cdrwtool where some code made the assumption that the packet size was 32 sectors, causing it to break when you changed it
- Change default owning uid/gid for the new root and lost+found directories in the fresly created filesystem to -1 from 0 so that the uid= and gid= mount options will be honored
Code
- Kernel patch to fix bug with larger packet sizes in pktcdvd, and uid/gid bug in udf: attachment:pktcdvd_len_fix+udf_uid_fix.diff
- Hal fdi policy file to mount the disc with the pktcdvd device instead: attachment:15-storage-pktcdvd.fdi
Data preservation and migration
Outstanding issues
- Kernel patches need applied
- Hal FDI policy needs modified to only activate on media that is formatted for packet mode
- Still working on the udftools package updates