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

📄 creating-cds.html

📁 FreeBSD操作系统的详细使用手册
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta name="generator" content="HTML Tidy, see www.w3.org" /><title>Creating and Using Optical Media (CDs)</title><meta name="GENERATOR" content="Modular DocBook HTML Stylesheet Version 1.7" /><link rel="HOME" title="FreeBSD Handbook" href="index.html" /><link rel="UP" title="Storage" href="disks.html" /><link rel="PREVIOUS" title="USB Storage Devices" href="usb-disks.html" /><link rel="NEXT" title="Creating and Using Optical Media (DVDs)"href="creating-dvds.html" /><link rel="STYLESHEET" type="text/css" href="docbook.css" /></head><body class="SECT1" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#840084"alink="#0000FF"><div class="NAVHEADER"><table summary="Header navigation table" width="100%" border="0" cellpadding="0"cellspacing="0"><tr><th colspan="3" align="center">FreeBSD Handbook</th></tr><tr><td width="10%" align="left" valign="bottom"><a href="usb-disks.html"accesskey="P">Prev</a></td><td width="80%" align="center" valign="bottom">Chapter 16 Storage</td><td width="10%" align="right" valign="bottom"><a href="creating-dvds.html"accesskey="N">Next</a></td></tr></table><hr align="LEFT" width="100%" /></div><div class="SECT1"><h1 class="SECT1"><a id="CREATING-CDS" name="CREATING-CDS">16.6 Creating and UsingOptical Media (CDs)</a></h1><i class="AUTHORGROUP"><span class="CONTRIB">Contributed by</span> Mike Meyer.</i> <div class="SECT2"><h2 class="SECT2"><a id="AEN23898" name="AEN23898">16.6.1 Introduction</a></h2><p>CDs have a number of features that differentiate them from conventional disks.Initially, they were not writable by the user. They are designed so that they can be readcontinuously without delays to move the head between tracks. They are also much easier totransport between systems than similarly sized media were at the time.</p><p>CDs do have tracks, but this refers to a section of data to be read continuously andnot a physical property of the disk. To produce a CD on FreeBSD, you prepare the datafiles that are going to make up the tracks on the CD, then write the tracks to theCD.</p><p>The ISO 9660 file system was designed to deal with these differences. It unfortunatelycodifies file system limits that were common then. Fortunately, it provides an extensionmechanism that allows properly written CDs to exceed those limits while still workingwith systems that do not support those extensions.</p><p>The <a href="http://www.FreeBSD.org/cgi/url.cgi?ports/sysutils/cdrtools/pkg-descr"><ttclass="FILENAME">sysutils/cdrtools</tt></a> port includes <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>, a programthat you can use to produce a data file containing an ISO 9660 file system. It hasoptions that support various extensions, and is described below.</p><p>Which tool to use to burn the CD depends on whether your CD burner is ATAPI orsomething else. ATAPI CD burners use the <tt class="COMMAND"><ahref="creating-cds.html#BURNCD">burncd</a></tt> program that is part of the base system.SCSI and USB CD burners should use <tt class="COMMAND"><ahref="creating-cds.html#CDRECORD">cdrecord</a></tt> from the <ahref="http://www.FreeBSD.org/cgi/url.cgi?ports/sysutils/cdrtools/pkg-descr"><ttclass="FILENAME">sysutils/cdrtools</tt></a> port.</p><p><tt class="COMMAND">burncd</tt> has a limited number of supported drives. To find outif a drive is supported, see the <a href="http://www.freebsd.dk/ata/"target="_top">CD-R/RW supported drives</a> list.</p><div class="NOTE"><blockquote class="NOTE"><p><b>Note:</b> If you run FreeBSD&nbsp;5.X, FreeBSD&nbsp;4.8-RELEASE version or higher,it will be possible to use <tt class="COMMAND"><ahref="creating-cds.html#CDRECORD">cdrecord</a></tt> and other tools for SCSI drives on anATAPI hardware with the <a href="creating-cds.html#ATAPICAM">ATAPI/CAM module</a>.</p></blockquote></div><p>If you want a CD burning software with a graphical user interface, you should have alook to <b class="APPLICATION">X-CD-Roast</b> or <b class="APPLICATION">K3b</b>. Thesetools are available as packages or from the <ahref="http://www.FreeBSD.org/cgi/url.cgi?ports/sysutils/xcdroast/pkg-descr"><ttclass="FILENAME">sysutils/xcdroast</tt></a> and <ahref="http://www.FreeBSD.org/cgi/url.cgi?ports/sysutils/k3b/pkg-descr"><ttclass="FILENAME">sysutils/k3b</tt></a> ports. <b class="APPLICATION">X-CD-Roast</b> and<b class="APPLICATION">K3b</b> require the <a href="creating-cds.html#ATAPICAM">ATAPI/CAMmodule</a> with ATAPI hardware.</p></div><div class="SECT2"><h2 class="SECT2"><a id="MKISOFS" name="MKISOFS">16.6.2 mkisofs</a></h2><p>The <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> program,which is part of the <ahref="http://www.FreeBSD.org/cgi/url.cgi?ports/sysutils/cdrtools/pkg-descr"><ttclass="FILENAME">sysutils/cdrtools</tt></a> port, produces an ISO 9660 file system thatis an image of a directory tree in the <span class="TRADEMARK">UNIX</span>&reg; filesystem name space. The simplest usage is:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">mkisofs -o <varclass="REPLACEABLE">imagefile.iso</var> <varclass="REPLACEABLE">/path/to/tree</var></kbd></pre><p>This command will create an <var class="REPLACEABLE">imagefile.iso</var> containing anISO 9660 file system that is a copy of the tree at <varclass="REPLACEABLE">/path/to/tree</var>. In the process, it will map the file names tonames that fit the limitations of the standard ISO 9660 file system, and will excludefiles that have names uncharacteristic of ISO file systems.</p><p>A number of options are available to overcome those restrictions. In particular, <varclass="OPTION">-R</var> enables the Rock Ridge extensions common to <spanclass="TRADEMARK">UNIX</span> systems, <var class="OPTION">-J</var> enables Jolietextensions used by Microsoft systems, and <var class="OPTION">-hfs</var> can be used tocreate HFS file systems used by <span class="TRADEMARK">Mac&nbsp;OS</span>&reg;.</p><p>For CDs that are going to be used only on FreeBSD systems, <varclass="OPTION">-U</var> can be used to disable all filename restrictions. When used with<var class="OPTION">-R</var>, it produces a file system image that is identical to theFreeBSD tree you started from, though it may violate the ISO 9660 standard in a number ofways.</p><p>The last option of general use is <var class="OPTION">-b</var>. This is used tospecify the location of the boot image for use in producing an ``El Torito'' bootable CD.This option takes an argument which is the path to a boot image from the top of the treebeing written to the CD. So, given that <tt class="FILENAME">/tmp/myboot</tt> holds abootable FreeBSD system with the boot image in <ttclass="FILENAME">/tmp/myboot/boot/cdboot</tt>, you could produce the image of an ISO 9660file system in <tt class="FILENAME">/tmp/bootable.iso</tt> like so:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbdclass="USERINPUT">mkisofs -U -R -b boot/cdboot -o /tmp/bootable.iso /tmp/myboot</kbd></pre><p>Having done that, if you have <tt class="DEVICENAME">vn</tt> (FreeBSD&nbsp;4.X), or<tt class="DEVICENAME">md</tt> (FreeBSD&nbsp;5.X) configured in your kernel, you canmount the file system with:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbdclass="USERINPUT">vnconfig -e vn0c /tmp/bootable.iso</kbd><samp class="PROMPT">#</samp> <kbd class="USERINPUT">mount -t cd9660 /dev/vn0c /mnt</kbd></pre><p>for FreeBSD&nbsp;4.X, and for FreeBSD&nbsp;5.X:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbdclass="USERINPUT">mdconfig -a -t vnode -f /tmp/bootable.iso -u 0</kbd><samp class="PROMPT">#</samp> <kbd class="USERINPUT">mount -t cd9660 /dev/md0 /mnt</kbd></pre><p>At which point you can verify that <tt class="FILENAME">/mnt</tt> and <ttclass="FILENAME">/tmp/myboot</tt> are identical.</p><p>There are many other options you can use 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> tofine-tune its behavior. In particular: modifications to an ISO 9660 layout and thecreation of Joliet and HFS discs. See the <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> manualpage for details.</p></div><div class="SECT2"><h2 class="SECT2"><a id="BURNCD" name="BURNCD">16.6.3 burncd</a></h2><p>If you have an ATAPI CD burner, you can use the <tt class="COMMAND">burncd</tt>command to burn an ISO image onto a CD. <tt class="COMMAND">burncd</tt> is part of thebase system, installed as <tt class="FILENAME">/usr/sbin/burncd</tt>. Usage is verysimple, as it has few options:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">burncd -f <varclass="REPLACEABLE">cddevice</var> data <varclass="REPLACEABLE">imagefile.iso</var> fixate</kbd></pre><p>Will burn a copy of <var class="REPLACEABLE">imagefile.iso</var> on <varclass="REPLACEABLE">cddevice</var>. The default device is <ttclass="FILENAME">/dev/acd0</tt> (or <tt class="FILENAME">/dev/acd0c</tt> underFreeBSD&nbsp;4.X). See <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=burncd&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">burncd</span>(8)</span></a> for optionsto set the write speed, eject the CD after burning, and write audio data.</p></div><div class="SECT2"><h2 class="SECT2"><a id="CDRECORD" name="CDRECORD">16.6.4 cdrecord</a></h2><p>If you do not have an ATAPI CD burner, you will have to use <ttclass="COMMAND">cdrecord</tt> to burn your CDs. <tt class="COMMAND">cdrecord</tt> is notpart of the base system; you must install it from either the port at <ahref="http://www.FreeBSD.org/cgi/url.cgi?ports/sysutils/cdrtools/pkg-descr"><ttclass="FILENAME">sysutils/cdrtools</tt></a> or the appropriate package. Changes to thebase system can cause binary versions of this program to fail, possibly resulting in a``coaster''. You should therefore either upgrade the port when you upgrade your system,or if you are <a href="current-stable.html#STABLE">tracking -STABLE</a>, upgrade the portwhen a new version becomes available.</p><p>While <tt class="COMMAND">cdrecord</tt> has many options, basic usage is even simplerthan <tt class="COMMAND">burncd</tt>. Burning an ISO 9660 image is done with:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">cdrecord dev=<varclass="REPLACEABLE">device</var> <var class="REPLACEABLE">imagefile.iso</var></kbd></pre><p>The tricky part of using <tt class="COMMAND">cdrecord</tt> is finding the <varclass="OPTION">dev</var> to use. To find the proper setting, use the <varclass="OPTION">-scanbus</var> flag of <tt class="COMMAND">cdrecord</tt>, which mightproduce results like this:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">cdrecord -scanbus</kbd>Cdrecord 1.9 (i386-unknown-freebsd4.2) Copyright (C) 1995-2000 J&ouml;rg SchillingUsing libscg version 'schily-0.1'scsibus0:        0,0,0     0) 'SEAGATE ' 'ST39236LW       ' '0004' Disk        0,1,0     1) 'SEAGATE ' 'ST39173W        ' '5958' Disk        0,2,0     2) *        0,3,0     3) 'iomega  ' 'jaz 1GB         ' 'J.86' Removable Disk        0,4,0     4) 'NEC     ' 'CD-ROM DRIVE:466' '1.26' Removable CD-ROM        0,5,0     5) *        0,6,0     6) *        0,7,0     7) *scsibus1:        1,0,0   100) *        1,1,0   101) *        1,2,0   102) *        1,3,0   103) *        1,4,0   104) *        1,5,0   105) 'YAMAHA  ' 'CRW4260         ' '1.0q' Removable CD-ROM        1,6,0   106) 'ARTEC   ' 'AM12S           ' '1.06' Scanner        1,7,0   107) *</pre><p>This lists the appropriate <var class="OPTION">dev</var> value for the devices on thelist. Locate your CD burner, and use the three numbers separated by commas as the valuefor <var class="OPTION">dev</var>. In this case, the CRW device is 1,5,0, so theappropriate input would be <var class="OPTION">dev=1,5,0</var>. There are easier ways tospecify this value; see <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> fordetails. That is also the place to look for information on writing audio tracks,controlling the speed, and other things.</p></div><div class="SECT2"><h2 class="SECT2"><a id="DUPLICATING-AUDIOCDS" name="DUPLICATING-AUDIOCDS">16.6.5Duplicating Audio CDs</a></h2><p>You can duplicate an audio CD by extracting the audio data from the CD to a series offiles, and then writing these files to a blank CD. The process is slightly different forATAPI and SCSI drives.</p><div class="PROCEDURE"><p><b>SCSI Drives</b></p><ol type="1"><li><p>Use <tt class="COMMAND">cdda2wav</tt> to extract the audio.</p><pre class="SCREEN"><samp class="PROMPT">%</samp> <kbd class="USERINPUT">cdda2wav -v255 -D2,0 -B -Owav</kbd></pre></li><li><p>Use <tt class="COMMAND">cdrecord</tt> to write the <tt class="FILENAME">.wav</tt>files.</p><pre class="SCREEN"><samp class="PROMPT">%</samp> <kbd class="USERINPUT">cdrecord -v dev=<varclass="REPLACEABLE">2,0</var> -dao -useinfo  *.wav</kbd></pre>

⌨️ 快捷键说明

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