0001 ==============
0002 Packet writing
0003 ==============
0004
0005 Getting started quick
0006 ---------------------
0007
0008 - Select packet support in the block device section and UDF support in
0009 the file system section.
0010
0011 - Compile and install kernel and modules, reboot.
0012
0013 - You need the udftools package (pktsetup, mkudffs, cdrwtool).
0014 Download from https://github.com/pali/udftools
0015
0016 - Grab a new CD-RW disc and format it (assuming CD-RW is hdc, substitute
0017 as appropriate)::
0018
0019 # cdrwtool -d /dev/hdc -q
0020
0021 - Setup your writer::
0022
0023 # pktsetup dev_name /dev/hdc
0024
0025 - Now you can mount /dev/pktcdvd/dev_name and copy files to it. Enjoy::
0026
0027 # mount /dev/pktcdvd/dev_name /cdrom -t udf -o rw,noatime
0028
0029
0030 Packet writing for DVD-RW media
0031 -------------------------------
0032
0033 DVD-RW discs can be written to much like CD-RW discs if they are in
0034 the so called "restricted overwrite" mode. To put a disc in restricted
0035 overwrite mode, run::
0036
0037 # dvd+rw-format /dev/hdc
0038
0039 You can then use the disc the same way you would use a CD-RW disc::
0040
0041 # pktsetup dev_name /dev/hdc
0042 # mount /dev/pktcdvd/dev_name /cdrom -t udf -o rw,noatime
0043
0044
0045 Packet writing for DVD+RW media
0046 -------------------------------
0047
0048 According to the DVD+RW specification, a drive supporting DVD+RW discs
0049 shall implement "true random writes with 2KB granularity", which means
0050 that it should be possible to put any filesystem with a block size >=
0051 2KB on such a disc. For example, it should be possible to do::
0052
0053 # dvd+rw-format /dev/hdc (only needed if the disc has never
0054 been formatted)
0055 # mkudffs /dev/hdc
0056 # mount /dev/hdc /cdrom -t udf -o rw,noatime
0057
0058 However, some drives don't follow the specification and expect the
0059 host to perform aligned writes at 32KB boundaries. Other drives do
0060 follow the specification, but suffer bad performance problems if the
0061 writes are not 32KB aligned.
0062
0063 Both problems can be solved by using the pktcdvd driver, which always
0064 generates aligned writes::
0065
0066 # dvd+rw-format /dev/hdc
0067 # pktsetup dev_name /dev/hdc
0068 # mkudffs /dev/pktcdvd/dev_name
0069 # mount /dev/pktcdvd/dev_name /cdrom -t udf -o rw,noatime
0070
0071
0072 Packet writing for DVD-RAM media
0073 --------------------------------
0074
0075 DVD-RAM discs are random writable, so using the pktcdvd driver is not
0076 necessary. However, using the pktcdvd driver can improve performance
0077 in the same way it does for DVD+RW media.
0078
0079
0080 Notes
0081 -----
0082
0083 - CD-RW media can usually not be overwritten more than about 1000
0084 times, so to avoid unnecessary wear on the media, you should always
0085 use the noatime mount option.
0086
0087 - Defect management (ie automatic remapping of bad sectors) has not
0088 been implemented yet, so you are likely to get at least some
0089 filesystem corruption if the disc wears out.
0090
0091 - Since the pktcdvd driver makes the disc appear as a regular block
0092 device with a 2KB block size, you can put any filesystem you like on
0093 the disc. For example, run::
0094
0095 # /sbin/mke2fs /dev/pktcdvd/dev_name
0096
0097 to create an ext2 filesystem on the disc.
0098
0099
0100 Using the pktcdvd sysfs interface
0101 ---------------------------------
0102
0103 Since Linux 2.6.20, the pktcdvd module has a sysfs interface
0104 and can be controlled by it. For example the "pktcdvd" tool uses
0105 this interface. (see http://tom.ist-im-web.de/linux/software/pktcdvd )
0106
0107 "pktcdvd" works similar to "pktsetup", e.g.::
0108
0109 # pktcdvd -a dev_name /dev/hdc
0110 # mkudffs /dev/pktcdvd/dev_name
0111 # mount -t udf -o rw,noatime /dev/pktcdvd/dev_name /dvdram
0112 # cp files /dvdram
0113 # umount /dvdram
0114 # pktcdvd -r dev_name
0115
0116
0117 For a description of the sysfs interface look into the file:
0118
0119 Documentation/ABI/testing/sysfs-class-pktcdvd
0120
0121
0122 Using the pktcdvd debugfs interface
0123 -----------------------------------
0124
0125 To read pktcdvd device infos in human readable form, do::
0126
0127 # cat /sys/kernel/debug/pktcdvd/pktcdvd[0-7]/info
0128
0129 For a description of the debugfs interface look into the file:
0130
0131 Documentation/ABI/testing/debugfs-pktcdvd
0132
0133
0134
0135 Links
0136 -----
0137
0138 See http://fy.chalmers.se/~appro/linux/DVD+RW/ for more information
0139 about DVD writing.