blob: c5c957195a5a741f8fc4217dfb5449c5e79bbfa8 [file] [log] [blame]
Mauro Carvalho Chehab8ea61882019-06-12 14:52:40 -03001==============
2Packet writing
3==============
4
Linus Torvalds1da177e2005-04-16 15:20:36 -07005Getting started quick
6---------------------
7
8- Select packet support in the block device section and UDF support in
9 the file system section.
10
11- Compile and install kernel and modules, reboot.
12
13- You need the udftools package (pktsetup, mkudffs, cdrwtool).
14 Download from http://sourceforge.net/projects/linux-udf/
15
16- Grab a new CD-RW disc and format it (assuming CD-RW is hdc, substitute
Mauro Carvalho Chehab8ea61882019-06-12 14:52:40 -030017 as appropriate)::
18
Linus Torvalds1da177e2005-04-16 15:20:36 -070019 # cdrwtool -d /dev/hdc -q
20
Mauro Carvalho Chehab8ea61882019-06-12 14:52:40 -030021- Setup your writer::
22
Linus Torvalds1da177e2005-04-16 15:20:36 -070023 # pktsetup dev_name /dev/hdc
24
Mauro Carvalho Chehab8ea61882019-06-12 14:52:40 -030025- Now you can mount /dev/pktcdvd/dev_name and copy files to it. Enjoy::
26
Linus Torvalds1da177e2005-04-16 15:20:36 -070027 # mount /dev/pktcdvd/dev_name /cdrom -t udf -o rw,noatime
28
29
30Packet writing for DVD-RW media
31-------------------------------
32
33DVD-RW discs can be written to much like CD-RW discs if they are in
34the so called "restricted overwrite" mode. To put a disc in restricted
Mauro Carvalho Chehab8ea61882019-06-12 14:52:40 -030035overwrite mode, run::
Linus Torvalds1da177e2005-04-16 15:20:36 -070036
37 # dvd+rw-format /dev/hdc
38
Mauro Carvalho Chehab8ea61882019-06-12 14:52:40 -030039You can then use the disc the same way you would use a CD-RW disc::
Linus Torvalds1da177e2005-04-16 15:20:36 -070040
41 # pktsetup dev_name /dev/hdc
42 # mount /dev/pktcdvd/dev_name /cdrom -t udf -o rw,noatime
43
44
45Packet writing for DVD+RW media
46-------------------------------
47
48According to the DVD+RW specification, a drive supporting DVD+RW discs
49shall implement "true random writes with 2KB granularity", which means
50that it should be possible to put any filesystem with a block size >=
Mauro Carvalho Chehab8ea61882019-06-12 14:52:40 -0300512KB on such a disc. For example, it should be possible to do::
Linus Torvalds1da177e2005-04-16 15:20:36 -070052
53 # dvd+rw-format /dev/hdc (only needed if the disc has never
54 been formatted)
55 # mkudffs /dev/hdc
56 # mount /dev/hdc /cdrom -t udf -o rw,noatime
57
58However, some drives don't follow the specification and expect the
59host to perform aligned writes at 32KB boundaries. Other drives do
60follow the specification, but suffer bad performance problems if the
61writes are not 32KB aligned.
62
63Both problems can be solved by using the pktcdvd driver, which always
Mauro Carvalho Chehab8ea61882019-06-12 14:52:40 -030064generates aligned writes::
Linus Torvalds1da177e2005-04-16 15:20:36 -070065
66 # dvd+rw-format /dev/hdc
67 # pktsetup dev_name /dev/hdc
68 # mkudffs /dev/pktcdvd/dev_name
69 # mount /dev/pktcdvd/dev_name /cdrom -t udf -o rw,noatime
70
71
72Packet writing for DVD-RAM media
73--------------------------------
74
75DVD-RAM discs are random writable, so using the pktcdvd driver is not
76necessary. However, using the pktcdvd driver can improve performance
77in the same way it does for DVD+RW media.
78
79
80Notes
81-----
82
83- CD-RW media can usually not be overwritten more than about 1000
84 times, so to avoid unnecessary wear on the media, you should always
85 use the noatime mount option.
86
87- Defect management (ie automatic remapping of bad sectors) has not
88 been implemented yet, so you are likely to get at least some
89 filesystem corruption if the disc wears out.
90
91- Since the pktcdvd driver makes the disc appear as a regular block
92 device with a 2KB block size, you can put any filesystem you like on
Mauro Carvalho Chehab8ea61882019-06-12 14:52:40 -030093 the disc. For example, run::
Linus Torvalds1da177e2005-04-16 15:20:36 -070094
95 # /sbin/mke2fs /dev/pktcdvd/dev_name
96
97 to create an ext2 filesystem on the disc.
98
99
Thomas Maier32694852006-12-08 02:36:12 -0800100Using the pktcdvd sysfs interface
101---------------------------------
102
Thomas Maier83f3aa32007-02-10 01:45:11 -0800103Since Linux 2.6.20, the pktcdvd module has a sysfs interface
Thomas Maier32694852006-12-08 02:36:12 -0800104and can be controlled by it. For example the "pktcdvd" tool uses
Justin P. Mattock0ea6e612010-07-23 20:51:24 -0700105this interface. (see http://tom.ist-im-web.de/download/pktcdvd )
Thomas Maier32694852006-12-08 02:36:12 -0800106
Mauro Carvalho Chehab8ea61882019-06-12 14:52:40 -0300107"pktcdvd" works similar to "pktsetup", e.g.::
Thomas Maier32694852006-12-08 02:36:12 -0800108
109 # pktcdvd -a dev_name /dev/hdc
110 # mkudffs /dev/pktcdvd/dev_name
111 # mount -t udf -o rw,noatime /dev/pktcdvd/dev_name /dvdram
112 # cp files /dvdram
113 # umount /dvdram
114 # pktcdvd -r dev_name
115
116
117For a description of the sysfs interface look into the file:
118
Paul Bolle395cf962011-08-15 02:02:26 +0200119 Documentation/ABI/testing/sysfs-class-pktcdvd
Thomas Maier32694852006-12-08 02:36:12 -0800120
121
122Using the pktcdvd debugfs interface
123-----------------------------------
124
Mauro Carvalho Chehab8ea61882019-06-12 14:52:40 -0300125To read pktcdvd device infos in human readable form, do::
Thomas Maier32694852006-12-08 02:36:12 -0800126
GeunSik Lim156f5a72009-06-02 15:01:37 +0900127 # cat /sys/kernel/debug/pktcdvd/pktcdvd[0-7]/info
Thomas Maier32694852006-12-08 02:36:12 -0800128
129For a description of the debugfs interface look into the file:
130
131 Documentation/ABI/testing/debugfs-pktcdvd
132
133
134
Linus Torvalds1da177e2005-04-16 15:20:36 -0700135Links
136-----
137
138See http://fy.chalmers.se/~appro/linux/DVD+RW/ for more information
139about DVD writing.