linux/Documentation/cdrom/packet-writing.txt
<<
ntatv3./spa v3./form v3.a ntatv3 href="../linux+v3 >1/Documenta4" /cdrom/packet-writing.txt">ntatv3.img src="../.sta4"c/gfx/right.png" alt=">>">nt./spa nt.spa class="lxr_search">ntatntatv3.input typon>hidden" namon>navtarget" option>">ntatv3.input typon>text" namon>search" idn>search">ntatv3.butt4submit">Searchntatv3Prefs v3./a>nt./spa atv3 3./div atv3 3.form ac4" ="ajax+*" method="post" onsubmit="return false;">nt.input typon>hidden" namon>ajax_lookup" idn>ajax_lookup" option>">natv3 3./form natv3 3.div class="headingbott4m">
search_results" class="search_results" v atv3 3./div .div idn>content" .div idn>file_contents"
74/fa/ed180482f0e8be6d29e3024948d07600c543_3/0" L1" class="line" namon>L1">3 31./a>Getting started quick
L2" class="line" namon>L2">3 32./a>---------------------
L3" class="line" namon>L3">3 33./a>nL4" class="line" namon>L4">3 34./a>- Select packet support iL5" class="line" namon>L5">3 35./a> /the file system sec4"
	.nL6" class="line" namon>L6">3 36./a>nL7" class="line" namon>L7">3 37./a>- Compile and install kernel and modules, reboot.nL8" class="line" namon>L8">3 38./a>nL9" class="line" namon>L9">3 39./a>- You need the udftools package (pktsetup, mkudffs, cdrwtool).nL10" class="line" namon>L10">3 >
  a> /Download from3.a href="http://sourceforge.net/projec4s/linux-udf/">http://sourceforge.net/projec4s/linux-udf/./a>nL11" class="line" namon>L11">3 11./a>nL12" class="line" namon>L12">3 12./a>- Grab a new CD-RW disc and format it (assuming CD-RW is hdc, substitutenL13" class="line" namon>L13">3 13  a> /as appropriate):nL14" class="line" namon>L14">3 14  a> ///////# cdrwtool -d /dev/hdc -qnL15" class="line" namon>L15">3 15./a>nL16" class="line" namon>L16">3 16./a>- Setup your writernL17" class="line" namon>L17">3 17  a> ///////# pktsetup dev_namo /dev/hdcnL18" class="line" namon>L18">3 18./a>nL19" class="line" namon>L19">3 19./a>- Now you ca	 mount /dev/pktcdvd/dev_namo and copy files to it. Enjoy!
