packet-writing.txt 3.8 KB

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