brintos

brintos / linux-shallow public Read only

0
0
Text · 3.9 KiB · 43db58c Raw
140 lines · plain
1==============2Packet writing3==============4 5Getting started quick6---------------------7 8- Select packet support in the block device section and UDF support in9  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 https://github.com/pali/udftools15 16- Grab a new CD-RW disc and format it (assuming CD-RW is hdc, substitute17  as appropriate)::18 19	# cdrwtool -d /dev/hdc -q20 21- Setup your writer::22 23	# pktsetup dev_name /dev/hdc24 25- Now you can mount /dev/pktcdvd/dev_name and copy files to it. Enjoy::26 27	# mount /dev/pktcdvd/dev_name /cdrom -t udf -o rw,noatime28 29 30Packet writing for DVD-RW media31-------------------------------32 33DVD-RW discs can be written to much like CD-RW discs if they are in34the so called "restricted overwrite" mode. To put a disc in restricted35overwrite mode, run::36 37	# dvd+rw-format /dev/hdc38 39You can then use the disc the same way you would use a CD-RW disc::40 41	# pktsetup dev_name /dev/hdc42	# mount /dev/pktcdvd/dev_name /cdrom -t udf -o rw,noatime43 44 45Packet writing for DVD+RW media46-------------------------------47 48According to the DVD+RW specification, a drive supporting DVD+RW discs49shall implement "true random writes with 2KB granularity", which means50that it should be possible to put any filesystem with a block size >=512KB on such a disc. For example, it should be possible to do::52 53	# dvd+rw-format /dev/hdc   (only needed if the disc has never54	                            been formatted)55	# mkudffs /dev/hdc56	# mount /dev/hdc /cdrom -t udf -o rw,noatime57 58However, some drives don't follow the specification and expect the59host to perform aligned writes at 32KB boundaries. Other drives do60follow the specification, but suffer bad performance problems if the61writes are not 32KB aligned.62 63Both problems can be solved by using the pktcdvd driver, which always64generates aligned writes::65 66	# dvd+rw-format /dev/hdc67	# pktsetup dev_name /dev/hdc68	# mkudffs /dev/pktcdvd/dev_name69	# mount /dev/pktcdvd/dev_name /cdrom -t udf -o rw,noatime70 71 72Packet writing for DVD-RAM media73--------------------------------74 75DVD-RAM discs are random writable, so using the pktcdvd driver is not76necessary. However, using the pktcdvd driver can improve performance77in the same way it does for DVD+RW media.78 79 80Notes81-----82 83- CD-RW media can usually not be overwritten more than about 100084  times, so to avoid unnecessary wear on the media, you should always85  use the noatime mount option.86 87- Defect management (ie automatic remapping of bad sectors) has not88  been implemented yet, so you are likely to get at least some89  filesystem corruption if the disc wears out.90 91- Since the pktcdvd driver makes the disc appear as a regular block92  device with a 2KB block size, you can put any filesystem you like on93  the disc. For example, run::94 95	# /sbin/mke2fs /dev/pktcdvd/dev_name96 97  to create an ext2 filesystem on the disc.98 99 100Using the pktcdvd sysfs interface101---------------------------------102 103Since Linux 2.6.20, the pktcdvd module has a sysfs interface104and can be controlled by it. For example the "pktcdvd" tool uses105this interface. (see http://tom.ist-im-web.de/linux/software/pktcdvd )106 107"pktcdvd" works similar to "pktsetup", e.g.::108 109	# pktcdvd -a dev_name /dev/hdc110	# mkudffs /dev/pktcdvd/dev_name111	# mount -t udf -o rw,noatime /dev/pktcdvd/dev_name /dvdram112	# cp files /dvdram113	# umount /dvdram114	# pktcdvd -r dev_name115 116 117For a description of the sysfs interface look into the file:118 119  Documentation/ABI/testing/sysfs-class-pktcdvd120 121 122Using the pktcdvd debugfs interface123-----------------------------------124 125To read pktcdvd device infos in human readable form, do::126 127	# cat /sys/kernel/debug/pktcdvd/pktcdvd[0-7]/info128 129For a description of the debugfs interface look into the file:130 131  Documentation/ABI/testing/debugfs-pktcdvd132 133 134 135Links136-----137 138See http://fy.chalmers.se/~appro/linux/DVD+RW/ for more information139about DVD writing.140