L20" class="line" namon>L20">3 20  a> ///////# mount /dev/pktcdvd/dev_namo /cdrom -t udf -o rw,noa4"menL21" class="line" namon>L21">3 21./a>nL22" class="line" namon>L22">3 22./a>nL23" class="line" namon>L23">3 23  a>Packet writing for DVD-RW medianL24" class="line" namon>L24">3 24./a>-------------------------------
L25" class="line" namon>L25">3 25./a>nL26" class="line" namon>L26">3 26./a>DVD-RW discs ca	 be written to much like CD-RW discs if they are iL27" class="line" namon>L27">3 27  a>the so called "restricted overwrite" mode. To put a disc iL28" class="line" namon>L28">3 28./a>overwrite mode, run:nL29" class="line" namon>L29">3 29./a>nL30" class="line" namon>L30">3 30  a> ///////# dvd+rw-format /dev/hdcnL31" class="line" namon>L31">3 31./a>nL32" class="line" namon>L32">3 32./a>You ca	 then use the disc the samo way you would use a CD-RW disc:nL33" class="line" namon>L33">3 33./a>nL34" class="line" namon>L34">3 34  a> ///////# pktsetup dev_namo /dev/hdcnL35" class="line" namon>L35">3 35  a> ///////# mount /dev/pktcdvd/dev_namo /cdrom -t udf -o rw,noa4"menL36" class="line" namon>L36">3 36./a>nL37" class="line" namon>L37">3 37./a>nL38" class="line" namon>L38">3 38  a>Packet writing for DVD+RW medianL39" class="line" namon>L39">3 39./a>-------------------------------
L40" class="line" namon>L40">3 40./a>nL41" class="line" namon>L41">3 41./a>According to the DVD+RW specifica4"
	, a drive supporting DVD+RW discsnL42" class="line" namon>L42">3 42./a>shall implement "true random writes with 2KB granularity", which meansnL43" class="line" namon>L43">3 43  a>that it should be possible to put any filesystem with a block size >=nL44" class="line" namon>L44">3 44  a>2KB on such a disc. For example, it should be possible to do:nL45" class="line" namon>L45">3 45./a>nL46" class="line" namon>L46">3 46  a> ///////# dvd+rw-format /dev/hdc///(only needed if the disc has nevernL47" class="line" namon>L47">3 47  a> ///////////////////////////////////been formatted)nL48" class="line" namon>L48">3 48  a> ///////# mkudffs /dev/hdcnL49" class="line" namon>L49">3 49  a> ///////# mount /dev/hdc//cdrom -t udf -o rw,noa4"menL50" class="line" namon>L50">3 50./a>nL51" class="line" namon>L51">3 51./a>However, somo drives don't follow the specifica4"
	 and expect thenL52" class="line" namon>L52">3 52./a>host to perform aligned writes at 32KB boundaries. Other drives donL53" class="line" namon>L53">3 53  a>follow the specifica4"
	, but suffer bad performance problems if thenL54" class="line" namon>L54">3 54  a>writes are not 32KB aligned.nL55" class="line" namon>L55">3 55./a>nL56" class="line" namon>L56">3 56  a>Both problems ca	 be solved by using the pktcdvd driver, which alwaysnL57" class="line" namon>L57">3 57  a>generates aligned writes.nL58" class="line" namon>L58">3 58./a>nL59" class="line" namon>L59">3 59  a> ///////# dvd+rw-format /dev/hdcnL60" class="line" namon>L60">3 60  a> ///////# pktsetup dev_namo /dev/hdcnL61" class="line" namon>L61">3 61  a> ///////# mkudffs /dev/pktcdvd/dev_namonL62" class="line" namon>L62">3 62  a> ///////# mount /dev/pktcdvd/dev_namo /cdrom -t udf -o rw,noa4"menL63" class="line" namon>L63">3 63./a>nL64" class="line" namon>L64">3 64./a>nL65" class="line" namon>L65">3 65  a>Packet writing for DVD-RAM medianL66" class="line" namon>L66">3 66./a>--------------------------------
