1 ============== 1 ============== 2 Packet writing 2 Packet writing 3 ============== 3 ============== 4 4 5 Getting started quick 5 Getting started quick 6 --------------------- 6 --------------------- 7 7 8 - Select packet support in the block device se 8 - Select packet support in the block device section and UDF support in 9 the file system section. 9 the file system section. 10 10 11 - Compile and install kernel and modules, rebo 11 - Compile and install kernel and modules, reboot. 12 12 13 - You need the udftools package (pktsetup, mku 13 - You need the udftools package (pktsetup, mkudffs, cdrwtool). 14 Download from https://github.com/pali/udftoo 14 Download from https://github.com/pali/udftools 15 15 16 - Grab a new CD-RW disc and format it (assumin 16 - Grab a new CD-RW disc and format it (assuming CD-RW is hdc, substitute 17 as appropriate):: 17 as appropriate):: 18 18 19 # cdrwtool -d /dev/hdc -q 19 # cdrwtool -d /dev/hdc -q 20 20 21 - Setup your writer:: 21 - Setup your writer:: 22 22 23 # pktsetup dev_name /dev/hdc 23 # pktsetup dev_name /dev/hdc 24 24 25 - Now you can mount /dev/pktcdvd/dev_name and 25 - Now you can mount /dev/pktcdvd/dev_name and copy files to it. Enjoy:: 26 26 27 # mount /dev/pktcdvd/dev_name /cdrom - 27 # mount /dev/pktcdvd/dev_name /cdrom -t udf -o rw,noatime 28 28 29 29 30 Packet writing for DVD-RW media 30 Packet writing for DVD-RW media 31 ------------------------------- 31 ------------------------------- 32 32 33 DVD-RW discs can be written to much like CD-RW 33 DVD-RW discs can be written to much like CD-RW discs if they are in 34 the so called "restricted overwrite" mode. To 34 the so called "restricted overwrite" mode. To put a disc in restricted 35 overwrite mode, run:: 35 overwrite mode, run:: 36 36 37 # dvd+rw-format /dev/hdc 37 # dvd+rw-format /dev/hdc 38 38 39 You can then use the disc the same way you wou 39 You can then use the disc the same way you would use a CD-RW disc:: 40 40 41 # pktsetup dev_name /dev/hdc 41 # pktsetup dev_name /dev/hdc 42 # mount /dev/pktcdvd/dev_name /cdrom - 42 # mount /dev/pktcdvd/dev_name /cdrom -t udf -o rw,noatime 43 43 44 44 45 Packet writing for DVD+RW media 45 Packet writing for DVD+RW media 46 ------------------------------- 46 ------------------------------- 47 47 48 According to the DVD+RW specification, a drive 48 According to the DVD+RW specification, a drive supporting DVD+RW discs 49 shall implement "true random writes with 2KB g 49 shall implement "true random writes with 2KB granularity", which means 50 that it should be possible to put any filesyst 50 that it should be possible to put any filesystem with a block size >= 51 2KB on such a disc. For example, it should be 51 2KB on such a disc. For example, it should be possible to do:: 52 52 53 # dvd+rw-format /dev/hdc (only neede 53 # dvd+rw-format /dev/hdc (only needed if the disc has never 54 been forma 54 been formatted) 55 # mkudffs /dev/hdc 55 # mkudffs /dev/hdc 56 # mount /dev/hdc /cdrom -t udf -o rw,n 56 # mount /dev/hdc /cdrom -t udf -o rw,noatime 57 57 58 However, some drives don't follow the specific 58 However, some drives don't follow the specification and expect the 59 host to perform aligned writes at 32KB boundar 59 host to perform aligned writes at 32KB boundaries. Other drives do 60 follow the specification, but suffer bad perfo 60 follow the specification, but suffer bad performance problems if the 61 writes are not 32KB aligned. 61 writes are not 32KB aligned. 62 62 63 Both problems can be solved by using the pktcd 63 Both problems can be solved by using the pktcdvd driver, which always 64 generates aligned writes:: 64 generates aligned writes:: 65 65 66 # dvd+rw-format /dev/hdc 66 # dvd+rw-format /dev/hdc 67 # pktsetup dev_name /dev/hdc 67 # pktsetup dev_name /dev/hdc 68 # mkudffs /dev/pktcdvd/dev_name 68 # mkudffs /dev/pktcdvd/dev_name 69 # mount /dev/pktcdvd/dev_name /cdrom - 69 # mount /dev/pktcdvd/dev_name /cdrom -t udf -o rw,noatime 70 70 71 71 72 Packet writing for DVD-RAM media 72 Packet writing for DVD-RAM media 73 -------------------------------- 73 -------------------------------- 74 74 75 DVD-RAM discs are random writable, so using th 75 DVD-RAM discs are random writable, so using the pktcdvd driver is not 76 necessary. However, using the pktcdvd driver c 76 necessary. However, using the pktcdvd driver can improve performance 77 in the same way it does for DVD+RW media. 77 in the same way it does for DVD+RW media. 78 78 79 79 80 Notes 80 Notes 81 ----- 81 ----- 82 82 83 - CD-RW media can usually not be overwritten m 83 - CD-RW media can usually not be overwritten more than about 1000 84 times, so to avoid unnecessary wear on the m 84 times, so to avoid unnecessary wear on the media, you should always 85 use the noatime mount option. 85 use the noatime mount option. 86 86 87 - Defect management (ie automatic remapping of 87 - Defect management (ie automatic remapping of bad sectors) has not 88 been implemented yet, so you are likely to g 88 been implemented yet, so you are likely to get at least some 89 filesystem corruption if the disc wears out. 89 filesystem corruption if the disc wears out. 90 90 91 - Since the pktcdvd driver makes the disc appe 91 - Since the pktcdvd driver makes the disc appear as a regular block 92 device with a 2KB block size, you can put an 92 device with a 2KB block size, you can put any filesystem you like on 93 the disc. For example, run:: 93 the disc. For example, run:: 94 94 95 # /sbin/mke2fs /dev/pktcdvd/dev_name 95 # /sbin/mke2fs /dev/pktcdvd/dev_name 96 96 97 to create an ext2 filesystem on the disc. 97 to create an ext2 filesystem on the disc. 98 98 99 99 100 Using the pktcdvd sysfs interface 100 Using the pktcdvd sysfs interface 101 --------------------------------- 101 --------------------------------- 102 102 103 Since Linux 2.6.20, the pktcdvd module has a s 103 Since Linux 2.6.20, the pktcdvd module has a sysfs interface 104 and can be controlled by it. For example the " 104 and can be controlled by it. For example the "pktcdvd" tool uses 105 this interface. (see http://tom.ist-im-web.de/ 105 this interface. (see http://tom.ist-im-web.de/linux/software/pktcdvd ) 106 106 107 "pktcdvd" works similar to "pktsetup", e.g.:: 107 "pktcdvd" works similar to "pktsetup", e.g.:: 108 108 109 # pktcdvd -a dev_name /dev/hdc 109 # pktcdvd -a dev_name /dev/hdc 110 # mkudffs /dev/pktcdvd/dev_name 110 # mkudffs /dev/pktcdvd/dev_name 111 # mount -t udf -o rw,noatime /dev/pktc 111 # mount -t udf -o rw,noatime /dev/pktcdvd/dev_name /dvdram 112 # cp files /dvdram 112 # cp files /dvdram 113 # umount /dvdram 113 # umount /dvdram 114 # pktcdvd -r dev_name 114 # pktcdvd -r dev_name 115 115 116 116 117 For a description of the sysfs interface look 117 For a description of the sysfs interface look into the file: 118 118 119 Documentation/ABI/testing/sysfs-class-pktcdv 119 Documentation/ABI/testing/sysfs-class-pktcdvd 120 120 121 121 122 Using the pktcdvd debugfs interface 122 Using the pktcdvd debugfs interface 123 ----------------------------------- 123 ----------------------------------- 124 124 125 To read pktcdvd device infos in human readable 125 To read pktcdvd device infos in human readable form, do:: 126 126 127 # cat /sys/kernel/debug/pktcdvd/pktcdv 127 # cat /sys/kernel/debug/pktcdvd/pktcdvd[0-7]/info 128 128 129 For a description of the debugfs interface loo 129 For a description of the debugfs interface look into the file: 130 130 131 Documentation/ABI/testing/debugfs-pktcdvd 131 Documentation/ABI/testing/debugfs-pktcdvd 132 132 133 133 134 134 135 Links 135 Links 136 ----- 136 ----- 137 137 138 See http://fy.chalmers.se/~appro/linux/DVD+RW/ 138 See http://fy.chalmers.se/~appro/linux/DVD+RW/ for more information 139 about DVD writing. 139 about DVD writing.
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.