⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 creating-cds.html

📁 FreeBSD操作系统的详细使用手册
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<p>Make sure that <var class="REPLACEABLE">2,0</var> is set appropriately, as describedin <a href="creating-cds.html#CDRECORD">Section 16.6.4</a>.</p></li></ol></div><div class="PROCEDURE"><p><b>ATAPI Drives</b></p><ol type="1"><li><p>The ATAPI CD driver makes each track available as <tt class="FILENAME">/dev/acd<varclass="REPLACEABLE">d</var>t<var class="REPLACEABLE">nn</var></tt>, where <varclass="REPLACEABLE">d</var> is the drive number, and <var class="REPLACEABLE">nn</var> isthe track number written with two decimal digits, prefixed with zero as needed. So thefirst track on the first disk is <tt class="FILENAME">/dev/acd0t01</tt>, the second is<tt class="FILENAME">/dev/acd0t02</tt>, the third is <ttclass="FILENAME">/dev/acd0t03</tt>, and so on.</p><p>Make sure the appropriate files exist in <tt class="FILENAME">/dev</tt>.</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">cd /dev</kbd><samp class="PROMPT">#</samp> <kbd class="USERINPUT">sh MAKEDEV acd0t99</kbd></pre><div class="NOTE"><blockquote class="NOTE"><p><b>Note:</b> In FreeBSD 5.0, <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=devfs&sektion=5&manpath=FreeBSD+6-current"><span class="CITEREFENTRY"><span class="REFENTRYTITLE">devfs</span>(5)</span></a> willautomatically create and manage entries in <tt class="FILENAME">/dev</tt> for you, so itis not necessary to use <tt class="COMMAND">MAKEDEV</tt>.</p></blockquote></div></li><li><p>Extract each track using <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=dd&sektion=1"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">dd</span>(1)</span></a>. You must alsouse a specific block size when extracting the files.</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbdclass="USERINPUT">dd if=/dev/acd0t01 of=track1.cdr bs=2352</kbd><samp class="PROMPT">#</samp> <kbdclass="USERINPUT">dd if=/dev/acd0t02 of=track2.cdr bs=2352</kbd>...</pre></li><li><p>Burn the extracted files to disk using <tt class="COMMAND">burncd</tt>. You mustspecify that these are audio files, and that <tt class="COMMAND">burncd</tt> shouldfixate the disk when finished.</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">burncd -f <varclass="REPLACEABLE">/dev/acd0</var> audio track1.cdr track2.cdr <varclass="REPLACEABLE">...</var> fixate</kbd></pre></li></ol></div></div><div class="SECT2"><h2 class="SECT2"><a id="IMAGING-CD" name="IMAGING-CD">16.6.6 Duplicating DataCDs</a></h2><p>You can copy a data CD to a image file that is functionally equivalent to the imagefile created with <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=mkisofs&sektion=8&manpath=FreeBSD+Ports"><span class="CITEREFENTRY"><span class="REFENTRYTITLE">mkisofs</span>(8)</span></a>, and youcan use it to duplicate any data CD. The example given here assumes that your CDROMdevice is <tt class="DEVICENAME">acd0</tt>. Substitute your correct CDROM device. UnderFreeBSD&nbsp;4.X, a <var class="LITERAL">c</var> must be appended to the end of thedevice name to indicate the entire partition or, in the case of CDROMs, the entiredisc.</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbdclass="USERINPUT">dd if=/dev/acd0 of=file.iso bs=2048</kbd></pre><p>Now that you have an image, you can burn it to CD as described above.</p></div><div class="SECT2"><h2 class="SECT2"><a id="MOUNTING-CD" name="MOUNTING-CD">16.6.7 Using Data CDs</a></h2><p>Now that you have created a standard data CDROM, you probably want to mount it andread the data on it. By default, <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=mount&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">mount</span>(8)</span></a> assumes thata file system is of type <var class="LITERAL">ufs</var>. If you try something like:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">mount /dev/cd0 /mnt</kbd></pre><p>you will get a complaint about ``<tt class="ERRORNAME">Incorrect super block</tt>'',and no mount. The CDROM is not a <var class="LITERAL">UFS</var> file system, so attemptsto mount it as such will fail. You just need to tell <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=mount&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">mount</span>(8)</span></a> that the filesystem is of type <var class="LITERAL">ISO9660</var>, and everything will work. You dothis by specifying the <var class="OPTION">-t cd9660</var> option <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=mount&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">mount</span>(8)</span></a>. For example,if you want to mount the CDROM device, <tt class="FILENAME">/dev/cd0</tt>, under <ttclass="FILENAME">/mnt</tt>, you would execute:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">mount -t cd9660 /dev/cd0 /mnt</kbd></pre><p>Note that your device name (<tt class="FILENAME">/dev/cd0</tt> in this example) couldbe different, depending on the interface your CDROM uses. Also, the <varclass="OPTION">-t cd9660</var> option just executes <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=mount_cd9660&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">mount_cd9660</span>(8)</span></a>. Theabove example could be shortened to:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">mount_cd9660 /dev/cd0 /mnt</kbd></pre><p>You can generally use data CDROMs from any vendor in this way. Disks with certain ISO9660 extensions might behave oddly, however. For example, Joliet disks store allfilenames in two-byte Unicode characters. The FreeBSD kernel does not speak Unicode(yet!), so non-English characters show up as question marks. (If you are running FreeBSD4.3 or later, the CD9660 driver includes hooks to load an appropriate Unicode conversiontable on the fly. Modules for some of the common encodings are available via the <ahref="http://www.FreeBSD.org/cgi/url.cgi?ports/sysutils/cd9660_unicode/pkg-descr"><ttclass="FILENAME">sysutils/cd9660_unicode</tt></a> port.)</p><p>Occasionally, you might get ``<tt class="ERRORNAME">Device not configured</tt>'' whentrying to mount a CDROM. This usually means that the CDROM drive thinks that there is nodisk in the tray, or that the drive is not visible on the bus. It can take a couple ofseconds for a CDROM drive to realize that it has been fed, so be patient.</p><p>Sometimes, a SCSI CDROM may be missed because it did not have enough time to answerthe bus reset. If you have a SCSI CDROM please add the following option to your kernelconfiguration and <a href="kernelconfig-building.html">rebuild your kernel</a>.</p><pre class="PROGRAMLISTING">options SCSI_DELAY=15000</pre><p>This tells your SCSI bus to pause 15 seconds during boot, to give your CDROM driveevery possible chance to answer the bus reset.</p></div><div class="SECT2"><h2 class="SECT2"><a id="RAWDATA-CD" name="RAWDATA-CD">16.6.8 Burning Raw DataCDs</a></h2><p>You can choose to burn a file directly to CD, without creating an ISO 9660 filesystem. Some people do this for backup purposes. This runs more quickly than burning astandard CD:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbdclass="USERINPUT">burncd -f /dev/acd1 -s 12 data archive.tar.gz fixate</kbd></pre><p>In order to retrieve the data burned to such a CD, you must read data from the rawdevice node:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">tar xzvf /dev/acd1</kbd></pre><p>You cannot mount this disk as you would a normal CDROM. Such a CDROM cannot be readunder any operating system except FreeBSD. If you want to be able to mount the CD, orshare data with another operating system, you must use <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=mkisofs&sektion=8&manpath=FreeBSD+Ports"><span class="CITEREFENTRY"><span class="REFENTRYTITLE">mkisofs</span>(8)</span></a> asdescribed above.</p></div><div class="SECT2"><h2 class="SECT2"><a id="ATAPICAM" name="ATAPICAM">16.6.9 Using the ATAPI/CAMDriver</a></h2><i class="AUTHORGROUP"><span class="CONTRIB">Contributed by</span> Marc Fonvieille.</i> <p>This driver allows ATAPI devices (CD-ROM, CD-RW, DVD drives etc...) to be accessedthrough the SCSI subsystem, and so allows the use of applications like <ahref="http://www.FreeBSD.org/cgi/url.cgi?ports/sysutils/cdrdao/pkg-descr"><ttclass="FILENAME">sysutils/cdrdao</tt></a> or <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=cdrecord&sektion=1&manpath=FreeBSD+Ports"><span class="CITEREFENTRY"><span class="REFENTRYTITLE">cdrecord</span>(1)</span></a>.</p><p>To use this driver, you will need to add the following lines to your kernelconfiguration file:</p><pre class="PROGRAMLISTING">device atapicamdevice scbusdevice cddevice pass</pre><p>You also need the following line in your kernel configuration file:</p><pre class="PROGRAMLISTING">device ata</pre><p>which should already be present.</p><p>Then rebuild, install your new kernel, and reboot your machine. During the bootprocess, your burner should show up, like so:</p><pre class="SCREEN">acd0: CD-RW &lt;MATSHITA CD-RW/DVD-ROM UJDA740&gt; at ata1-master PIO4cd0 at ata1 bus 0 target 0 lun 0cd0: &lt;MATSHITA CDRW/DVD UJDA740 1.00&gt; Removable CD-ROM SCSI-0 devicecd0: 16.000MB/s transferscd0: Attempt to query device size failed: NOT READY, Medium not present - tray closed</pre><p>The drive could now be accessed via the <tt class="FILENAME">/dev/cd0</tt> devicename, for example to mount a CD-ROM on <tt class="FILENAME">/mnt</tt>, just type thefollowing:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">mount -t cd9660 <varclass="REPLACEABLE">/dev/cd0</var> /mnt</kbd></pre><p>As <tt class="USERNAME">root</tt>, you can run the following command to get the SCSIaddress of the burner:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">camcontrol devlist</kbd>&lt;MATSHITA CDRW/DVD UJDA740 1.00&gt;   at scbus1 target 0 lun 0 (pass0,cd0)</pre><p>So <var class="LITERAL">1,0,0</var> will be the SCSI address to use with <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=cdrecord&sektion=1&manpath=FreeBSD+Ports"><span class="CITEREFENTRY"><span class="REFENTRYTITLE">cdrecord</span>(1)</span></a> and otherSCSI application.</p><p>For more information about ATAPI/CAM and SCSI system, refer to the <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=atapicam&sektion=4"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">atapicam</span>(4)</span></a> and <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=cam&sektion=4"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">cam</span>(4)</span></a> manualpages.</p></div></div><div class="NAVFOOTER"><hr align="LEFT" width="100%" /><table summary="Footer navigation table" width="100%" border="0" cellpadding="0"cellspacing="0"><tr><td width="33%" align="left" valign="top"><a href="usb-disks.html"accesskey="P">Prev</a></td><td width="34%" align="center" valign="top"><a href="index.html"accesskey="H">Home</a></td><td width="33%" align="right" valign="top"><a href="creating-dvds.html"accesskey="N">Next</a></td></tr><tr><td width="33%" align="left" valign="top">USB Storage Devices</td><td width="34%" align="center" valign="top"><a href="disks.html"accesskey="U">Up</a></td><td width="33%" align="right" valign="top">Creating and Using Optical Media (DVDs)</td></tr></table></div><p align="center"><small>This, and other documents, can be downloaded from <ahref="ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/">ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/</a>.</small></p><p align="center"><small>For questions about FreeBSD, read the <ahref="http://www.FreeBSD.org/docs.html">documentation</a> before contacting &#60;<ahref="mailto:questions@FreeBSD.org">questions@FreeBSD.org</a>&#62;.<br />For questions about this documentation, e-mail &#60;<ahref="mailto:doc@FreeBSD.org">doc@FreeBSD.org</a>&#62;.</small></p></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -