packet-writing.rst 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. ==============
  2. Packet writing
  3. ==============
  4. Getting started quick
  5. ---------------------
  6. - Select packet support in the block device section and UDF support in
  7. the file system section.
  8. - Compile and install kernel and modules, reboot.
  9. - You need the udftools package (pktsetup, mkudffs, cdrwtool).
  10. Download from http://sourceforge.net/projects/linux-udf/
  11. - Grab a new CD-RW disc and format it (assuming CD-RW is hdc, substitute
  12. as appropriate)::
  13. # cdrwtool -d /dev/hdc -q
  14. - Setup your writer::
  15. # pktsetup dev_name /dev/hdc
  16. - Now you can mount /dev/pktcdvd/dev_name and copy files to it. Enjoy::
  17. # mount /dev/pktcdvd/dev_name /cdrom -t udf -o rw,noatime
  18. Packet writing for DVD-RW media
  19. -------------------------------
  20. DVD-RW discs can be written to much like CD-RW discs if they are in
  21. the so called "restricted overwrite" mode. To put a disc in restricted
  22. overwrite mode, run::
  23. # dvd+rw-format /dev/hdc
  24. You can then use the disc the same way you would use a CD-RW disc::
  25. # pktsetup dev_name /dev/hdc
  26. # mount /dev/pktcdvd/dev_name /cdrom -t udf -o rw,noatime
  27. Packet writing for DVD+RW media
  28. -------------------------------
  29. According to the DVD+RW specification, a drive supporting DVD+RW discs
  30. shall implement "true random writes with 2KB granularity", which means
  31. that it should be possible to put any filesystem with a block size >=
  32. 2KB on such a disc. For example, it should be possible to do::
  33. # dvd+rw-format /dev/hdc (only needed if the disc has never
  34. been formatted)
  35. # mkudffs /dev/hdc
  36. # mount /dev/hdc /cdrom -t udf -o rw,noatime
  37. However, some drives don't follow the specification and expect the
  38. host to perform aligned writes at 32KB boundaries. Other drives do
  39. follow the specification, but suffer bad performance problems if the
  40. writes are not 32KB aligned.
  41. Both problems can be solved by using the pktcdvd driver, which always
  42. generates aligned writes::
  43. # dvd+rw-format /dev/hdc
  44. # pktsetup dev_name /dev/hdc
  45. # mkudffs /dev/pktcdvd/dev_name
  46. # mount /dev/pktcdvd/dev_name /cdrom -t udf -o rw,noatime
  47. Packet writing for DVD-RAM media
  48. --------------------------------
  49. DVD-RAM discs are random writable, so using the pktcdvd driver is not
  50. necessary. However, using the pktcdvd driver can improve performance
  51. in the same way it does for DVD+RW media.
  52. Notes
  53. -----
  54. - CD-RW media can usually not be overwritten more than about 1000
  55. times, so to avoid unnecessary wear on the media, you should always
  56. use the noatime mount option.
  57. - Defect management (ie automatic remapping of bad sectors) has not
  58. been implemented yet, so you are likely to get at least some
  59. filesystem corruption if the disc wears out.
  60. - Since the pktcdvd driver makes the disc appear as a regular block
  61. device with a 2KB block size, you can put any filesystem you like on
  62. the disc. For example, run::
  63. # /sbin/mke2fs /dev/pktcdvd/dev_name
  64. to create an ext2 filesystem on the disc.
  65. Using the pktcdvd sysfs interface
  66. ---------------------------------
  67. Since Linux 2.6.20, the pktcdvd module has a sysfs interface
  68. and can be controlled by it. For example the "pktcdvd" tool uses
  69. this interface. (see http://tom.ist-im-web.de/download/pktcdvd )
  70. "pktcdvd" works similar to "pktsetup", e.g.::
  71. # pktcdvd -a dev_name /dev/hdc
  72. # mkudffs /dev/pktcdvd/dev_name
  73. # mount -t udf -o rw,noatime /dev/pktcdvd/dev_name /dvdram
  74. # cp files /dvdram
  75. # umount /dvdram
  76. # pktcdvd -r dev_name
  77. For a description of the sysfs interface look into the file:
  78. Documentation/ABI/testing/sysfs-class-pktcdvd
  79. Using the pktcdvd debugfs interface
  80. -----------------------------------
  81. To read pktcdvd device infos in human readable form, do::
  82. # cat /sys/kernel/debug/pktcdvd/pktcdvd[0-7]/info
  83. For a description of the debugfs interface look into the file:
  84. Documentation/ABI/testing/debugfs-pktcdvd
  85. Links
  86. -----
  87. See http://fy.chalmers.se/~appro/linux/DVD+RW/ for more information
  88. about DVD writing.