DisksSynopsisThis chapter covers how to use disks, whether physical,
memory, or networked, on FreeBSD.BIOS Drive NumberingBefore you install and configure FreeBSD on your system, there is an
important subject that you should be aware of if, especially if you have
multiple hard drives.In a PC running DOS or any of the BIOS-dependent operating systems
(WINxxx), the BIOS is able to abstract the normal disk drive order, and
the operating system goes along with the change. This allows the user
to boot from a disk drive other than the so-called primary
master. This is especially convenient for some users who have
found that the simplest and cheapest way to keep a system backup is to
buy an identical second hard drive, and perform routine copies of the
first drive to the second drive using Ghost or XCOPY. Then, if the
first drive fails, or is attacked by a virus, or is scribbled upon by an
operating system defect, he can easily recover by instructing the BIOS
to logically swap the drives. It's like switching the cables on the
drives, but without having to open the case.More expensive systems with SCSI controllers often include BIOS
extensions which allow the SCSI drives to be re-ordered in a similar
fashion for up to seven drives.A user who is accustomed to taking advantage of these features may
become surprised when the results with FreeBSD are not as expected.
FreeBSD does not use the BIOS, and does not know the logical BIOS
drive mapping. This can lead to very perplexing situations,
especially when drives are physically identical in geometry, and have
also been made as data clones of one another.When using FreeBSD, always restore the BIOS to natural drive
numbering before installing FreeBSD, and then leave it that way. If you
need to switch drives around, then do so, but do it the hard way, and
open the case and move the jumpers and cables.An illustration from the files of Bill and Fred's Exceptional
Adventures:Bill breaks-down an older Wintel box to make another FreeBSD box
for Fred. Bill installs a single SCSI drive as SCSI unit zero, and
installs FreeBSD on it.Fred begins using the system, but after several days notices that
the older SCSI drive is reporting numerous soft errors, and reports
this fact to Bill.After several more days, Bill decides it's time to address the
situation, so he grabs an identical SCSI drive from the disk drive
"archive" in the back room. An initial surface scan indicates that
this drive is functioning well, so Bill installs this drive as SCSI
unit four, and makes an image copy from drive zero to drive four. Now
that the new drive is installed and functioning nicely, Bill decides
that it's a good idea to start using it, so he uses features in the
SCSI BIOS to re-order the disk drives so that the system boots from
SCSI unit four. FreeBSD boots and runs just fine.Fred continues his work for several days, and soon Bill and Fred
decide that it's time for a new adventure -- time to upgrade to a
newer version of FreeBSD. Bill removes SCSI unit zero because it was
a bit flaky, and replaces it with another identical disk drive from
the "archive." Bill then installs the new version of FreeBSD onto the
new SCSI unit zero using Fred's magic internet FTP floppies. The
installation goes well.Fred uses the new version of FreeBSD for a few days, and certifies
that it is good enough for use in the engineering department...it's
time to copy all of his work from the old version. So Fred mounts
SCSI unit four (the latest copy of the older FreeBSD version). Fred
is dismayed to find that none of his precious work is present on SCSI
unit four.Where did the data go?When Bill made an image copy of the original SCSI unit zero onto
SCSI unit four, unit four became the "new clone," When Bill
re-ordered the SCSI BIOS so that he could boot from SCSI unit four, he
was only fooling himself. FreeBSD was still running on SCSI unit zero.
Making this kind of BIOS change will cause some or all of the Boot and
Loader code to be fetched from the selected BIOS drive, but when the
FreeBSD kernel drivers take-over, the BIOS drive numbering will be
ignored, and FreeBSD will transition back to normal drive numbering.
In the illustration at hand, the system continued to operate on the
original SCSI unit zero, and all of Fred's data was there, not on SCSI
unit four. The fact that the system appeared to be running on SCSI
unit four was simply an artifact of human expectations.We are delighted to mention that no data bytes were killed or
harmed in any way by our discovery of this phenomenon. The older SCSI
unit zero was retrieved from the bone pile, and all of Fred's work was
returned to him, (and now Bill knows that he can count as high as
zero).Although SCSI drives were used in this illustration, the concepts
apply equally to IDE drives.Disk NamingPhysical drives come in two main flavors,
IDE, or SCSI; but there
are also drives backed by RAID controllers, flash memory, and so
forth. Since these behave quite differently, they have their
own drivers and devices.
Physical Disk Naming ConventionsDrive typeDrive device nameIDE hard drivesad in 4.0-RELEASE,
wd before 4.0-RELEASE.IDE CDROM drivesacd from 3.1-RELEASE,
wcd before 4.0-RELEASE.SCSI hard drivesda from 3.0-RELEASE,
sd before 3.0-RELEASE.SCSI CDROM drivescdAssorted non-standard CDROM drivesmcd for Mitsumi CD-ROM,
scd for Sony CD-ROM,
matcd for Matsushita/Panasonic CD-ROM
Floppy drivesfdSCSI tape drivessa from 3.0-RELEASE,
st before 3.0-RELEASE.IDE tape drivesast from 4.0-RELEASE,
wst before 4.0-RELEASE.Flash drivesfla for DiskOnChip Flash device
from 3.3-RELEASE.RAID drivesmyxd for Mylex, and
amrd for AMI MegaRAID,
idad for Compaq Smart RAID.
from 4.0-RELEASE. id between
3.2-RELEASE and 4.0-RELEASE.
Slices and PartitionsPhysical disks usually contain
slices, unless they are
dangerously dedicated. Slice numbers follow
the device name, prefixed with an s:
da0s1.Slices, dangerously dedicated physical
drives, and other drives contain
partitions, which represented as
letters from a to h.
b is reserved for swap partitions, and
c is an unused partition the size of the
entire slice or drive. This is explained in .Mounting and Unmounting FilesystemsThe filesystem is best visualized as a tree,
rooted, as it were, at /.
/dev, /usr, and the
other directories in the root directory are branches, which may
have their own branches, such as
/usr/local, and so on.There are various reasons to house some of these
directories on separate filesystems. /var
contains log, spool, and various types of temporary files, and
as such, may get filled up. Filling up the root filesystem
isn't a good idea, so splitting /var from
/ is often a good idea.Another common reason to contain certain directory trees on
other filesystems is if they are to be housed on separate
physical disks, or are separate virtual disks, such as Network File System mounts, or CDROM
drives.The fstab FileDuring the boot process,
filesystems listed in /etc/fstab are
automatically mounted (unless they are listed with
).The /etc/fstab file contains a list
of lines of the following format:device/mount-pointfstypeoptionsdumpfreqpassnodevice is a device name (which should
exist), as explained in the Disk
naming conventions above.mount-point is a directory (which
should exist), on which to mount the filesystem.fstype is the filesystem type to pass
to &man.mount.8;. The default FreeBSD filesystem is
ufs.options is either
for read-write filesystems, or for
read-only filesystems, followed by any other options that may
be needed. A common option is for
filesystems not normally mounted during the boot sequence.
Other options in the &man.mount.8; manual page.dumpfreq is the number of days the
filesystem should be dumped, and passno is
the pass number during which the filesystem is mounted during
the boot sequence.The mount CommandThe &man.mount.8; command is what is ultimately used to
mount filesystems.In its most basic form, you use:&prompt.root; mount devicemountpointThere are plenty of options, as mentioned in the
&man.mount.8; manual page, but the most common are:mount optionsMount all filesystems in
/etc/fstab, as modified by
, if given.Do everything but actually mount the
filesystem.Force the mounting the filesystem.Mount the filesystem read-only.fstypeMount the given filesystem as the given filesystem
type, or mount only filesystems of the given type, if
given the option.ufs is the default filesystem
type.Update mount options on the filesystem.Be verbose.Mount the filesystem read-write.The takes a comma-separated list of
the options, including the following:nodevDo not interpret special devices on the
filesystem. Useful security option.noexecDo not allow execution of binaries on this
filesystem. Useful security option.nosuidDo not interpret setuid or setgid flags on the
filesystem. Useful security option.The umount CommandThe umount command takes, as a parameter, one of a
mountpoint, a device name, or the or
option.All forms take to force unmounting,
and for verbosity. and are used to
unmount all mounted filesystems, possibly modified by the
filesystem types listed after .
, however, doesn't attempt to unmount the
root filesystem.Adding DisksOriginally contributed by &a.obrien; 26 April
1998Lets say we want to add a new SCSI disk to a machine that currently
only has a single drive. First turn off the computer and install the
drive in the computer following the instructions of the computer,
controller, and drive manufacturer. Due the wide variations of procedures
to do this, the details are beyond the scope of this document.Login as user root. After you've installed the
drive, inspect /var/run/dmesg.boot to ensure the new
disk was found. Continuing with our example, the newly added drive will
be da1 and we want to mount it on
/1 (if you are adding an IDE drive, it will
be wd1 in pre-4.0 systems, or
ad1 in most 4.X systems).Because FreeBSD runs on IBM-PC compatible computers, it must take into
account the PC BIOS partitions. These are different from the traditional
BSD partitions. A PC disk has up to four BIOS partition entries. If the
disk is going to be truly dedicated to FreeBSD, you can use the
dedicated mode. Otherwise, FreeBSD will have to live
with in one of the PC BIOS partitions. FreeBSD calls the PC BIOS
partitions slices so as not to confuse them with
traditional BSD partitions. You may also use slices on a disk that is
dedicated to FreeBSD, but used in a computer that also has another
operating system installed. This is to not confuse the
fdisk utility of the other operating system.In the slice case the drive will be added as
/dev/da1s1e. This is read as: SCSI disk, unit number
1 (second SCSI disk), slice 1 (PC BIOS partition 1), and
e BSD partition. In the dedicated case, the drive
will be added simply as /dev/da1e.Using sysinstallYou may use /stand/sysinstall to partition and
label a new disk using its easy to use menus. Either login as user
root or use the su command. Run
/stand/sysinstall and enter the
Configure menu. With in the FreeBSD
Configuration Menu, scroll down and select the
Partition item. Next you should be presented with a
list of hard drives installed in your system. If you do not see
da1 listed, you need to recheck your physical
installation and dmesg output in the file
/var/run/dmesg.boot.Select da1 to enter the FDISK Partition
Editor. Choose A to use the entire disk
for FreeBSD. When asked if you want to remain cooperative with
any future possible operating systems, answer
YES. Write the changes to the disk using
W. Now exit the FDISK editor using
q. Next you will be asked about the Master Boot
Record. Since you are adding a disk to an already running system,
choose None.Next enter the Disk Label Editor. This is where
you will create the traditional BSD partitions. A disk can have up to
eight partitions, labeled a-h. A few of the partition labels have
special uses. The a partition is used for the root
partition (/). Thus only your system disk (e.g,
the disk you boot from) should have an a partition.
The b partition is used for swap partitions, and you
may have many disks with swap partitions. The c
partition addresses the entire disk in dedicated mode, or the entire
FreeBSD slice in slice mode. The other partitions are for general
use.Sysinstall's Label editor favors the e partition
for non-root, non-swap partitions. With in the Label editor, create a
single file system using C. When prompted if this
will be a FS (file system) or swap, choose FS and
give a mount point (e.g, /mnt). When adding a disk
in post-install mode, Sysinstall will not create entries in
/etc/fstab for you, so the mount point you specify
isn't important.You are now ready to write the new label to the disk and create a
file system on it. Do this by hitting W. Ignore any
errors from Sysinstall that it could not mount the new partition. Exit
the Label Editor and Sysinstall completely.The last step is to edit /etc/fstab to add an
entry for your new disk.Using Command Line UtilitiesUsing SlicesThis setup will allow your disk to work correctly with
other operating systems that might be installed on your
computer and will not confuse other operating systems' fdisk
utilities. It is recommended to use this method for new disk
installs. Only use dedicated mode if you
have a good reason to do so!&prompt.root; dd if=/dev/zero of=/dev/rda1 bs=1k count=1
&prompt.root; fdisk -BI da1 #Initialize your new disk
&prompt.root; disklabel -B -w -r da1s1 auto #Label it.
&prompt.root; disklabel -e da1s1 # Now edit the disklabel you just created and add any partitions.
&prompt.root; mkdir -p /1
&prompt.root; newfs /dev/da1s1e # Repeat this for every partition you created.
&prompt.root; mount -t ufs /dev/da1s1e /1 # Mount the partition(s)
&prompt.root; vi /etc/fstab # When satisfied, add the appropriate entry/entries to your /etc/fstab.If you have an IDE disk, substitute ad
for da. On pre-4.x systems use
wd.DedicatedIf you will not be sharing the new drive with another operating
system, you may use the dedicated mode. Remember
this mode can confuse Microsoft operating systems; however, no damage
will be done by them. IBM's OS/2 however, will
appropriate any partition it finds which it doesn't
understand.&prompt.root; dd if=/dev/zero of=/dev/rda1 bs=1k count=1
&prompt.root; disklabel -Brw da1 auto
&prompt.root; disklabel -e da1 # create the `e' partition
&prompt.root; newfs -d0 /dev/rda1e
&prompt.root; mkdir -p /1
&prompt.root; vi /etc/fstab # add an entry for /dev/da1e
&prompt.root; mount /1An alternate method is:&prompt.root; dd if=/dev/zero of=/dev/rda1 count=2
&prompt.root; disklabel /dev/rda1 | disklabel -BrR da1 /dev/stdin
&prompt.root; newfs /dev/rda1e
&prompt.root; mkdir -p /1
&prompt.root; vi /etc/fstab # add an entry for /dev/da1e
&prompt.root; mount /1Virtual Disks: Network, Memory, and File-Based FilesystemsAside from the disks you physically insert into your computer:
floppies, CDs, hard drives, and so forth; other forms of disks
are understood by FreeBSD - the virtual
disks.These include network filesystems such as the Network Filesystem and Coda, memory-based
filesystems such as md and
file-backed filesystems created by vnconfig.vnconfig: file-backed filesystem&man.vnconfig.8; configures and enables vnode pseudo disk
devices. A vnode is a representation
of a file, and is the focus of file activity. This means that
&man.vnconfig.8; uses files to create and operate a
filesystem. One possible use is the mounting of floppy or CD
images kept in files.To mount an existing filesystem image:Using vnconfig to mount an existing filesystem
image&prompt.root; vnconfig vn0diskimage
&prompt.root; mount /dev/vn0c /mntTo create a new filesystem image with vnconfig:Creating a New File-Backed Disk with vnconfig&prompt.root; dd if=/dev/zero of=newimage bs=1k count=5k
5120+0 records in
5120+0 records out
&prompt.root; vnconfig -s labels -c vn0newimage
&prompt.root; disklabel -r -w vn0 auto
&prompt.root; newfs vn0c
Warning: 2048 sector(s) in last cylinder unallocated
/dev/rvn0c: 10240 sectors in 3 cylinders of 1 tracks, 4096 sectors
5.0MB in 1 cyl groups (16 c/g, 32.00MB/g, 1280 i/g)
super-block backups (for fsck -b #) at:
32
&prompt.root; mount /dev/vn0c /mnt
&prompt.root; df /mnt
Filesystem 1K-blocks Used Avail Capacity Mounted on
/dev/vn0c 4927 1 4532 0% /mntmd: Memory Filesystemmd is a simple, efficient means to do memory
filesystems.Simply take a filesystem you've prepared with, for
example, &man.vnconfig.8;, and:md memory disk&prompt.root; dd if=newimage of=/dev/md0
5120+0 records in
5120+0 records out
&prompt.root; mount /dev/md0c/mnt
&prompt.root; df /mnt
Filesystem 1K-blocks Used Avail Capacity Mounted on
/dev/md0c 4927 1 4532 0% /mntDisk QuotasQuotas are an optional feature of the operating system that
allow you to limit the amount of disk space and/or the number of
files a user, or members of a group, may allocate on a per-file
system basis. This is used most often on timesharing systems where
it is desirable to limit the amount of resources any one user or
group of users may allocate. This will prevent one user from
consuming all of the available disk space.Configuring Your System to Enable Disk QuotasBefore attempting to use disk quotas it is necessary to make
sure that quotas are configured in your kernel. This is done by
adding the following line to your kernel configuration
file:options QUOTAThe stock GENERIC kernel does not have
this enabled by default, so you will have to configure, build and
install a custom kernel in order to use disk quotas. Please refer
to the Configuring the FreeBSD
Kernel section for more information on kernel
configuration.Next you will need to enable disk quotas in
/etc/rc.conf. This is done by adding the
line:enable_quotas=YESFor finer control over your quota startup, there is an
additional configuration variable available. Normally on bootup,
the quota integrity of each file system is checked by the
quotacheck program. The
quotacheck facility insures that the data in
the quota database properly reflects the data on the file system.
This is a very time consuming process that will significantly
affect the time your system takes to boot. If you would like to
skip this step, a variable is made available for the
purpose:check_quotas=NOIf you are running FreeBSD prior to 3.2-RELEASE, the
configuration is simpler, and consists of only one variable. Set
the following in your /etc/rc.conf:check_quotas=YESFinally you will need to edit /etc/fstab
to enable disk quotas on a per-file system basis. This is where
you can either enable user or group quotas or both for all of your
file systems.To enable per-user quotas on a file system, add the
userquota option to the options field in the
/etc/fstab entry for the file system you want
to to enable quotas on. For example:/dev/da1s2g /home ufs rw,userquota 1 2Similarly, to enable group quotas, use the
groupquota option instead of the
userquota keyword. To enable both user and
group quotas, change the entry as follows:/dev/da1s2g /home ufs rw,userquota,groupquota 1 2By default the quota files are stored in the root directory of
the file system with the names quota.user and
quota.group for user and group quotas
respectively. See man fstab for more
information. Even though that man page says that you can specify
an alternate location for the quota files, this is not recommended
because the various quota utilities do not seem to handle this
properly.At this point you should reboot your system with your new
kernel. /etc/rc will automatically run the
appropriate commands to create the initial quota files for all of
the quotas you enabled in /etc/fstab, so
there is no need to manually create any zero length quota
files.In the normal course of operations you should not be required
to run the quotacheck,
quotaon, or quotaoff
commands manually. However, you may want to read their man pages
just to be familiar with their operation.Setting Quota LimitsOnce you have configured your system to enable quotas, verify
that they really are enabled. An easy way to do this is to
run:&prompt.root; quota -vYou should see a one line summary of disk usage and current
quota limits for each file system that quotas are enabled
on.You are now ready to start assigning quota limits with the
edquota command.You have several options on how to enforce limits on the
amount of disk space a user or group may allocate, and how many
files they may create. You may limit allocations based on disk
space (block quotas) or number of files (inode quotas) or a
combination of both. Each of these limits are further broken down
into two categories; hard and soft limits.A hard limit may not be exceeded. Once a user reaches his
hard limit he may not make any further allocations on the file
system in question. For example, if the user has a hard limit of
500 blocks on a file system and is currently using 490 blocks, the
user can only allocate an additional 10 blocks. Attempting to
allocate an additional 11 blocks will fail.Soft limits, on the other hand, can be exceeded for a limited
amount of time. This period of time is known as the grace period,
which is one week by default. If a user stays over his or her
soft limit longer than the grace period, the soft limit will
turn into a hard limit and no further allocations will be allowed.
When the user drops back below the soft limit, the grace period
will be reset.The following is an example of what you might see when you run
the edquota command. When the
edquota command is invoked, you are placed into
the editor specified by the EDITOR environment
variable, or in the vi editor if the
EDITOR variable is not set, to allow you to edit
the quota limits.&prompt.root; edquota -u testQuotas for user test:
/usr: blocks in use: 65, limits (soft = 50, hard = 75)
inodes in use: 7, limits (soft = 50, hard = 60)
/usr/var: blocks in use: 0, limits (soft = 50, hard = 75)
inodes in use: 0, limits (soft = 50, hard = 60)You will normally see two lines for each file system that has
quotas enabled. One line for the block limits, and one line for
inode limits. Simply change the value you want updated to modify
the quota limit. For example, to raise this users block limit
from a soft limit of 50 and a hard limit of 75 to a soft limit of
500 and a hard limit of 600, change:/usr: blocks in use: 65, limits (soft = 50, hard = 75)to: /usr: blocks in use: 65, limits (soft = 500, hard = 600)The new quota limits will be in place when you exit the
editor.Sometimes it is desirable to set quota limits on a range of
uids. This can be done by use of the option
on the edquota command. First, assign the
desired quota limit to a user, and then run
edquota -p protouser startuid-enduid. For
example, if user test has the desired quota
limits, the following command can be used to duplicate those quota
limits for uids 10,000 through 19,999:&prompt.root; edquota -p test 10000-19999See man edquota for more detailed
information.Checking Quota Limits and Disk UsageYou can use either the quota or the
repquota commands to check quota limits and
disk usage. The quota command can be used to
check individual user and group quotas and disk usage. Only the
super-user may examine quotas and usage for other users, or for
groups that they are not a member of. The
repquota command can be used to get a summary
of all quotas and disk usage for file systems with quotas
enabled.The following is some sample output from the
quota -v command for a user that has quota
limits on two file systems.Disk quotas for user test (uid 1002):
Filesystem blocks quota limit grace files quota limit grace
/usr 65* 50 75 5days 7 50 60
/usr/var 0 50 75 0 50 60On the /usr file system in the above
example this user is currently 15 blocks over the soft limit of
50 blocks and has 5 days of the grace period left. Note the
asterisk * which indicates that the user is
currently over his quota limit.Normally file systems that the user is not using any disk
space on will not show up in the output from the
quota command, even if he has a quota limit
assigned for that file system. The option
will display those file systems, such as the
/usr/var file system in the above
example.Quotas over NFSQuotas are enforced by the quota subsystem on the NFS server.
The &man.rpc.rquotad.8; daemon makes quota information available
to the &man.quota.1; command on NFS clients, allowing users on
those machines to see their quota statistics.Enable rpc.rquotad in
/etc/inetd.conf like so:rquotad/1 dgram rpc/udp wait root /usr/libexec/rpc.rquotad rpc.rquotadNow restart inetd:&prompt.root; kill -HUP `cat /var/run/inetd.pid`Creating CDsContributed by Mike Meyer
mwm@mired.org, April 2001.IntroductionCDs have a number of features that differentiate them from
conventional disks. Initially, they weren't writable by the
user. They are designed so that they can be read continuously without
delays to move the head between tracks. They are also much easier
to transport between systems than similarly sized media were at the
time.CDs do have tracks, but this refers to a section of data to
be read continuously and not a physical property of the disk. To
produce a CD on FreeBSD, you prepare the data files that are going
to make up the tracks on the CD, then write the tracks to the
CD.The ISO 9660 file system was designed to deal with these
differences. It unfortunately codifies file system limits that were
common then. Fortunately, it provides an extension mechanism that
allows properly written CDs to exceed those limits while still
working with systems that do not support those extensions.The mkisofs
program is used to produce a data file containing an ISO 9660 file
system. It has options that support various extensions, and is
described below. You can install it with the
/usr/ports/sysutils/mkisofs port.Which tool to use to burn the CD depends on whether your CD burner
is ATAPI or something else. ATAPI CD burners use the burncd program that is part of
the base system. SCSI and USB CD burners should use the
cdrecord from
the /usr/ports/sysutils/cdrecord port.mkisofsmkisofs produces an ISO 9660 file system
that is an image of a directory tree in the Unix file system name
space. The simplest usage is:&prompt.root; mkisofs imagefile.iso/path/to/treeThis command will create an imagefile
containing an ISO 9660 file system that is a copy of the tree at
/path/to/tree. In the process, it will
map the file names to names that fit the limitations of the
standard ISO 9660 file system, and will exclude files that have
names uncharacteristic of ISO file systems. Read &man.mkisofs.8;
for details of this process, and options that can be used to
control it.A number of options are available to overcome those
restrictions. In particular, enables the
Rock Ridge extensions common to Unix systems,
enables Joliet extensions used by Microsoft systems, and
can be used to create HFS file systems used
by Macs. Read &man.mkisofs.8; for more information on the last
two.For CDs that are going to be used only on FreeBSD systems,
can be used to disable all filename
restrictions. When used with , it produces a
file system image that is identical to the FreeBSD tree you started
from, though it may violate the ISO 9660 standard in a number of
ways.The last option of general use is . This is
used to specify 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
tree being written to the CD. So, given that
/tmp/myboot holds a bootable FreeBSD system
with the boot image in
/tmp/myboot/boot/cdboot, you could produce the
image of an ISO 9660 file system in
/tmp/bootable.iso like so:&prompt.root; mkisofs boot/cdboot/tmp/bootable.iso/tmp/mybootHaving done that, if you have vn configured in your kernel, you
can mount the file system with:&prompt.root; vnconfig vn0c/tmp/bootable.iso
&prompt.root; mount cd9660 /dev/vn0c/mntAt which point you can verify that /mnt
and /tmp/myboot are identical.There are many other options you can use with
mkisofs to fine-tune its behavior. See
&man.mkisofs.8; for details.burncdIf you have an ATAPI CD burner, you can use the
burncd command to burn an ISO image onto a
CD. burncd is part of the base system, installed
as /usr/sbin/burncd. Usage is very simple, as
it has few options:&prompt.root; burncd cddevice data imagefile.iso fixateWill burn a copy of imagefile.iso on
cddevice. The default device is
/dev/acd0. See &man.burncd.8; for options to
set the write speed, eject the CD after burning, and write audio
data.cdrecordIf you do not have an ATAPI CD burner, you will have to use
cdrecord to burn your
CDs. cdrecord is not part of the base system;
you must install it from either the port at
/usr/ports/sysutils/cdrecord or the appropriate
package. Changes to the base 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 tracking -stable, upgrade the port when a
new version becomes available.While cdrecord has many options, basic usage
is even simpler than burncd. Burning an ISO 9660
image is done with:&prompt.root; cdrecord deviceimagefile.isoThe tricky part of using cdrecord is finding
the to use. To find the proper setting, use
the flag of cdrecord,
which might produce results like this:&prompt.root; cdrecord
Cdrecord 1.9 (i386-unknown-freebsd4.2) Copyright (C) 1995-2000 Jörg Schilling
Using 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) *
This lists the appropriate value for the
devices on the list. Locate your CD burner, and use the three
numbers separated by commas as the value for
. In this case, the CRW device is 1,5,0, so the
appriate input would be
=1,5,0. There are easier
ways to specify this value; see &man.cdrecord.1; for
details. That is also the place to look for information on writing
audio tracks, controlling the speed, and other things.