L67" class="line" namon>L67">3 67./a>nL68" class="line" namon>L68">3 68./a>DVD-RAM discs are random writable, so using the pktcdvd driver is notnL69" class="line" namon>L69">3 69  a>necessary. However, using the pktcdvd driver ca	 improve performancenL70" class="line" namon>L70">3 70  a>iL71" class="line" namon>L71">3 71./a>nL72" class="line" namon>L72">3 72./a>nL73" class="line" namon>L73">3 73./a>NotesnL74" class="line" namon>L74">3 74./a>-----nL75" class="line" namon>L75">3 75./a>nL76" class="line" namon>L76">3 76./a>- CD-RW media ca	 usually not be overwritten more tha	 about 1000nL77" class="line" namon>L77">3 77  a> /4"mes, so to avoid unnecessary wear on the media, you should alwaysnL78" class="line" namon>L78">3 78  a> /use the noa4"me mount .24"
	.nL79" class="line" namon>L79">3 79./a>nL80" class="line" namon>L80">3 80./a>- Defect management (ie automa4"c remapping of bad sec4ors) has notnL81" class="line" namon>L81">3 81  a> /been implemented yet, so you are likely to get at least somonL82" class="line" namon>L82">3 82  a> /filesystem corru4.24L83" class="line" namon>L83">3 83./a>nL84" class="line" namon>L84">3 84./a>- Since the pktcdvd driver makes the disc appear as a regular blocknL85" class="line" namon>L85">3 85  a> /device with a 2KB block size, you ca	 put any filesystem you like oL86" class="line" namon>L86">3 86./a> /the disc. For example, run:nL87" class="line" namon>L87">3 87./a>nL88" class="line" namon>L88">3 88  a> ///////# /sbin/mke2fs /dev/pktcdvd/dev_namonL89" class="line" namon>L89">3 89./a>nL90" class="line" namon>L90">3 90  a> /to creato an ext2 filesystem on the disc.nL91" class="line" namon>L91">3 91./a>nL92" class="line" namon>L92">3 92./a>nL93" class="line" namon>L93">3 93./a>Using the pktcdvd sysfs interfacenL94" class="line" namon>L94">3 94./a>---------------------------------nL95" class="line" namon>L95">3 95./a>nL96" class="line" namon>L96">3 96./a>Since Linux 2  >20, the pktcdvd module has a sysfs interfacenL97" class="line" namon>L97">3 97./a>and ca	 be controlled by it. For example the "pktcdvd" tool usesnL98" class="line" namon>L98">3 98  a>this interface. (see3.a href="http://tom.ist-im-web.de/download/pktcdvd ">http://tom.ist-im-web.de/download/pktcdvd   a>)nL99" class="line" namon>L99">3 99./a>nL100" class="line" namon>L100">3100./a>"pktcdvd" works similar to "pktsetup", e.g.:nL101" class="line" namon>L101">3101./a>nL102" class="line" namon>L102">3102  a> ///////# pktcdvd -a dev_namo /dev/hdcnL103" class="line" namon>L103">3103  a> ///////# mkudffs /dev/pktcdvd/dev_namonL104" class="line" namon>L104">3104  a> ///////# mount -t udf -o rw,noa4"me /dev/pktcdvd/dev_namo /dvdramnL105" class="line" namon>L105">3105  a> ///////# cp files /dvdramnL106" class="line" namon>L106">3106  a> ///////# umount /dvdramnL107" class="line" namon>L107">3107  a> ///////# pktcdvd -r dev_namonL108" class="line" namon>L108">3108./a>nL109" class="line" namon>L109">3109./a>nL110" class="line" namon>L110">31>
  a>For a descri4.24L111" class="line" namon>L111">3111./a>nL112" class="line" namon>L112">3112  a> /Documenta4"
	/ABI/testing/sysfs-class-pktcdvdnL113" class="line" namon>L113">3113./a>nL114" class="line" namon>L114">3114./a>nL115" class="line" namon>L115">3115./a>Using the pktcdvd debugfs interfacenL116" class="line" namon>L116">3116./a>-----------------------------------nL117" class="line" namon>L117">3117./a>nL118" class="line" namon>L118">3118./a>To read pktcdvd device infos in human readable form, do:nL119" class="line" namon>L119">3119./a>nL120" class="line" namon>L120">3120  a> ///////# cat /sys/kernel/debug/pktcdvd/pktcdvd[0-7]/infonL121" class="line" namon>L121">3121./a>nL122" class="line" namon>L122">3122./a>For a descri4.24L123" class="line" namon>L123">3123./a>nL124" class="line" namon>L124">3124  a> /Documenta4"
	/ABI/testing/debugfs-pktcdvdnL125" class="line" namon>L125">3125./a>nL126" class="line" namon>L126">3126./a>nL127" class="line" namon>L127">3127./a>nL128" class="line" namon>L128">3128./a>LinksnL129" class="line" namon>L129">3129./a>-----nL130" class="line" namon>L130">3130./a>nL131" class="line" namon>L131">3131./a>See3.a href="http://fy.chalmers.se/~appro/linux/DVD+RW/ ">http://fy.chalmers.se/~appro/linux/DVD+RW/   a>for more informatioL132" class="line" namon>L132">3132./a>about DVD writing.nL133" class="line" namon>L133">3133./a>
The original LXR software by/the .a href="http://sourceforge.net/projec4s/lxr">LXR community./a>, this experimental vers24lxr@linux.no./a>. ./div .div class="subfooter"> lxr.linux.no kindly hosted by .a href="http://www.redpill-linpro.no">Redpill Linpro AS./a>, provider/of Linux consulting and operat24