Path: blob/master/Documentation/cdrom/packet-writing.txt
10821 views
Getting started quick1---------------------23- Select packet support in the block device section and UDF support in4the file system section.56- Compile and install kernel and modules, reboot.78- You need the udftools package (pktsetup, mkudffs, cdrwtool).9Download from http://sourceforge.net/projects/linux-udf/1011- Grab a new CD-RW disc and format it (assuming CD-RW is hdc, substitute12as appropriate):13# cdrwtool -d /dev/hdc -q1415- Setup your writer16# pktsetup dev_name /dev/hdc1718- Now you can mount /dev/pktcdvd/dev_name and copy files to it. Enjoy!19# mount /dev/pktcdvd/dev_name /cdrom -t udf -o rw,noatime202122Packet writing for DVD-RW media23-------------------------------2425DVD-RW discs can be written to much like CD-RW discs if they are in26the so called "restricted overwrite" mode. To put a disc in restricted27overwrite mode, run:2829# dvd+rw-format /dev/hdc3031You can then use the disc the same way you would use a CD-RW disc:3233# pktsetup dev_name /dev/hdc34# mount /dev/pktcdvd/dev_name /cdrom -t udf -o rw,noatime353637Packet writing for DVD+RW media38-------------------------------3940According to the DVD+RW specification, a drive supporting DVD+RW discs41shall implement "true random writes with 2KB granularity", which means42that it should be possible to put any filesystem with a block size >=432KB on such a disc. For example, it should be possible to do:4445# dvd+rw-format /dev/hdc (only needed if the disc has never46been formatted)47# mkudffs /dev/hdc48# mount /dev/hdc /cdrom -t udf -o rw,noatime4950However, some drives don't follow the specification and expect the51host to perform aligned writes at 32KB boundaries. Other drives do52follow the specification, but suffer bad performance problems if the53writes are not 32KB aligned.5455Both problems can be solved by using the pktcdvd driver, which always56generates aligned writes.5758# dvd+rw-format /dev/hdc59# pktsetup dev_name /dev/hdc60# mkudffs /dev/pktcdvd/dev_name61# mount /dev/pktcdvd/dev_name /cdrom -t udf -o rw,noatime626364Packet writing for DVD-RAM media65--------------------------------6667DVD-RAM discs are random writable, so using the pktcdvd driver is not68necessary. However, using the pktcdvd driver can improve performance69in the same way it does for DVD+RW media.707172Notes73-----7475- CD-RW media can usually not be overwritten more than about 100076times, so to avoid unnecessary wear on the media, you should always77use the noatime mount option.7879- Defect management (ie automatic remapping of bad sectors) has not80been implemented yet, so you are likely to get at least some81filesystem corruption if the disc wears out.8283- Since the pktcdvd driver makes the disc appear as a regular block84device with a 2KB block size, you can put any filesystem you like on85the disc. For example, run:8687# /sbin/mke2fs /dev/pktcdvd/dev_name8889to create an ext2 filesystem on the disc.909192Using the pktcdvd sysfs interface93---------------------------------9495Since Linux 2.6.20, the pktcdvd module has a sysfs interface96and can be controlled by it. For example the "pktcdvd" tool uses97this interface. (see http://tom.ist-im-web.de/download/pktcdvd )9899"pktcdvd" works similar to "pktsetup", e.g.:100101# pktcdvd -a dev_name /dev/hdc102# mkudffs /dev/pktcdvd/dev_name103# mount -t udf -o rw,noatime /dev/pktcdvd/dev_name /dvdram104# cp files /dvdram105# umount /dvdram106# pktcdvd -r dev_name107108109For a description of the sysfs interface look into the file:110111Documentation/ABI/testing/sysfs-block-pktcdvd112113114Using the pktcdvd debugfs interface115-----------------------------------116117To read pktcdvd device infos in human readable form, do:118119# cat /sys/kernel/debug/pktcdvd/pktcdvd[0-7]/info120121For a description of the debugfs interface look into the file:122123Documentation/ABI/testing/debugfs-pktcdvd124125126127Links128-----129130See http://fy.chalmers.se/~appro/linux/DVD+RW/ for more information131about DVD writing.132133134