--- disks.mm	2002/01/21 01:42:14	4.1
+++ disks.mm	2003/06/24 04:48:48
@@ -1,36 +1,54 @@
 .\" This file is in -*- nroff-fill -*- mode
-.\" STATUS: draft 4th edition
-.\" $Id: disks.mm,v 4.1 2002/01/21 01:42:14 grog Exp $
+.\" STATUS: 4th edition
+.\" $Id: disks.mm,v 4.17 2003/04/02 06:44:17 grog Exp grog $
 .\"
+.\" XXX Add section on snapshots
 .Chapter \*[nchdisks] "Disks"
 One of the most important parts of running any computer system is handling data
-on disk.  We have already looked at UNIX file handling in \*[chfilesys].  In
-this chapter, we'll look at two ways to add another disk to your system.
+on disk.  We have already looked at UNIX file handling in Chapter
+.Sref "\*[nchfilesys]" .
+In this chapter, we'll look at two ways to add another disk to your system, and
+what you should put on them.  In addition, we'll discuss disk error recovery on
+page
+.Sref \*[disk-error-recovery] .
 .H2 "Adding a hard disk"
 .X "adding hard disk"
 .X "disk, adding"
 .Pn second-disk
 When you installed FreeBSD, you created file systems on at least one hard disk.
 At a later point, you may want to install additional drives.  There are two ways
-to do this: with \fIsysinstall\fP\| and with the traditional UNIX command-line
-utilities.
-.P
-There was a time when it was dangerous to use \fIsysinstall\fP\| after the
-system had been installed: there was a significant chance of shooting yourself
-in the foot.  There's always a chance of doing something wrong when initializing
-disks, but nowadays \fIsysinstall\fP\| has got a lot better, and normally it's
-the tool of choice.  It's good to know the alternatives, though.  In this
-section we'll look at \fIsysinstall\fP, and on page \*[the-hard-way] we'll see
-how to do it manually if \fIsysinstall\fP\| won't cooperate.
+to do this: with
+.Command sysinstall
+and with the traditional UNIX command-line utilities.
+.P
+There was a time when it was dangerous to use
+.Command sysinstall
+after the system had been installed: there was a significant chance of shooting
+yourself in the foot.  There's always a chance of doing something wrong when
+initializing disks, but
+.Command sysinstall
+has become a lot better, and now it's the tool of choice.  It's good to know the
+alternatives, though.  In this section we'll look at
+.Command sysinstall ,
+and on page
+.Sref \*[the-hard-way] \&
+we'll see how to do it manually if
+.Command sysinstall
+won't cooperate.
 .P
 We've been through all the details of disk layout and slices and partitions in
-\*[chconcepts], so I won't repeat them here.  Basically, to add a new disk to
-the system, you need to:
+Chapter
+.Sref "\*[nchconcepts]" ,
+so I won't repeat them here.  Basically, to add a new disk to the system, you
+need to:
 .Ls B
 .LI
-Possibly, format the disk.  More and more, modern disks come pre-formatted, and
-you will only need to format them if there are defects on the disk, or if it's
-ancient.
+Install the disk physically.  This usually involves power cycling the machine.
+.LI
+Barely possibly, format the disk.  Without exception, modern disks come
+pre-formatted, and you only need to format a disk if it has defects or if it's
+ancient.  In many cases the so-called ``format'' program doesn't really format
+at all.
 .LI
 If you want to share with other operating systems, create a PC style
 partition table on the disk.  We looked at the concepts on page
@@ -44,157 +62,213 @@
 .LI
 Create the file systems.
 .Le
-These are exactly the same operations as we performed in \*[chinstall]. 
+These are the same operations that we performed in Chapter
+.Sref "\*[nchinstall]" .
 .H3 "Disk hardware installation"
-.X "installing disk hardware"
+.X "installing, disk hardware"
 .X "disks, installing hardware"
 Before you can do anything with the disk, you have to install it in the system.
 To do this, you must normally shut down the system and turn the power off,
 though high-end SCSI enclosures allow \fIhot-swapping\fP, changing disks in a
 running system.  If the disk is IDE, and you already have an IDE disk on the
-controller, you need to set the second disk as ``slave'' drive.  \fIAnd\fP\| you
+controller, you need to set the second disk as ``slave'' drive.  \fIAnd\fP\/ you
 may have to set the first disk as ``master'' drive: if you only have one drive,
 you don't set any jumpers, but if you have two drives, some disks require you to
 set jumpers on both disks.  If you don't do this, the system will appear to hang
 during the power-on self test, and will finally report some kind of disk error.
 .P
-Adding a SCSI disk is more complicated.  Up to 16 SCSI devices can be connected
-to most systems, depending on the interface, but this number includes the host
-adapter.  Many systems restrict the number to 7 for compatibility with older
-SCSI interfaces.  Typically, your first SCSI disk will have the SCSI ID 0, and
-the host adapter will have the SCSI ID 7.  Traditionally, the IDs 4, 5, and 6
-are reserved for tape and CD-ROM drives, and the IDs 0 to 3 are reserved for
-disks, though FreeBSD doesn't impose any restrictions on what goes where.
+Adding a SCSI disk is more complicated.  You can connect up to 15 SCSI devices
+to a host adapter, depending on the interface.  Many systems restrict the number
+to 7 for compatibility with older SCSI interfaces.  Typically, your first SCSI
+disk will have the SCSI ID 0, and the host adapter will have the SCSI ID 7.
+Traditionally, the IDs 4, 5, and 6 are reserved for tape and CD-ROM drives, and
+the IDs 0 to 3 are reserved for disks, though FreeBSD doesn't impose any
+restrictions on what goes where.
 .P
-.X "dmesg, command"
-.X "command, dmesg"
 Whatever kind of disk you're adding, look at the boot messages, which you can
-retrieve with the \fIdmesg\fP\| command.  For example, if you're planning to add
-a SCSI device, you might see:
-.Dx
-ahc0: <Adaptec 2940 SCSI adapter> rev 0x03 int a irq 11 on pci0.9.0
-ahc0: aic7870 Single Channel A, SCSI Id=7, 16/255 SCBs
-\&\fIfurther down...\fP\|
+retrieve with the
+.Command dmesg
+command.  For example, if you're planning to add a SCSI device, you might see:
+.Dx
+sym0: <875> port 0xc400-0xc4ff mem 0xec002000-0xec002fff,0xec003000-0xec0030ff irq 10
+ at device 9.0 on pci0
+sym0: Symbios NVRAM, ID 7, Fast-20, SE, NO parity
+sym0: open drain IRQ line driver, using on-chip SRAM
+sym0: using LOAD/STORE-based firmware.
+sym0: SCAN FOR LUNS disabled for targets 0.
+sym1: <875> port 0xc800-0xc8ff mem 0xec001000-0xec001fff,0xec000000-0xec0000ff irq 9
+at device 13.0 on pci0
+sym1: No NVRAM, ID 7, Fast-20, SE, parity checking
+\&\fIfurther down...\fP\/
 Waiting 3 seconds for SCSI devices to settle
-sa0 at ahc0 bus 0 target 3 lun 0
+sa0 at sym0 bus 0 target 3 lun 0
 sa0: <EXABYTE EXB-8505SMBANSH2 0793> Removable Sequential Access SCSI-2 device 
 sa0: 5.000MB/s transfers (5.000MHz, offset 11)
-sa1 at ahc0 bus 0 target 4 lun 0
+sa1 at sym0 bus 0 target 4 lun 0
 sa1: <ARCHIVE Python 28849-XXX 4.CM> Removable Sequential Access SCSI-2 device 
 sa1: 5.000MB/s transfers (5.000MHz, offset 15)
-sa2 at ahc0 bus 0 target 5 lun 0
+sa2 at sym0 bus 0 target 5 lun 0
 sa2: <TANDBERG TDC 3800 -03:> Removable Sequential Access SCSI-CCS device 
 sa2: 3.300MB/s transfers
-pass4 at ahc0 bus 0 target 4 lun 1
+pass4 at sym0 bus 0 target 4 lun 1
 pass4: <ARCHIVE Python 28849-XXX 4.CM> Removable Changer SCSI-2 device 
 pass4: 5.000MB/s transfers (5.000MHz, offset 15)
-da0 at ahc0 bus 0 target 2 lun 0
-da0: <CONNER CFP4207S  4.28GB 2847> Fixed Direct Access SCSI-2 device 
-da0: 3.300MB/s transfers, Tagged Queueing Enabled
-da0: 4096MB (8388608 512 byte sectors: 64H 32S/T 4096C)
-cd0 at ahc0 bus 0 target 6 lun 0
+cd0 at sym0 bus 0 target 6 lun 0
 cd0: <NRC MBR-7 110> Removable CD-ROM SCSI-2 device 
 cd0: 3.300MB/s transfers
 cd0: cd present [322265 x 2048 byte records]
-changing root device to wd0s1a
+da0 at sym1 bus 0 target 3 lun 0
+da0: <SEAGATE ST15230W SUN4.2G 0738> Fixed Direct Access SCSI-2 device
+da0: 20.000MB/s transfers (10.000MHz, offset 15, 16bit), Tagged Queueing Enabled
+da0: 4095MB (8386733 512 byte sectors: 255H 63S/T 522C)
 .De
-.X "SCSI target"
+.X "SCSI, target"
 .X "target, SCSI"
-.X "SCSI logical unit"
+.X "SCSI, logical unit"
 .X "logical unit, SCSI"
 .X "LUN"
-.P
-This output shows three tape drives (\fIsa0\fP, \fIsa1\fP\| and \fIsa2\fP\|), a
-CD-ROM drive (\fIcd0\fP\|), a tape changer (\fIpass4\fP\|), and also a disk
-drive \fIda0\fP\| on target 2.
+This output shows two Symbios SCSI host adapters
+.Device -n ( sym0 \&
+and
+.Device -n sym1 ),
+three tape drives
+.Device -n ( sa0 ,
+.Device -n sa1
+and
+.Device -n sa2 ),
+a CD-ROM drive
+.Device -n ( cd0 ),
+a tape changer
+.Device -n ( pass4 ),
+and also a disk drive
+.Device -n da0
+on ID 3, which is called a \fItarget\fP\/ in these messages.  The disk is
+connected to the second host adapter, and the other devices are connected to the
+first host adapter.
 .H4 "Installing an external SCSI device"
-.X "installing an external SCSI device"
-.X "SCSI, installing an external device"
+.X "installing, external SCSI device"
+.X "SCSI, installing external device"
 .X "daisy chaining"
-.X "SCSI terminator"
+.X "SCSI, terminator"
 .X "terminator, SCSI"
-External SCSI devices are connected together by cables.  Each device has two
-connectors: one goes towards the host adapter, and the other towards the next
-device.  This method is called \fIdaisy chaining\fP.  At the end of the chain,
-the spare connector is usually plugged with a \fIterminator\fP\|, a set of
-resistors designed to keep noise off the bus.  Some devices have internal
-terminators, however.  When installing an external device, you will have to do
-one of the following:
+External SCSI devices have two cable connectors: one goes towards the host
+adapter, and the other towards the next device.  The order of the devices in the
+chain does not have to have anything to do with the SCSI ID.  This method is
+called \fIdaisy chaining\fP.  At the end of the chain, the spare connector may
+be plugged with a \fIterminator\fP, a set of resistors designed to keep noise
+off the bus.  Some devices have internal terminators, however.  When installing
+an external device, you will have to do one of the following:
 .Ls B
 .LI
-If you are installing a first external device (one connected via the cable
-connector on the backplane of the host adapter), you will have to ensure that
-the device provides termination.  Assuming you already have an internal device,
-you will also have to stop the host adapter from providing termination.  Modern
-SCSI host adapters can decide whether they need to terminate or not, but older
-host adapters have resistor packs.  In the latter case, remove these resistor
-packs.
+If you are installing a first external device (one connected directly to the
+cable connector on the backplane of the host adapter), you will have to ensure
+that the device provides termination.  If you already have at least one internal
+device, the host adapter will no longer be at one end of the chain, so you will
+also have to stop it from providing termination.  Modern SCSI host adapters can
+decide whether they need to terminate, but older host adapters have resistor
+packs.  In the latter case, remove these resistor packs.
 .LI
 If you are adding an additional external device, you have two choices: you can
 remove a cable in the middle of the daisy chain and plug it into your new
 device.  You then connect a new cable from your device to the device from which
 you removed the original cable.
-.LI
+.P
 Alternatively, you can add the device at the end of the chain.  Remove the
 terminator or turn off the termination, and plug your cable into the spare
 socket.  Insert the terminator in your device (or turn termination on).
 .Le
+.X "camcontrol, command"
+.X "command, camcontrol"
+You can add external SCSI devices to a running system if they're hot-pluggable.
+It might even work if they're not hot-pluggable, but it's not strictly the
+correct thing to do, and there's the risk that you might damage something,
+possibly irreparably.  After connecting the devices, powering them up and
+waiting for them to come ready, run
+\fIcamcontrol rescan\fP\/.  For example, if you added a second disk drive to the
+second host adapter in the example above, you might see:
+.Dx
+# \f(CBcamcontrol rescan 1\fP
+da1 at sym1 bus 0 target 0 lun 0
+da1: <SEAGATE ST15230W SUN4.2G 0738> Fixed Direct Access SCSI-2 device
+da1: 20.000MB/s transfers (10.000MHz, offset 15, 16bit), Tagged Queueing Enabled
+da1: 4095MB (8386733 512 byte sectors: 255H 63S/T 522C)
+Re-scan of bus 1 was successful
+.De
+There's a problem with this approach: note that
+.Device -n da1
+has ID 0, and the already present
+.Device -n da0
+has ID 3.  If you now reboot the system, they will come up with the device names
+the other way round.  We'll look at this issue in more detail in the next
+section.
 .H4 "Installing an internal SCSI device"
-.X "installing an internal SCSI device"
-.X "SCSI, installing an internal device"
+.X "installing, internal SCSI device"
+.X "SCSI, installing internal device"
+.Pn installing-scsi
 Installing an internal SCSI device is much the same as installing an external
 device.  Instead of daisy chains, you have a flat band cable with a number of
-connectors.  Find one which suits you, and plug it into the device.  Again, you
+connectors.  Find one that suits you, and plug it into the device.  Again, you
 need to think about termination:
 .Ls B
 .LI
 If you are installing the device at the end of the chain, it should have
-termination enabled.  You should also remove the terminators from the device
-that was previously at the end of the chain.
+termination enabled.  You should also disable termination for the device that
+was previously at the end of the chain.  Depending on the device, this may
+involve removing the physical terminators or setting a jumper.
 .LI
 If you are installing the device in the middle of the chain, make sure it does
 not have termination enabled.
 .Le
-In this case, we'll install a CDC 94181 drive in the existing SCSI chain.  We
-could be in for a surprise: the device ID we get for the new drive depends on
-what is currently on the chain.  For example, we might have a chain with a
-single drive on it:
-.Dx
-da0 at ahc0 bus 0 target 2 lun 0
-da0: <CONNER CFP4207S  4.28GB 2847> Fixed Direct Access SCSI-2 device 
-da0: 3.300MB/s transfers, Tagged Queueing Enabled
-da0: 4096MB (8388608 512 byte sectors: 64H 32S/T 4096C)
-.De
-This drive on target 2.  If we put our new drive on target 0 and reboot, we see:
-.Dx
-da0 at ahc0 bus 0 target 0 lun 0
-da0: <CDC 94181-15 0293> Fixed Direct Access SCSI-CCS device 
-da0: 3.300MB/s transfers
-da0: 573MB (1173930 512 byte sectors: 64H 32S/T 573C)
-da1 at ahc0 bus 0 target 2 lun 0
-da1: <CONNER CFP4207S  4.28GB 2847> Fixed Direct Access SCSI-2 device 
-da1: 3.300MB/s transfers, Tagged Queueing Enabled
-da1: 4096MB (8388608 512 byte sectors: 64H 32S/T 4096C)
-.De
-Since the target ID of the new disk is lower than the target ID of the old disk,
-the system recognizes the new disk as \fIda0\fP, and our previous \fIda0\fP\|
-has become \fIda1\fP.
-.P
-This change of disk ID can be a problem.  You'll have to edit \fI/etc/fstab\fP\|
-in order to be able to mount any file systems which are on the disk.
-Alternatively, you can wire down the device names\(emsee page \*[wiring] for
-more details.  The alternative is to change the SCSI IDs.  We do that, and the
-CDC drive becomes \fIda1\fP:
-.Dx
-da0 at ahc0 bus 0 target 0 lun 0
-da0: <CONNER CFP4207S  4.28GB 2847> Fixed Direct Access SCSI-2 device 
-da0: 3.300MB/s transfers, Tagged Queueing Enabled
-da0: 4096MB (8388608 512 byte sectors: 64H 32S/T 4096C)
-da1 at ahc0 bus 0 target 2 lun 0
-da1: <CDC 94181-15 0293> Fixed Direct Access SCSI-CCS device 
-da1: 3.300MB/s transfers
-da1: 573MB (1173930 512 byte sectors: 64H 32S/T 573C)
-.De
+In this chapter, we'll look at two ways of installing a drive in an existing
+SCSI chain.  We could be in for a surprise: the device ID we get for the new
+drive depends on what is currently on the chain.  For example, consider our
+example above, where we have a chain with a single drive on it:
+.Dx
+da0 at sym1 bus 0 target 3 lun 0
+da0: <SEAGATE ST15230W SUN4.2G 0738> Fixed Direct Access SCSI-2 device
+da0: 20.000MB/s transfers (10.000MHz, offset 15, 16bit), Tagged Queueing Enabled
+da0: 4095MB (8386733 512 byte sectors: 255H 63S/T 522C)
+.De
+This drive on target (ID) 2.  If we put our new drive on target 0 and reboot, we
+see:
+.Dx
+da0 at sym1 bus 0 target 0 lun 0
+da0: <SEAGATE ST15230W SUN4.2G 0738> Fixed Direct Access SCSI-2 device
+da0: 20.000MB/s transfers (10.000MHz, offset 15, 16bit), Tagged Queueing Enabled
+da0: 4095MB (8386733 512 byte sectors: 255H 63S/T 522C)
+da1 at sym1 bus 0 target 3 lun 0
+da1: <SEAGATE ST15230W SUN4.2G 0738> Fixed Direct Access SCSI-2 device
+da1: 20.000MB/s transfers (10.000MHz, offset 15, 16bit), Tagged Queueing Enabled
+da1: 4095MB (8386733 512 byte sectors: 255H 63S/T 522C)
+.De
+At first glance, this looks reasonable, but that's only because both disks are
+of the same type.  If you look at the target numbers, you'll notice that the new
+disk is
+.Device -n da0 ,
+not
+.Device -n da1 .
+The target ID of the new disk is lower than the target ID of the old disk, so
+the system recognizes the new disk as
+.Device -n da0 ,
+and our previous
+.Device -n da0
+has become
+.Device -n da1 .
+.P
+.ne 3v
+This change of disk ID can be a problem.  One of the first things you do with a
+new disk is to create new disk labels and file systems.  Both offer excellent
+opportunities to shoot yourself in the foot if you choose the wrong disk: the
+result would almost certainly be the complete loss of data on that disk.  Even
+apart from such catastrophes, you'll have to edit
+.File /etc/fstab
+before you can mount any file systems that are on the disk.  The alternatives
+are to wire down the device names, or to change the SCSI IDs.  In FreeBSD 5.0,
+you wire down device names and busses by adding entries to the boot
+configuration file
+.File /boot/device.hints .
+We'll look at that on page
+.Sref \*[device-hints] .
 .H3 "Formatting the disk"
 .X "formatting, disks"
 .X "disks, formatting"
@@ -204,25 +278,30 @@
 Formatting is the process of rewriting every sector on the disk with a specific
 data pattern, one that the electronics find most difficult to reproduce: if they
 can read this pattern, they can read anything.  Microsoft calls this a
-\fIlow-level format\fP.  Obviously it destroys any existing data, so
+\fIlow-level format\fP.\*F
+.FS
+Microsoft also uses the term \fIhigh-level format\fP\/ for what we call creating
+a file system.
+.FE
+Obviously it destroys any existing data, so
 .Highlight
 If you have anything you want to keep, back it up before formatting.
 .End-highlight
 Most modern disks don't need formatting unless they're damaged.  In particular,
 formatting will not help if you're having configuration problems, if you can't
-get PPP to work, or you're running out of disk space.\*F
-.FS
-Well, it \fIwill\fP\| solve the disk space problem, but not in the manner you
-probably desire.
-.FE
+get PPP to work, or you're running out of disk space.  Well, it \fIwill\fP\/
+solve the disk space problem, but not in the manner you probably desire.
 .P
-If you do need to format a SCSI disk, use \fIcamcontrol\fP.  \fIcamcontrol\fP\|
+If you do need to format a SCSI disk, use
+.Command camcontrol .
+.Command camcontrol
 is a control program for SCSI devices, and it includes a lot of useful functions
-which you can read about in the man page.  To format a disk, use the following
+that you can read about in the man page.  To format a disk, use the following
 syntax:
 .Dx
-# \f(CBcamcontrol format da0\fP
+# \f(CBcamcontrol format da1\fP
 .De
+.SPUP
 .Highlight
 Remember that formatting a disk destroys all data on the disk.  Before using the
 command, make sure that you need to do so: there are relatively few cases that
@@ -230,176 +309,187 @@
 the physical sector size of the disk, or if you are getting ``medium format
 corrupted'' errors from the disk in response to read and write requests.
 .End-highlight
-FreeBSD can format only floppies and SCSI disks.  It is normally no longer
-possible to reformat ata (IDE) disks, though some manufacturers have programs
-which can recover from some data problems.  Check the manufacturer's web site
-for suitable programs.
+FreeBSD can format only floppies and SCSI disks.  In general it is no longer
+possible to reformat ATA (IDE) disks, though some manufacturers have programs
+that can recover from some data problems.  In most cases, though, it's
+sufficient to write zeros to the entire disk:
+.Dx
+# \f(CBdd if=/dev/zero of=/dev/ad1s2 bs=128k\fP
+.De
+If this doesn't work, you may find formatting programs on the manufacturer's web
+site.  You'll probably need to run them under a Microsoft platform.
+.br
+.ne 15v
 .H2 "Using sysinstall"
-.X "sysinstall, command"
-.X "command, sysinstall"
-If you can, use \fIsysinstall\fP\| to partition your disk.  Looking at the
-\fIdmesg\fP\| output for our CDC 94181 SCSI disk, we see:
-.Dx
-da1 at ahc0 bus 0 target 2 lun 0
-da1: <CDC 94181-15 0293> Fixed Direct Access SCSI-CCS device 
-da1: 3.300MB/s transfers
-da1: 573MB (1173930 512 byte sectors: 64H 32S/T 573C)
-.De
-We start \fIsysinstall\fP\| with:
-.Dx
-# /stand/sysinstall
-.De
-.Aside
-In later versions of FreeBSD, \fIsysinstall\fP\| will be in the \fI/sbin\fP\|
-directory, which is normally in \f(CWroot\fP's \f(CWPATH\fP, so you should just
-be able to invoke it as \f(CWsysinstall\fP.
-.End-aside
-You will see the standard installation screen (see \*[chinstall], page
-\*[sysinstall-main]).  Select \f(CWIndex\fP, then \f(CWPartition\fP, and you
-will see the following screen:
+If you can, use
+.Command sysinstall
+to partition your disk.  Looking at the
+.Command dmesg
+output for our new disk, we see:
+.Dx
+da1 at sym1 bus 0 target 0 lun 0
+da1: <SEAGATE ST15230W SUN4.2G 0738> Fixed Direct Access SCSI-2 device
+da1: 20.000MB/s transfers (10.000MHz, offset 15, 16bit), Tagged Queueing Enabled
+da1: 4095MB (8386733 512 byte sectors: 255H 63S/T 522C)
+.De
+You see the standard installation screen (see Chapter
+.Sref "\*[nchinstall]" ,
+page
+.Sref \*[sysinstall-main] ).
+Select \f(CWIndex\fP, then \f(CWPartition\fP, and you see the following screen:
 .PIC  "images/disk-selection.ps" 4i
-.sp
-Don't be put off by the drive names \f(CWsd0\fP and \f(CWsd1\fP.  These are the
-old names for the SCSI drives \f(CWda0\fP and \f(CWda1\fP.  Currently,
-\fIsysinstall\fP\| shows both the old and the new names.
-.P
-In this case, we want to partition \fI/dev/da1\fP, so we position the cursor on
-\f(CWda0\fP (as shown) and press \fBSpace\fP (not \fBEnter\fP; that would just
-take us back to the previous menu).  At this point you may see a warning message
-that the drive geometry is incorrect.  If you do, it's probably a bug: we saw in
-the \fIdmesg\fP\| output that the probes had no trouble with the geometry, and
-geometry is not of great importance for a SCSI drive anyway: you only need it if
-you want to boot from the drive.  If you get this message, you press \fBEnter\fP
-to continue.
+.Figure-heading "Disk selection menu"
 .P
-Next, we see:
+In this case, we want to partition
+.Device da1 ,
+so we position the cursor on \f(CWda1\fP (as shown) and press \fBEnter\fP.
+.DF
 .PIC "images/disk-partition.ps" 4i
+.Pn disk-partition-menu
+.Figure-heading "Disk partition menu"
 .P
-Here we see that the disk currently contains three partitions:
+.DE
+We see the disk partition menu, which shows that the disk currently contains
+three partitions:
 .Ls B
 .LI
-The first starts at offset 0, and has a length of 12.  This is \fInot\fP\|
+The first starts at offset 0, and has a length of 63.  This is \fInot\fP\/
 unused, no matter what the description says.  It's the partition table, padded
-to the length of a ``track''.
+to the length of a ``track.''
 .LI
-The next partition takes up the bulk of the drive and is the current FreeBSD
-partition.
+The next partition takes up the bulk of the drive and is a Microsoft partition.
 .LI
-Finally, we have 90 sectors left over as a result of the partitioning scheme.
+Finally, we have 803 sectors left over as a result of the partitioning scheme.
 Sometimes this can be much larger\(emI have seen values as high as 35 MB.  This
 is the price we pay for compatibility with PC BIOS partitioning.
 .Le
 .Pn dangerously-dedicated
-We're using this disk for FreeBSD only, and we don't want to waste even this
-much space, so we'll select the option ``use whole disk for FreeBSD'', the
-so-called ``dangerously dedicated'' mode.  This term comes partially from
-superstition and partially because some BIOSes expect to find a partition table
-on the first sector of a disk, and they can't access the disk if they don't find
-one.  If your BIOS has this bug, you'll find this one out pretty quickly when
-you try to boot.  If it doesn't fail on the first boot, it won't fail.
-.P
+We want a FreeBSD partition, not a Microsoft partition.  At this point, we have
+a number of choices:
+.Ls B
+.LI
+We can change the partition type (called ``Subtype'' in the menu).  It's
+currently 6, and we would need to change it to 165.  Do this with the \f(CWt\fP
+command.
+.LI
+We could delete the partition by positioning the cursor on the partition
+information and pressing \f(CWd\fP, then create a new partition, either with
+\f(CWa\fP if we want a single partition, or with \f(CWc\fP if we want more than
+one partition.
+.LI
+If we're using this disk for FreeBSD only, we don't have to waste even this much
+space.  There is an option ``use whole disk for FreeBSD,'' the so-called
+``dangerously dedicated'' mode.  This term comes partially from superstition and
+partially because some BIOSes expect to find a partition table on the first
+sector of a disk, and they can't access the disk if they don't find one.  If
+your BIOS has this bug, you'll find this one out pretty quickly when you try to
+boot.  If it doesn't fail on the first boot, it won't fail, though it's barely
+possible that you might have trouble if you move it to a system with a different
+BIOS.  If you want to use this method, use the undocumented \f(CWf\fP command.
+.Le
 To use the whole disk, we first delete the current partition: we press the
 cursor down key until it highlights the FreeBSD partition.  Then we press
 \fBd\fP, and the three partitions are joined into one, marked \f(CWunused\fP.
 .P
-The next step is to create a new partition using the entire disk.  We press
-\f(CWa\fP, and get the following message:
+.ne 12v
+The next step is to create a new partition using the entire disk.  If we press
+\f(CWf\fP, we get the following message:
 .PIC "images/disk-partition-2.ps" 4i
 .sp
-We've already decided to use the whole disk, so we move the cursor right to
-\f(CWNo\fP, as shown in the figure, and press \fBEnter\fP.  Then we press
-\f(CWq\fP to exit the partition editor, get back to the function index, and
-select \f(CWLabel\fP.  We see:
+We don't get this message if we use the \f(CWa\fP command: it just automatically
+assumes \f(CWYes\fP.  In this case we've decided to use the whole disk, so we
+move the cursor right to \f(CWNo\fP and press \fBEnter\fP.  That gives us a boot
+manager selection screen:
+.PIC "images/mbr-choice.ps" 4i
+.P
+.ne 12v
+This isn't a boot disk, so we don't need any boot record, and it doesn't make
+any difference what we select.  It's tidier, though, to select \f(CWNone\fP as
+indicated.  Then we press \f(CWq\fP to exit the partition editor, get back to
+the function index, and select \f(CWLabel\fP.  We see:
 .PIC "images/disk-label.ps" 4i
 .sp
-We want to create two partitions: first, a swap partition of 200 Megabytes, and
-then a file system taking up the rest of the disk.  We press C, and are shown a
-submenu offering us all 1173930 blocks on the disk.  We erase that and enter
-\f(CW200m\fP, which represents 200 Megabytes.  Then we press \fBEnter\fP, and
-another submenu appears, asking us what kind of slice it is.  We move the cursor
-down to select \f(CWA swap partition\fP:
+The important information on this rather empty looking menu is the information
+at the top about the free space available.  We want to create two partitions:
+first, a swap partition of 512 MB, and then a file system taking up the rest of
+the disk.  We press C, and are shown a submenu offering us all 8386733 blocks on
+the disk.  We erase that and enter \f(CW512m\fP, which represents 512 MB.  Then
+we press \fBEnter\fP, and another submenu appears, asking us what kind of slice
+it is.  We move the cursor down to select \f(CWA swap partition\fP:
 .\" XXX one sub menu only .PIC "images/disk-label-1.ps" 4i
 .PIC "images/disk-label-2.ps" 4i
 .sp
+.ne 4v
 Next, we press \f(CWc\fP again to create a new partition.  This time, we accept
-the offer of the rest of the space on the disk, 764330 sectors, we select \f(CWA
-file system\fP, and we are presented with yet another menu asking for the name
-of the file system.  We enter the name, which happens to be \fI/S\fP\|:
+the offer of the rest of the space on the disk, 7338157 sectors, we select
+\f(CWA file system\fP, and we are presented with yet another menu asking for the
+name of the file system.  We enter the name, in this case
+.Directory -n /S \/:
 .PIC "images/disk-label-3.ps" 4i
 .sp
 After pressing \fBEnter\fP, we see:
 .PIC "images/disk-label-4.ps" 4i
 .sp
+.ne 12v
 Finally, we press \f(CWW\fP to tell the disk label editor to perform the
 function.  We get an additional warning screen:
 .PIC "images/disk-label-5.ps" 4i
 .sp
-Since we're doing this on-line, that's OK.  We select \f(CWYes\fP, and
-\fIsysinstall\fP\| creates the file system and mounts both it and the swap
-partition.  This can take quite a while.  Don't try to do anything with the
-drive until it's finished.
+We're doing this online, so that's OK.  We select \f(CWYes\fP, and
+.Command sysinstall
+creates the file system and mounts both it and the swap partition.  This can
+take quite a while.  Don't try to do anything with the drive until it's
+finished.
 .H2 "Doing it the hard way"
 .Pn the-hard-way
-Unfortunately, sometimes you may not be able to use the \fIsysinstall\fP\|
-method.  That leaves us with the old way to add disks. The only difference is
-that this time we need to use different tools.  In the following sections, we'll
-look at what we have to do to install an old CDC SCSI drive, even older than the
-one in the previous section.
+Unfortunately, sometimes you may not be able to use the
+.Command sysinstall
+method.  You may not have access to
+.Command sysinstall ,
+or you may want to use options that
+.Command sysinstall
+doesn't offer.  That leaves us with the old way to add disks. The only
+difference is that this time we need to use different tools.  In the following
+sections, we'll look at what we have to do to install this same 4 GB Seagate
+drive manually.  This time we'll change the partitioning to contain the
+following partitions:
+.Ls B
+.LI
+A Microsoft file system.
+.LI
+The
+.Directory /newhome
+file system for our FreeBSD system.
+.LI
+Additional swap for the FreeBSD system.
+.Le
+We've called this file system
+.Directory /newhome
+to use it as an example of moving file systems to new disks.  On page
+.Sref \*[move-fs] \&
+we'll see how to move the data across.
 .H3 "Creating a partition table"
 .X "creating a partition table"
 .X "partition table, creating"
-We looked at how to format the disk on page \*[format-disk].  The next step is
-to create a PC BIOS style partition table on the disk.  We looked at the
-concepts on page
-.Sref \*[building-partition-table] ,
-.X "fdisk command"
-.X "command, fdisk"
-but this time we use different tools.  As in Microsoft, the partitioning program is
-called \fIfdisk\fP\|, and the man page is on page
-.Sref \*[manpage-fdisk] .
-In the following discussion, you'll find a pocket calculator useful.
-.P
-Depending on what was on the disk before, \fIfdisk\fP\| could get sufficiently
-confused to not work correctly.  If you don't format the disk, it's a good idea
-to overwrite the beginning of the disk with \fIdd\fP\|:
+The first step is to create a PC BIOS style partition table on the disk.  As in
+Microsoft, the partitioning program is called
+.Command fdisk .
+In the following discussion, you'll find a pocket calculator indispensable.
+.P
+If the disk is not brand new, it will have existing data of some kind on it.
+Depending on the nature of that data,
+.Command fdisk
+could get sufficiently confused to not work correctly.  If you don't format the
+disk, it's a good idea to overwrite the beginning of the disk with
+.Command dd \/:
 .Dx
-# \f(CBdd if=/dev/zero of=/dev/rda1 count=100\fP
+# \f(CBdd if=/dev/zero of=/dev/da1 count=100\fP
 100+0 records in
 100+0 records out
 51200 bytes transferred in 1 secs (51200 bytes/sec)
 .De
-Next, we look at what's on the disk.  This doesn't seem to make much sense,
-since we have just overwritten the contents, but \fIfdisk\fP\| will tell us one
-thing of importance: the disk geometry.  We'll need this later on.
-.Dx
-# \f(CBfdisk /dev/rda1\fP
-******* Working on device /dev/rda1 *******
-parameters extracted from in-core disklabel are:
-cylinders=967 heads=9 sectors/track=35 (315 blks/cyl)
-
-parameters to be used for BIOS calculations are:
-cylinders=967 heads=9 sectors/track=35 (315 blks/cyl)
-
-fdisk: Invalid fdisk partition table found
-Warning: BIOS sector numbering starts with sector 1
-Information from DOS bootblock is:
-The data for partition 0 is:
-<UNUSED>
-The data for partition 1 is:
-<UNUSED>
-The data for partition 2 is:
-<UNUSED>
-The data for partition 3 is:
-sysid 165,(FreeBSD/NetBSD/386BSD)
-    start 1, size 304604 (148 Meg), flag 80
-        beg: cyl 0/ sector 2/ head 0;
-        end: cyl 967/ sector 1/ head 0
-.De
-You'll notice that \fIfdisk\fP\| has decided to put a FreeBSD partition in
-partition 3.  That's not what we want in this case: we want a Microsoft
-partition as well.  This is a small disk by modern standards, only 150 MB, so
-we'll assign 100 MB to FreeBSD, and leave 50 MB for Microsoft.  Our resulting
-partition table should look like:
+We'll assign 1 GB for Microsoft and use the remaining approximately 3 GB for
+FreeBSD.  Our resulting partition table should look like:
 .PS
 h = .2i
 dh = .02i
@@ -416,671 +506,407 @@
     P4:	box ht .4i
 
 	move right 1.65i from P1.ne
-	boxwid = 2.2
+        boxwid = 2.5i
 	down
-     C: box ht .25i "Microsoft \f(CWC:\fP drive"
+     C: box ht .25i "Microsoft primary partition"
 
 	move .25i
-    FA: box ht .2i "FreeBSD disk label and bootstrap"
-        box ht .2i "\fI/dev/da1s2a\fP"
-        box ht .2i "\fI/dev/da1s2b\fR: FreeBSD swap"
-        box ht .2i "\fI/dev/da1s2d\fR"
-	box ht .2i "\fI/dev/da1s2e\fR"
-        box ht .2i "\fI/dev/da1s2f\fR"
-        box ht .2i "\fI/dev/da1s2g\fR"
-        box ht .2i "\fI/dev/da1s2h\fR\|: \fI/home\fP\| file system"
+    FA: box ht .2i "\fI/dev/da1s2b\fR: FreeBSD swap"
+        box ht .2i "\fI/dev/da1s2h\fR\/: \fI/newhome\fP\/ file system"
 
 	arrow from P1.e to C.w
 	arrow from P2.e to FA.w	
 	move up .08i from P1.c	"Slice 1 - Microsoft primary" 
-	move down .08i from P1.c  "\fI/dev/da1s1\fP, 48 MB"
+        move down .08i from P1.c  "\fI/dev/da1s1\fP, 1 GB"
 	move up .08i from P2.c	"Slice 2 - FreeBSD" 
-	move down .08i from P2.c  "\fI/dev/da1s2\fP, 100 MB"
+        move down .08i from P2.c  "\fI/dev/da1s2\fP, 3 GB"
 	"Slice 3 (unused)" at P3.c
 	"Slice 4 (unused)" at P4.c
 	]
 .PE
 .Figure-heading "Partition table on second FreeBSD disk"
-.Tn second-disk-partitions
-.X "fdisk command"
-.X "command, fdisk"
+.Fn second-disk-partitions
+.ps \n(PS                       \"  point size of standard text
+.vs \n(LS                       \" Standard vertical spacing
 The Master Boot Record and the Partition Table take up the first sector of the
-disk, and the rest can be divided between the partitions.  It's easy to make a
-mistake in specifying the parameters, and \fIfdisk\fP\| performs as good as no
-checking.  You can easily create a partition table that has absolutely no
-relationship with reality, so it's a good idea to calculate them in advance.
-For each partition, we need to know three things:
+disk, but many of the allocations are track oriented, so the entire first track
+of the disk is not available for allocation.  The rest, up to the end of the
+last entire cylinder, can be divided between the partitions.  It's easy to make
+a mistake in specifying the parameters, and
+.Command fdisk
+performs as good as no checking.  You can easily create a partition table that
+has absolutely no relationship with reality, so it's a good idea to calculate
+them in advance.  For each partition, we need to know three things:
 .Ls B
 .LI
-.X "partition type"
-The \fIpartition type\fP, which \fIfdisk\fP\| calls \fIsysid\fP.  This is a
-number describing what the partition is used for.  FreeBSD partitions have
-partition type 165, and modern (release 4 and later) Microsoft partitions have type
-6.
+.X "partition, type"
+The \fIpartition type\fP, which
+.Command fdisk
+calls \fIsysid\fP.  This is a number describing what the partition is used for.
+FreeBSD partitions have partition type 165, and modern (MS-DOS Release 4 and
+later) Microsoft partitions have type 6.
 .LI
 The \fIstart sector\fP, the first sector in the partition.
 .LI
-The \fIend sector\fP\| for the partition.
+The \fIend sector\fP\/ for the partition.
 .Le
 .X "active partition"
 .X "partition, active"
-In addition, we need to decide which partition is the \fIactive\fP\| partition,
+.ne 3v
+In addition, we need to decide which partition is the \fIactive\fP\/ partition,
 the partition from which we want to boot.  In this case, it doesn't make any
-difference, since we won't be booting from the disk, but it's always a good idea
-to set it anyway.
+difference, because we won't be booting from the disk, but it's always a good
+idea to set it anyway.
 .P
 We specify the partitions we don't want by giving them a type, start sector and
-end sector of 0.  As we have seen, our disk has 304605 sectors, numbered 0 to
-304604.  Partitions should start and end on a cylinder boundary.  We want the
-FreeBSD partitions to be about 100 MB, or 204,800 sectors, which leaves 99,806
-sectors for the Microsoft partition.  We know the geometry from the \fIfdisk\fP\|
-output above: \f(CWcylinders=967 heads=9 sectors/track=35 (315 blks/cyl)\fR.  So
-our 204,800 sectors would take up 204800 / 315, or 650.1587302 cylinders.  Since
-we want to use this disk primarily for FreeBSD, we'll round this value up to 651
-cylinders, or 205,065 sectors.  This leaves 316 cylinders, less the first sector
-on the disk, for Microsoft, a total of (316 * 315) - 1 or 99,539 sectors.  Our
-resulting information is:
-.TB "sample \fIfdisk\fP\| parameters"
-.X "fdisk command"
-.X "command, fdisk"
-.TS H
-box,center, tab(#) ;
-| rfCWp9| rfCWp9| rfCWp9| rfCWp9 | .
-\fRPartition#\fRPartition#\fRStart#\fRSize
-\fRnumber#\fRtype#\fRsector
-=
-.TH N
-1#6#1#99539
-2#165#304604#205065
-3#0#0
-4#0#0
-.TE
-.P
-If you're unlucky, \fIfdisk\fP\| will give you a completely different idea of
-the disk geometry from what \fIscsiformat\fP\| did.  Possibly you can decide by
-examination which program is wrong, or maybe you can look at the \fIdmesg\fP\|
-output for a tie-breaker.  In all cases I have seen, it has been \fIfdisk\fP\|
-that returned the incorrect information, and only when the disk did not have a
-valid partition table.  For example, this happened with a disk formatted for
-BSD/OS:
-.Dx
-# \f(CBscsiformat da1\fP
-MICROP 
-2112-15MQ1094802 
-HQ48 
-
-Mode data length:  35 
-Medium type:  0 
-Device Specific Parameter:  0 
-Block descriptor length:  8 
-Density code:  0 
-Number of blocks:  2051615 
-Reserved:  0 
-Block length:  512 
-PS:  1 
-Reserved:  0 
-Page code:  4 
-Page length:  22 
-Number of Cylinders:  1760 
-Number of Heads:  15 
-Starting Cylinder-Write Precompensation:  0 
-Starting Cylinder-Reduced Write Current:  0 
-Drive Step Rate:  0 
-Landing Zone Cylinder:  0 
-Reserved:  0 
-RPL:  0 
-Rotational Offset:  0 
-Reserved:  0 
-Medium Rotation Rate:  5400 
-Reserved:  0 
-Reserved:  0 
+end sector of 0.  Our disk has 8386733 sectors, numbered 0 to 8386732.
+Partitions should start and end on a cylinder boundary, and we want the
+Microsoft partition to be about 1 GB.  1 GB is 1024 MB, and 1 MB is 2048 sectors
+of 512 bytes each, so theoretically we want 1024 \(mu 2048, or 2197152 sectors.
+Because of the requirement that partitions begin and end on a ``cylinder''
+boundary, we need to find the closest number of ``cylinders'' to this value.
+First we need to find out how big a ``cylinder'' is.  We can do this by running
+.Command fdisk
+without any options:
+.Dx
 # \f(CBfdisk da1\fP
-******* Working on device /dev/rda1 *******
+******* Working on device /dev/da1 *******
 parameters extracted from in-core disklabel are:
-cylinders=160 heads=256 sectors/track=50 (12800 blks/cyl)
+cylinders=13726 heads=13 sectors/track=47 (611 blks/cyl)
 
  Figures below won't work with BIOS for partitions not in cyl 1
 parameters to be used for BIOS calculations are:
-cylinders=160 heads=256 sectors/track=50 (12800 blks/cyl)
+cylinders=13726 heads=13 sectors/track=47 (611 blks/cyl)
 
+fdisk: invalid fdisk partition table found
+Media sector size is 512
 Warning: BIOS sector numbering starts with sector 1
 Information from DOS bootblock is:
-The data for partition 0 is:
-sysid 255,(BBT (Bad Blocks Table))
-    start 1023744, size 2108293151 (1029440 Meg), flag 0
-        beg: cyl 768/ sector 15/ head 147;
-        end: cyl 0/ sector 0/ head 255
 The data for partition 1 is:
-sysid 101,(Novell Netware 3.xx)
-    start 1646292846, size 1814062195 (885772 Meg), flag 0
-        beg: cyl 356/ sector 50/ head 0;
-        end: cyl 256/ sector 50/ head 114
+<UNUSED>
 The data for partition 2 is:
-sysid 0,(unused)
-    start 0, size 0 (0 Meg), flag 61
-        beg: cyl 364/ sector 37/ head 98;
-        end: cyl 0/ sector 0/ head 0
+<UNUSED>
 The data for partition 3 is:
 <UNUSED>
-.De
-Looking at the output from \fIdmesg\fP\|, we see:
-.Dx
-(aha0:1:0): "MICROP 2112-15MQ1094802 HQ48" type 0 fixed SCSI 2
-da1(aha0:1:0): Direct-Access 1001MB (2051615 512 byte sectors)
-da1(aha0:1:0): with 1760 cyls, 15 heads, and an average 77 sectors/track
-.De
-In this case, then, you should use the parameters 1760 cylinders, 15 heads, and
-77 sectors per track.  What's less obvious here is the number of cylinders:
-\f(CWfdisk\fP doesn't have an opinion, and \fIscsiformat\fP\| and \fIdmesg\fP\|
-decided it has 2,051,615 sectors.  Unfortunately, if you calculate the number
-according to the formula \fIcylinders\fP\| \(mu \fIheads\fP\| \(mu
-\fIsectors\fP, you'll come up with a different result: in this case 1760 \(mu 15
-\(mu 77 = 2,032,800.  How come?  The disks report the total number of sectors,
-including spare tracks and such, but you can't use them all.  The 2,032,800 is
-the correct number, and if you try to specify 2,051,615 to \fIdisklabel\fP, it
-will spit out lots of messages about partitions which go beyond the end of the
-disk.
-.P
-Next we run \fIfdisk\fP\| in earnest by specifying the \f(CW-i\fP option.
-During this time, you will see messages on the console:
+The data for partition 4 is:
+sysid 165,(FreeBSD/NetBSD/386BSD)
+    start 47, size 8386539 (4094 Meg), flag 80 (active)
+        beg: cyl 0/ head 1/ sector 1;
+        end: cyl 413/ head 12/ sector 47
+.De
+You'll notice that
+.Command fdisk
+has decided that there is a FreeBSD partition in partition 4.  That happens even
+if the disk is brand new.  In fact, this is a less desirable feature of
+.Command fdisk  \/:
+it ``suggests'' this partition, it's not really there, which can be really
+confusing.  This printout does, however, tell us that
+.Command fdisk
+thinks there are 611 sectors per cylinder, so we divide 2197152 by 611 and get
+3423.327 cylinders.  We round down to 3423 cylinders, which proves to be 2091453
+sectors.  This is the length we give to the first partition.
+.P
+We use the remaining space for the FreeBSD partition.  How much?  Well,
+.Command dmesg
+tells us that there are 8386733 sectors, but if you look at the geometry that
+.Command fdisk
+outputs, there are 13726 cylinders with 13 heads (tracks) per cylinder and 47
+sectors per track.  13726 \(mu 13 \(mu 47 is 8386586.  This rounding down is the
+explanation for the missing data at the end of the disk that we saw on page
+.Sref \*[disk-partition-menu] .
+The best way to calculate the size of the FreeBSD partition is to take the
+number of cylinders and multiply by the number of tracks per cylinder.  The
+FreeBSD partition starts behind the Microsoft partition, so it goes from
+cylinder 3423 to cylinder 13725 inclusive, or 10303 cylinders.  At 611 sectors
+per cylinder, we have a total of 6295133 sectors in the partition.  Our
+resulting information is:
+.br
+.ne 10v
+.Table-heading "sample \fIfdisk\fP\/ parameters"
+.TS H
+tab(#) ;
+ rfCWp9| rfCWp9| rfCWp9| rfCWp9 .
+\fRPartition#\fRPartition#\fRStart#\fRSize
+\fRnumber#\fRtype#\fRsector
+_
+.TH N
+1#6#1#2091453
+2#165#2091453#6295133
+3#0#0
+4#0#0
+.TE
+.sp 2v
+Next we run
+.Command fdisk
+in earnest by specifying the \f(CW-i\fP option.  During this time, you may see
+messages on the console:
 .Dx
 da1: invalid primary partition table: no magic
 .De
-The message \fIno magic\fP\| doesn't mean that \fIfdisk\fP\| is out of purple
-smoke.  It refers to the fact that it didn't find the so-called \fImagic
-number\fP, which identifies the partition table.  Since we don't have a
-partition table yet, this message isn't surprising. It's also completely
+The message \fIno magic\fP\/ doesn't mean that
+.Command fdisk
+is out of purple smoke.  It refers to the fact that it didn't find the so-called
+\fImagic number\fP, which identifies the partition table.  We don't have a
+partition table yet, so this message isn't surprising.  It's also completely
 harmless.
 .P
-\fIfdisk\fP\| prompts interactively:
+.Command fdisk
+prompts interactively when you specify the \f(CW-i\fP flag:
 .Dx
-# \f(CBfdisk -i /dev/rda1\fP
-******* Working on device /dev/rda1 *******
+# \f(CBfdisk -i da1\fP
+******* Working on device /dev/da1 *******
 parameters extracted from in-core disklabel are:
-cylinders=967 heads=9 sectors/track=35 (315 blks/cyl)
+cylinders=13726 heads=13 sectors/track=47 (611 blks/cyl)
 
+Figures below won't work with BIOS for partitions not in cyl 1
 parameters to be used for BIOS calculations are:
-cylinders=967 heads=9 sectors/track=35 (315 blks/cyl)
+cylinders=13726 heads=13 sectors/track=47 (611 blks/cyl)
 
-Do you want to change our idea of what BIOS thinks ? [n] \fBEnter \fIpressed\f(CW
-fdisk: Invalid fdisk partition table found
+Do you want to change our idea of what BIOS thinks ? [n]  \f(BIEnter \fIpressed\f(CW
+Media sector size is 512
 Warning: BIOS sector numbering starts with sector 1
 Information from DOS bootblock is:
-The data for partition 0 is:
-<UNUSED>
-Do you want to change it? [n] \f(CBy\f(CW
-Supply a decimal value for "sysid" [0] \f(CB6\f(CW
-Supply a decimal value for "start" [0] \f(CB1\f(CW
-Supply a decimal value for "size" [0] \f(CB99539\f(CW
-Explicitly specifiy beg/end address ? [n] \fBEnter \fIpressed\f(CW
-sysid 6,(Primary 'big' DOS (> 32MB))
-    start 1, size 99539 (48 Meg), flag 0
-        beg: cyl 0/ sector 2/ head 0;
-        end: cyl 315/ sector 35/ head 8
-Are we happy with this entry? [n] \f(CBy\f(CW
 The data for partition 1 is:
-<UNUSED>
-Do you want to change it? [n] \f(CBy\f(CW
-Supply a decimal value for "sysid" [0] \f(CB165\f(CW
-Supply a decimal value for "start" [0] \f(CB99540\f(CW
-Supply a decimal value for "size" [0] \f(CB205065\f(CW
-Explicitly specifiy beg/end address ? [n] \fBEnter \fIpressed\f(CW
 sysid 165,(FreeBSD/NetBSD/386BSD)
-    start 99540, size 205065 (100 Meg), flag 0
-        beg: cyl 316/ sector 1/ head 0;
-        end: cyl 966/ sector 35/ head 8
-Are we happy with this entry? [n] \f(CBy\f(CW
+    start 0, size 8386733 (4095 Meg), flag 80 (active)
+        beg: cyl 0/ head 0/ sector 1;
+        end: cyl 522/ head 12/ sector 47
+Do you want to change it? [n] \f(CBy\fP
+Supply a decimal value for "sysid (165=FreeBSD)" [0] \f(CB6\fP
+Supply a decimal value for "start" [0]  \f(BIEnter \fIpressed\f(CW
+Supply a decimal value for "size" [0] \f(CB2091453\fP
+Explicitly specify beg/end address ? [n]  \f(BIEnter \fIpressed\f(CW
+sysid 6,(Primary 'big' DOS (> 32MB))
+    start 0, size 2091453 (1021 Meg), flag 0
+        beg: cyl 0/ head 0/ sector 1;
+        end: cyl 350/ head 12/ sector 47
+Are we happy with this entry? [n] \f(CBy\fP
 The data for partition 2 is:
 <UNUSED>
-Do you want to change it? [n] \fBEnter \fIpressed\f(CW
+Do you want to change it? [n] \f(CBy\fP
+Supply a decimal value for "sysid (165=FreeBSD)" [0] \f(CB165\fP
+Supply a decimal value for "start" [0] \f(CB2091453\fP
+Supply a decimal value for "size" [0] \f(CB6295133\fP
+Explicitly specify beg/end address ? [n]  \f(BIEnter \fIpressed\f(CW
+sysid 165,(FreeBSD/NetBSD/386BSD)
+    start 2091453, size 6295133 (3073 Meg), flag 0
+        beg: cyl 351/ head 0/ sector 1;
+        end: cyl 413/ head 12/ sector 47
+Are we happy with this entry? [n] \f(CBy\fP
 The data for partition 3 is:
+<UNUSED>
+Do you want to change it? [n] \f(BIEnter \fIpressed\f(CW
+The data for partition 4 is:
 sysid 165,(FreeBSD/NetBSD/386BSD)
-    start 1, size 304604 (148 Meg), flag 80
-        beg: cyl 0/ sector 2/ head 0;
-        end: cyl 967/ sector 1/ head 0
-Do you want to change it? [n] \f(CBy\f(CW
+    start 47, size 8386539 (4094 Meg), flag 80 (active)
+        beg: cyl 0/ head 1/ sector 1;
+        end: cyl 413/ head 12/ sector 47
+Do you want to change it? [n] \f(CBy\fP
 
-The static data for the DOS partition 3 has been reinitialized to:
+The static data for the DOS partition 4 has been reinitialized to:
 sysid 165,(FreeBSD/NetBSD/386BSD)
-    start 1, size 304604 (148 Meg), flag 80
-        beg: cyl 0/ sector 2/ head 0;
-        end: cyl 967/ sector 1/ head 0
-Supply a decimal value for "sysid" [165] \f(CB0\f(CW
-Supply a decimal value for "start" [1] \f(CB0\f(CW
-Supply a decimal value for "size" [304604] \f(CB0\f(CW
-Explicitly specifiy beg/end address ? [n] \fBEnter \fIpressed\f(CW
-sysid 0,(unused)
-    start 0, size 0 (0 Meg), flag 80
-        beg: cyl 0/ sector 0/ head 0;
-        end: cyl 0/ sector 0/ head 0
-Are we happy with this entry? [n] \f(CBy\f(CW
-Do you want to change the active partition? [n] \f(CBy\f(CW
-Supply a decimal value for "active partition" [3] \f(CB1\f(CW
-Are you happy with this choice [n] \f(CBy\f(CW
+    start 47, size 8386539 (4094 Meg), flag 80 (active)
+        beg: cyl 0/ head 1/ sector 1;
+        end: cyl 413/ head 12/ sector 47
+Supply a decimal value for "sysid (165=FreeBSD)" [165] \f(CB0\fP
+Supply a decimal value for "start" [47] \f(CB0\fP
+Supply a decimal value for "size" [8386539] \f(CB0\fP
+Explicitly specify beg/end address ? [n] \f(BIEnter \fIpressed\f(CW
+<UNUSED>
+Are we happy with this entry? [n] \f(CBy\fP
+Do you want to change the active partition? [n] \f(CBy\fP
+Supply a decimal value for "active partition" [1] \f(CB2\fP
+Are you happy with this choice [n] \f(CBy\fP
 
 We haven't changed the partition table yet.  This is your last chance.
 parameters extracted from in-core disklabel are:
-cylinders=967 heads=9 sectors/track=35 (315 blks/cyl)
+cylinders=13726 heads=13 sectors/track=47 (611 blks/cyl)
 
+Figures below won't work with BIOS for partitions not in cyl 1
 parameters to be used for BIOS calculations are:
-cylinders=967 heads=9 sectors/track=35 (315 blks/cyl)
+cylinders=13726 heads=13 sectors/track=47 (611 blks/cyl)
 
 Information from DOS bootblock is:
-0: sysid 6,(Primary 'big' DOS (> 32MB))
-    start 1, size 99539 (48 Meg), flag 0
-        beg: cyl 0/ sector 2/ head 0;
-        end: cyl 315/ sector 35/ head 8
-1: sysid 165,(FreeBSD/NetBSD/386BSD)
-    start 99540, size 205065 (100 Meg), flag 80
-        beg: cyl 316/ sector 1/ head 0;
-        end: cyl 966/ sector 35/ head 8
-2: <UNUSED>
+1: sysid 6,(Primary 'big' DOS (> 32MB))
+    start 0, size 2091453 (1021 Meg), flag 0
+        beg: cyl 0/ head 0/ sector 1;
+        end: cyl 350/ head 12/ sector 47
+2: sysid 165,(FreeBSD/NetBSD/386BSD)
+    start 2091453, size 6295133 (3073 Meg), flag 80 (active)
+        beg: cyl 351/ head 0/ sector 1;
+        end: cyl 413/ head 12/ sector 47
 3: <UNUSED>
-Should we write new partition table? [n] \f(CBy\f(CW
+4: <UNUSED>
+Should we write new partition table? [n] \f(CBy\fP
 .De
-By default, \fIfdisk\fP\| creates a FreeBSD partition in slice 3.  Even though
-we didn't have any space left, it created a partition there.  You don't need to
-delete it if you don't want to, but since it overlaps the other partitions, it
-would probably confuse Microsoft utilities, so it's a good idea.
+You'll notice a couple of things here:
+.Ls B
+.LI
+Even though we created valid partitions 1 and 2, which cover the entire drive,
+.Command fdisk
+gave us the phantom partition 4 which covered the whole disk, and we had to
+remove it.
+.LI
+The cylinder numbers in the summary at the end don't make any sense.  We've
+already calculated that the Microsoft partition goes from cylinder 0 to cylinder
+3422 inclusive, and the FreeBSD partition goes from cylinder 3423 to cylinder
+13725.  But
+.Command fdisk
+says that the Microsoft partition goes from cylinder 0 to cylinder 350
+inclusive, and the FreeBSD partition goes from cylinder 351 to cylinder 413.
+What's that all about?
+.P
+.ne 2v
+The problem here is overflow: once upon a time, the maximum cylinder value was
+1023, and
+.Command fdisk
+still thinks this is the case.  The numbers we're seeing here are the remainder
+left by dividing the real cylinder numbers by 1024.
+.\" 0 d5f  359d
+.\"   15f   19d
+.Le
+.SPUP
 .H3 "Labelling the disk"
 .X "labelling disks"
 .X "disks, labelling"
 .X "disk slice"
 .X "slice, disk"
-Once we have a valid PC BIOS partition table, we need to pay more attention to
-our FreeBSD slice (slice 1, or PC BIOS partition 2).  It'll make life easier
-here to remember a few things:
+Once we have a valid PC BIOS partition table, we need to create the file
+systems.  We won't look at the Microsoft partition in any more detail, but we
+still need to do some more work on our FreeBSD slice (slice or PC BIOS partition
+2).  It'll make life easier here to remember a couple of things:
 .Ls B
 .LI
 From now on, we're just looking at the slice, which we can think of as a logical
-disk.  Names like \fIdisk label\fP\| really refer to the slice, but since many
-standard terms use the word \fIdisk\fP, we'll continue to use them.
+disk.  Names like \fIdisk label\fP\/ really refer to the slice, but many
+standard terms use the word \fIdisk\fP, so we'll continue to use them.
 .LI
 All offsets are relative to the beginning of the slice, not the beginning of the
 disk.  Sizes also refer to the slice and not the disk.
+.Le
+The first thing we need is the disk (slice) label, which supplies general
+information about the slice:
+.Ls B
+.LI
+The fact that it's a FreeBSD slice.
+.LI
+The size of the slice.
+.LI
+The sizes, types and layout of the file systems.
 .LI
-.X "/dev/rda1c"
-.X "/dev/da1c"
-Depending on the operation, we may need to take the raw disk
-(\fI/dev/rda1c\fP\|)
-or the block device (\fI/dev/da1c\fP\|).
-Sometimes the
-programs can recover if you specify the wrong device, but sometimes they produce
-some really strange error messages instead.
+Some obsolete information about details like rotational speed of the disk and
+the track-to-track switching time.  This is still here for historical reasons
+only.  It may go away soon.
 .Le
-The first thing we need is the disk label, which supplies information about the
-disk geometry and the layout of the file systems.  These are two different
-things, of course: the overall disk geometry is determined by the kind of disk,
-but you have decided (with \fIfdisk\fP\|) what part of the disk represents the
-FreeBSD slice, and you also need to define what file systems you want.  As we
-saw in \*[chinstall], page
-.Sref \*[disklabel-editor] ,
-a typical first disk will contain a root file system, swap space and a
-\fI/usr\fP\| file system.  On other disks, this arrangement may be different.
-The arguments in favour of a small root file system are less powerful on other
-disks.  On the other hand, you may want to add swap on other disks: firstly,
-it's possible that you are a bit low on swap, and secondly, spreading swap over
-other disks can improve performance if you are low on memory.  In our example,
-let's add 20 MB of swap and make the rest of the slice a \fI/home\fP\| file
-system.  In addition, we need to define the \f(CWc\fP partition, which
-represents the whole disk.  Traditionally, data disks use the \f(CWh\fP
+The only information we need to input is the kind, size and locations of the
+partitions.  In this case, we have decided to create a file system on partition
+\f(CWh\fP 
+.File -n ( /dev/da1s2h \/)
+and swap space on partition \f(CWb\fP
+.File -n ( /dev/da1s1b ).
+The swap space will be 512 MB, and the file system will take up the rest of the
+slice.  This is mainly tradition: traditionally data disks use the \f(CWh\fP
 partition and not the \f(CWa\fP partition, so we'll stick to that tradition,
 though there's nothing to stop you from using the \f(CWa\fP partition if you
-prefer.  For each partition, we need to know the start offset, the size and the
-file system type.  In summary, the FreeBSD slice we want to create looks like:
+prefer.  In addition, we need to define the \f(CWc\fP partition, which
+represents the whole slice.  In summary, the FreeBSD slice we want to create
+looks like:
 .PS
 h = .2i
 dh = .02i
 dw = 1.7i
-boxwid = 2.5i
+boxwid = 3i
 down
 [    S: box invis
-    FA: box ht .2i "FreeBSD disk label and bootstrap" at S+(1,0)
-        box ht .2i "\fI/dev/da1a\fP (empty)"
-        box ht .2i "\fI/dev/da1s2b\fR: FreeBSD swap, 20 MB"
-        box ht .2i "\fI/dev/da1s2d\fR (empty)"
-	box ht .2i "\fI/dev/da1s2e\fR (empty)"
-        box ht .2i "\fI/dev/da1s2f\fR (empty)"
-        box ht .2i "\fI/dev/da1s2g\fR (empty)"
-        box ht .2i "\fI/dev/da1s2h\fR\|: \fI/home\fP\| file system, 80 MB"
+    FA: box ht .2i "\fI/dev/da1s2b\fR: FreeBSD swap, 512 MB" at S+(1,0)
+        box ht .2i "\fI/dev/da1s2h\fR\/: \fI/newhome\fP\/ file system, 2.5 GB"
 	]
 .PE
 .Figure-heading "FreeBSD slice on second disk"
-.Tn second-disk-freebsd-slice
-.H3 "Disklabel"
-.X "disklabel command"
-.X "command, disklabel"
-.X "/etc/disktab file"
-.X "file, /etc/disktab"
-The program which writes the disk label is called (wait for it)
-\fIdisklabel\fP.  You can tell it the geometry and file system layout
-information in two different ways: you can find or create an entry in
-\fI/etc/disktab\fP, or you can create your own prototype file.  We'll look at
-both ways in the following sections.
-.H4 "/etc/disktab"
-.Pn disktab
-You can label the disk with a command like
-.Dx
-# \f(CBdisklabel -w -r da1 \f(BIdisktype\fP
-.De
-\fIdisktype\fP\| is a label in the file \fI/etc/disktab\fP, which contains
-definitions of disk geometry for a number of known disks.  There's a good chance
-that your disk won't be in it, though.  An entry in \fIdisktab\fP\| looks like:
-.Dx
-fuji2266|Fujitsu M2266S: \e
-	:ty=winchester:dt=SCSI:se#512:nt#15:ns#85:nc#1658:rm#3600:\e
-	:pc#2113950:oc#0: \e
-	:ph#2107704:oh#0:bh#4096:fh#512:th=4.2BSD:
-.De
-.X "termcap"
-.X "disklabel command"
-.X "command, disklabel"
-The format of this file is derived from \fItermcap\fP, and it's a bit tough at
-first sight.  In fact, there isn't too much you need to understand.  The first
-name, up to the \f(CW|\fP symbol, is the \fIlabel\fP\|.  This is the name you
-specify to \fIdisklabel\fP, so you don't want to make it too long.  The next
-name, up to the \f(CW:\fP, is a more verbose description of the disk.  After the
-colon come specifications consisting of a property name, followed by either a
-\f(CW=\fP symbol and a string value, or a \f(CW#\fP symbol and a numeric value.
-See the man page \fIdisktab(5)\fP\| for further details.  The values that
-interest us are:
-.TB "disktab values"
-.TS H
-box,tab(#) ;
-| lfCWp9 | lw72 | .
-Name#Meaning
-=
-.TH N
-ty#T{
-Type of disk. \f(CBwinchester\fP specifies a non-removable hard disk.
-T}
-dt#T{
-Type of controller, in this case SCSI
-T}
-se#T{
-Number of bytes per sector.  For current FreeBSD systems, this must be 512
-T}
-nt#T{
-Number of tracks per cylinder, in this case 15.
-T}
-ns#T{
-Number of sectors per track, in this case 85.
-T}
-nc#T{
-Number of cylinders, in this case 1658.
-T}
-rm#T{
-Rotational speed of the disk, by default 3600.  This is not absolutely
-essential.
-T}
-b\f(BIx#T{
-The size of ufs file system blocks in partition \fIx\fP, where \fIx\fP\| is a partition
-letter from \f(CWa\fP to \f(CWh\fP.  See the discussion of partitions in
-\*[chconcepts], page
-.Sref \*[disk-partitions] ,
-for more information.
-T}
-o\f(BIx#T{
-Offset (starting sector) of partition \fIx\fP, where \fIx\fP\| is a partition
-letter from \f(CWa\fP to \f(CWh\fP.  See the discussion of partitions in
-\*[chconcepts], page
-.Sref \*[disk-partitions] ,
-for more information.
-T}
-p\f(BIx#T{
-Size in sectors of partition \fIx\fP\|.
-T}
-b\f(BIx#T{
-The size of ufs file system blocks in partition \fIx\fP.
-T}
-f\f(BIx#T{
-The size of ufs file system fragments in partition \fIx\fP.
-T}
-t\f(BIx#T{
-The type of the partition.  This can be \f(CW4.2BSD\fP (for ufs; the name is historical)
-or \f(CWswap\fP for a swap partition.
-T}
-.TE
-.sp 1.5v
-.X "newfs command"
-.X "command, newfs"
-We won't look at the block and fragment sizes in this discussion.  See the man
-page for \fInewfs\fP\|
-on page
-.Sref \*[manpage-newfs] \&
-for further details.
-.P
-There's no definition in \fI/etc/disktab\fP\| for our CDC 94161-9 disk, of
-course, so we'll have to write one.  We need the following information on the
-disk geometry, all of which we can find in the printout from \fIfdisk\fP\|:
-.Ls B
-.LI
-The number of tracks or heads (\f(CWnt\fP), 9.
-.LI
-The number of cylinders (\f(CWnc\fP).  Well, that should be 967, but don't
-forget that we're looking at the slice, not the disk, and our slice only has
-651 cylinders, so that's what we say.
-.LI
-The number of sectors per track (\f(CWns\fP), 35.
-.LI
-The total number of sectors in the partition.  Calculate the number from the
-formula \fIcylinders\fP\| \(mu \fIheads\fP\| \(mu \fIsectors\fP, even if you are
-using the whole disk: the output from \fIdmesg\fP\| or \fIscsiformat\fP\| is not
-correct here.
-.Le
-OK, let's roll up our sleeves.  The swap partition comes directly after the
-bootstrap and the disk label, each of which take up 1 sector, so the swap
-partition starts at offset 2.  It's 20 MB (20,971,520 bytes or 40,960 sectors),
-but it would be nice to have it end on a cylinder boundary, so we'll divide by
-the number of sectors per cylinder.  40,960 / 315 = 130.031746 cylinders, so
-we'll call it 130 cylinders or 40,950 sectors.  Since we don't start on a
-cylinder boundary (the bootstrap and disk label come first), we subtract their
-length (2) and end up with 40,948 sectors, so the definitions for swap
-(partition \f(CWb\fP) are: start (\f(CWob\fP) is 2, size (\f(CWpb\fP) is 40948,
-and type (\f(CWtb\fP) is \f(CWswap\fP.
-.P
-Next we look at the \fI/home\fP\| file system.  It starts immediately after the
-swap partition (offset 40950), and takes up the rest of the space on the
-partition, so the size is 205065 (the length of the partition) - 40950 (the
-length of the bootstrap, disk label, and swap space) = 164115 sectors.  The type
-(\f(CWtb\fP) is \f(CW4.2BSD\fP.
-.P
-Finally, we define partition \f(CWc\fP.  That's easy: the start (\f(CWoc\fP) is
-the 0, and the size (\f(CWpc\fP) is the size of the FreeBSD partition, 205065,
-and the type isn't defined, so we don't have a \f(CWtd\fP parameter.
-.P
-Putting all this together, we get:
+.Fn second-disk-freebsd-slice
+.H3 "Labelling the disk"
+.Pn disklabel
+The program that writes the disk label is used to be called
+.Command disklabel .
+As FreeBSD migrated to multiple platforms, this proved to be too generic: many
+hardware platform have their own disk label formats.  For example, FreeBSD on
+SPARC64 uses the Sun standard labels.  On platforms which use the old BSD
+labels, such as the PC, the name was changed to
+.Command bsdlabel .
+On SPARC64 it is called
+.Command sunlabel .
+On each platform, the appropriate file is linked to the name
+.Command disklabel ,
+but some of the options have changed.  In addition, the output format now
+normally ignores a number of historical relics.  It's not as warty as
+.Command fdisk ,
+but it can still give you a run for your money.  You can usually ignore most of
+the complexity, though.  You can normally create a disk label with the single
+command:
+.Dx
+# \f(CBbsdlabel -w /dev/da1s2 auto\fP
+.De
+This creates the label with a single partition, \f(CWc\fP.  You can look at the
+label with
+.Command bsdlabel
+without options:
 .Dx
-cdc94161|CDC 94161-9: \e
-	:ty=winchester:dt=SCSI:se#512:nt#9:ns#35:nc#651:rm#3600:\e
-	:ob#2:pb#40948:tb=swap:\e
-	:oc#0:pc#205065:\e
-	:oh#40950:ph#164115:tb=4.2BSD:
-.De
-Finally, we can label the disk:
-.Dx
-# \f(CBdisklabel -w -r /dev/da1c cdc94161\fP
-.De
-When you do this, expect a kernel message (in high-intensity display) saying
-``\fBCannot find disk label\fP''.  Since there isn't any label, it can't be
-found.  This is another harmless chicken and egg problem.
-.H4 "Disk prototype file"
-.X "disk prototype file"
-.X "file, disk prototype"
-Alternatively, you can create a \fIdisk prototype file\fP\| just for this disk.
-This has the advantage that most of the work is done for you.  Start by
-entering:
-.Dx
-# \f(CBdisklabel /dev/rda1 >diskproto\fP	\fIwrite info to file diskproto\fP\|
-Warning, revolutions/minute 0
-boot block size 0
-super block size 0
-# \f(CBcat diskproto\fP					\fIlook at what we got\fP\|
-# /dev/rda1:
-type: unknown
-disk: 
-label: 
-flags:
-bytes/sector: 512
-sectors/track: 35
-tracks/cylinder: 9
-sectors/cylinder: 315
-cylinders: 967
-sectors/unit: 304605
-rpm: 0
-interleave: 0
-trackskew: 0
-cylinderskew: 0
-headswitch: 0           # milliseconds
-track-to-track seek: 0  # milliseconds
-drivedata: 0 
-
-3 partitions:
+# \f(CBbsdlabel /dev/da1s2\fP
+# /dev/da0s2:
+8 partitions:
 #        size   offset    fstype   [fsize bsize bps/cpg]
-  c:   304605        0    unused        0     0         # (Cyl.    0 - 966)
+  c:  6295133        0    unused        0     0         # "raw" part, don't edit
 .De
-We have to change a number of things in this file:
-.Ls B
-.LI
-The values for \f(CWinterleave\fP (the number of physical sectors between
-logical sectors; don't worry if you don't understand this) and \f(CWprm\fP (the
-number of rotations of the disk platter per minute) are both 0, which is
-invalid.  FreeBSD doesn't use these values, but it still refuses to label the
-disk unless you enter some plausible value.  We set \f(CWinterleave\fP to 1 and
-\f(CWrpm\fP to 3600, which used to be a standard value for disks.
-.LI
-In addition, although our partition table says that the FreeBSD slice only has
-651 cylinders, the value here shows the complete disk.  We need to change this
-value to 651.
-.LI
-The \f(CWtype\fP field says \f(CWunknown\fP.  We change it to \f(CWSCSI\fP.
-.LI
-.X "disklabel command"
-.X "command, disklabel"
-For documentation purposes, we set the \f(CWdisk\fP field to \f(CWcdc94161\fP,
-and the \f(CWlabel\fP field to \f(CWFreeBSD\fP.  \fIdisklabel\fP\| doesn't care
-what's in these fields, but it copies them to disk.
-.LI
-In addition, we need to add the definitions of the file system layout.  We'll
-look at that in the rest of this section.
-.Le
-The last part of the prototype file describes the partitions.  In this case, we
-have three lines: the number of partitions, a comment describing the format, and
-a definition of the \f(CWc\fP partition.  The disk prototype file here ignores
-the partition table completely: it claims that partition \f(CWc\fP takes up the
-whole disk.  We need to fix that, and we need to add information about slices
-\f(CWb\fP and \f(CWh\fP.
-.P
-Since we are using partition \f(CWh\fP, we need to change the information \f(CW3
-partitions\fP at the bottom of the file to \f(CW8 partitions\fP so that
-\fIdisklabel\fP\| will be able to create partition \f(CWh\fP.
-.P
-We'll use the same sizes as in the previous example: We'll put the swap
-partition first.  Remembering that we specify our offsets relative to the start
-of the FreeBSD slice, so the swap partition has offset 2, immediately after the
-boot sector and the disk label.  It's 20 MB (20,971,520 bytes or 40,960
-sectors), but want it to finish at the end of a cylinder, so we divide by the
-number of sectors per cylinder.  40,960 / 315 = 130.031746 cylinders, so we'll
-call it 130 cylinders, which corresponds to 40,950 sectors.  Since we don't
-start on a cylinder boundary (the bootstrap and disk label come first), we
-subtract their length (2) and end up with 40,948 sectors, so the definitions for
-swap (partition \f(CWb\fP) are: size is 40948, offset is 2, and type is
-\f(CWswap\fP.
-.P
-Next we look at the \fI/home\fP\| file system.  It starts immediately after the
-swap partition (sector 40950 relative to the beginning of the slice), and takes
-up the rest of the space on the partition, so the size is 205065 (the length of
-the partition) - 40950 (the length of the swap space) = 164115 sectors.
-Accordingly, the definitions for \fI/home\fP\| are: size 164430, offset 49050,
-and \fIfstype\fP \f(CW4.2BSD\fP.
-.P
-Finally, we define partition \f(CWc\fP.  That's easy: the start is 0, and the
-size is the size of the FreeBSD partition, 205380.  We leave \fIfstype\fP as
-\f(CWunused\fP.
-.P
-With an editor, we make these changes to \fIdiskproto\fP.  The result looks
-like:
+At this point, the only partition you have is the ``whole disk'' partition
+\f(CWc\fP.  You still need to partitions \f(CWb\fP and \f(CWh\fP and specify
+their location and size.  Do this with \fIbsdlabel -e\fP, which starts an
+editor with the output you see above.  Simply add additional partitions:
 .Dx
-# /dev/rda1c:
-type: SCSI
-disk: cdc94161
-label: FreeBSD
-flags:
-bytes/sector: 512
-sectors/track: 35
-tracks/cylinder: 9
-sectors/cylinder: 315
-cylinders: 651
-sectors/unit: 205065
-rpm: 3600
-interleave: 1
-trackskew: 0
-cylinderskew: 0
-headswitch: 0           # milliseconds
-track-to-track seek: 0  # milliseconds
-drivedata: 0 
-
-8 partitions:
-#        size   offset    fstype   [fsize bsize bps/cpg]
-  b:    40948        2      swap                        # (Cyl.    0*- 129*)
-  c:   205065        0    unused        0     0         # (Cyl.    0 - 650)
-  h:   164115    40950    unused        0     0         # (Cyl.  130 - 650)
-.De
-Finally, we label the disk:
-.Dx
-# \f(CBdisklabel -R -r da1 diskproto\fP
-.De
-.sp -1v
-.H4 "Checking the results"
-Whichever way we label the disk, it's a good idea to check that it really did
-the job.  Along with some strange error messages, \fIdisklabel\fP\| occasionally
-forgets to tell you that it didn't do anything\(emfor example, if the partition
-table was defective.  We can list the label with \fIdisklabel -r\fP\|:
-.Dx
-# \f(CBdisklabel -r da1\fP
-# /dev/rda1c:
-type: SCSI
-disk: cdc94161
-label: FreeBSD
-flags:
-bytes/sector: 512
-sectors/track: 35
-tracks/cylinder: 9
-sectors/cylinder: 315
-cylinders: 651
-sectors/unit: 205065
-rpm: 3600
-interleave: 1
-trackskew: 0
-cylinderskew: 0
-headswitch: 0           # milliseconds
-track-to-track seek: 0  # milliseconds
-drivedata: 0 
-
 8 partitions:
 #        size   offset    fstype   [fsize bsize bps/cpg]
-  b:    40948        2      swap                        # (Cyl.    0*- 129*)
-  c:   205065        0    unused        0     0         # (Cyl.    0 - 650)
-  h:   164115    40950    unused        0     0         # (Cyl.  130 - 650)
-.De
-.sp -1v
-.H3 "Things that can go wrong"
-To get \fIdisklabel\fP\| to do what you want, you really must stick to every
-tiny detail here.  If you don't, you can expect a number of strange error
-messages.  Here are some that you could encounter.
+  c:  6295133        0    unused        0     0         # "raw" part, don't edit
+.ft CB
+  b:  1048576        0    swap          0     0
+  h:  5246557  1048576    unused        0     0
+.ft
+.De
+You don't need to maintain any particular order, and you don't need to specify
+that partition \f(CWh\fP will be a file system.  In the next step,
+.Command newfs
+does that for you automatically.
+.\" Because of the list at the beginning of the section
+.br
+.ne 12v
+.H3 "Problems running bsdlabel"
+Using the old
+.Command disklabel
+program used to be like walking through a minefield.  Things have got a lot
+better, but it's possible that some problems are still hiding.  Here are some of
+the problem that have been encountered in the past, along with some suggestions
+about what to do if you experience them:
 .Ls B
 .LI
+When writing a label (\f(CW-w\fP option), you may find:
+.Dx
+# \f(CBbsdlabel -w da1s2\fP
+bsdlabel: /dev/da1s2c: Undefined error: 0
+.De
+This message may be the result of the kernel having out-of-date information
+about the slice in memory.  If this is the case, a reboot may help.
+.LI
 \f(CWNo disk label on disk\fP is straightforward enough.  You tried to use
-\fIdisklabel\fP\| to look at the label before you had a label to look at.  This
-happens when you use \fI/dev/da1\fP\| instead of \fI/dev/rda1\fP.
+.Command bsdlabel
+to look at the label before you had a label to look at.
 .LI
 \f(CWLabel magic number or checksum is wrong!\fP tells you that
-\fIdisklabel\fP\| thinks it has a label, but it's invalid.  This could be the
-result of an incorrect previous attempt to label the disk.  It can be difficult
-to get rid of an incorrect label.  The best thing to do is to repartition the
-disk with the label in a different position, and then copy \fI/dev/zero\fP\| to
-where the label used to be.  Then you can repartition again the way you want to
-have it.
+.Command bsdlabel
+thinks it has a label, but it's invalid.  This could be the result of an
+incorrect previous attempt to label the disk.  It can be difficult to get rid of
+an incorrect label.  The best thing to do is to repartition the disk with the
+label in a different position, and then copy
+.Device zero
+to where the label used to be.  Then you can repartition again the way you want
+to have it.
 .LI
 \f(CWOpen partition would move or shrink\fP probably means that you have
 specified incorrect values in your slice definitions.  Check particularly that
@@ -1090,142 +916,151 @@
 invalid with a valid disk label.  FreeBSD write protects the disk label, which
 is why you get this message.
 .LI
-When labelling via \fI/etc/disktab\fP, you might get the message \f(CWcdc94161:
-unknown disk type\fP.  This could mean that you forgot to terminate the last
-line in the file\(emadd a blank line after just to be sure.
-.LI
-In addition, you might get kernel messages like \f(CWfixlabel: raw partition
-size > slice size\fP or \f(CWfixlabel: raw partitions offset != slice offset\fP,
-whose meanings should be obvious.
+In addition, you might get kernel messages like:
+.Dx
+fixlabel: raw partition size > slice size
+\fIor\fP\/
+fixlabel: raw partitions offset != slice offset
+.De
+The meanings of these messages should be obvious.
 .Le
-.H3 "Creating the file systems"
+.SPUP
+.H2 "Creating file systems"
 .X "creating file systems"
-.X "file systems, creating"
-Now that we have a valid label, the next thing we need to do is to create the
-file systems.  In this case, there's only one file system, on \fI/dev/da1h\fP\|.
+.X "file system, creating"
+Once we have a valid label, we need to create the file systems.  In this case,
+there's only one file system, on
+.Device da1s2h .
 Mercifully, this is easier:
 .Dx
-# \f(CBnewfs /dev/rda1h\fP
-Warning: 3822 sector(s) in last cylinder unallocated
-/dev/rda1h:     164114 sectors in 41 cylinders of 1 tracks, 4096 sectors
-        80.1MB in 3 cyl groups (16 c/g, 32.00MB/g, 7680 i/g)
-super-block backups (for fsck -b #) at:
- 32, 65568, 131104,
-.De
-Well, that warning doesn't look nice.  It looks as if we've lost nearly 2 MB of
-space on a very small disk.  In fact, this message is the wrong way round: there
-are 3822 sectors not available for the last cylinder group, in other words, it
-only has 274 sectors.  This isn't really a problem, since they can be used
-anyway.  If you want to be tidy, you can can go back and change the division
-between swap and file system if we want: we \fIsubtract\fP\| 274 sectors from
-partition \f(CWh\fP, which gives us the new \fIdisktab\fP\| entry:
-.Dx
-cdc94161|CDC 94161-9: \e
-	:ty=winchester:dt=SCSI:se#512:nt#9:ns#35:nc#651:rm#3600:\e
-	:ob#2:pb#41222:tb=swap:\e
-	:oc#0:pc#205065:\e
-	:oh#41224:ph#163841:tb=4.2BSD:
-.De
-or the diskproto entry
-.Dx
-#        size   offset    fstype   [fsize bsize bps/cpg]
-  b:    41222        2      swap                        # (Cyl.    0*- 130*)
-  c:   205065        0    unused        0     0         # (Cyl.    0 - 650)
-  h:   163841    41224    unused        0     0         # (Cyl.  130*- 650*)
-.De
-You can then go back and re-label the disk.  This time, you see:
-.Dx
-# \f(CBnewfs /dev/rda1h\fP
-/dev/rda1h:     163840 sectors in 40 cylinders of 1 tracks, 4096 sectors
-        80.0MB in 3 cyl groups (16 c/g, 32.00MB/g, 7680 i/g)
+# \f(CBnewfs -U /dev/da1s2h\fP
+/dev/vinum/da1s2h: 2561.8MB (5246556 sectors) block size 16384, fragment size 2048
+        using 14 cylinder groups of 183.77MB, 11761 blks, 23552 inodes.
+        with soft updates
 super-block backups (for fsck -b #) at:
- 32, 65568, 131104,
+ 160, 376512, 752864, 1129216, 1505568, 1881920, 2258272, 2634624, 3010976, 3387328,
+ 3763680, 4140032, 4516384, 4892736
 .De
-As you can see, the partition has become smaller, but at least the error message
-is gone.
-.H3 "Editing disk labels"
-.X "editing disk labels"
-.X "disk, editing labels"
-If you already have a disk label, and you just want to change it, as in the
-example in the previous section, you have an alternative method: you can start
-\fIdisklabel\fP\| in \fIedit\fP\| mode by entering
-.Dx
-# \f(CBdisklabel -e da1\fP
-.De
-In edit mode, \fIdisklabel\fP\| creates a diskproto entry and edits it with your
-favourite editor (if you have set the environment variable \f(CWEDITOR\fP) or
-\fIvi\fP\| otherwise.  When you leave the editor, it writes the label back to
-the disk.  If you use this method, be sure to remove your \fIdiskproto\fP\|
-file, since it will be out of date.
+The \f(CW-U\fP flag tells
+.Command newfs
+to enable soft updates, which we looked at on page
+.Sref \*[soft-updates] .
+.br
+.ne 10v
 .H3 "Mounting the file systems"
-.X "mounting file systems"
-.X "file systems, mounting"
+.X "mounting, file systems"
+.X "file system, mounting"
 Finally the job is done.  Well, almost.  You still need to mount the file
 system, and to tell the system that it has more swap.  But that's not much of a
 problem:
 .Dx
-# \f(CBmkdir /home\fP		\fImake sure we have a directory to mount on\fP\|
-# \f(CBmount /dev/da1h /home\fP \fIand mount it\fP\|
+# \f(CBmkdir /newhome\fP                                \fImake sure we have a directory to mount on\fP\/
+# \f(CBmount /dev/da1s2h /newhome\fP                    \fIand mount it\fP\/
 .Pn swapon
-# \f(CBswapon /dev/da1b\fP
-# \f(CBdf\fP				\fIshow free capacity and mounted file systems\fP\|
+# \f(CBswapon /dev/da1s2b\fP
+# \f(CBdf\fP                                            \fIshow free capacity and mounted file systems\fP\/
 Filesystem    1024-blocks     Used    Avail Capacity  Mounted on
-/dev/wd0a           19966    17426      944    95%    /
-/dev/wd0s1e       1162062   955758   113340    89%    /usr
+/dev/ad0s1a         19966    17426      944    95%    /
+/dev/ad0s1e       1162062   955758   113340    89%    /usr
 procfs                  4        4        0   100%    /proc
 presto:/            15823     6734     8297    45%    /presto/root
 presto:/usr        912271   824927    41730    95%    /presto/usr
 presto:/home      1905583  1193721   521303    70%    /presto/home
 presto:/S         4065286  3339635   563039    86%    /S
-/dev/da1h           79270        1    72928     0%    /home
+/dev/da1s2h       2540316        2  2337090     0%    /newhome
+# \f(CBpstat -s\fP                                      \fIshow swap usage\fP\/
+Device          1K-blocks     Used    Avail Capacity  Type
+/dev/ad0s4b       524160        0   524160     0%    Interleaved
+/dev/da1s2b       524160        0   524160     0%    Interleaved
+Total            1048320        0  1048320     0%
+.De
+This looks fine, but when you reboot the system,
+.Directory /newhome
+and the additional swap will be gone.  To ensure that they get mounted after
+booting, you need to add the following lines to
+.File /etc/fstab \/:
+.Dx
+/dev/da1s2b             none            swap    sw      0       0
+/dev/da1s2h             /newhome        ufs     rw      0       0
+.De
+.SPUP
+.H2 "Moving file systems"
+.Pn move-fs
+Very frequently, you add a new disk to a system because existing disks have run
+out of space.  Let's consider the disk we have just added and assume that
+currently the files in
+.Directory /home
+are physically located on the
+.Directory /usr
+file system, and that
+.Directory /home
+is a symbolic link to
+.Directory /usr/home .
+We want to move them to the new file system and then rename it to
+.Directory /home .
+Here's what to do:
+.Ls B
+.LI
+Copy the files:
+.Dx
+# \f(CBcd /home\fP
+# \f(CBtar cf - . | (cd /newhome; tar xvf - 2>/var/tmp/tarerrors)\fP
 .De
-.X "/etc/fstab"
-This looks fine, but when you reboot the system, \fI/home\fP\| will be gone.  To ensure
-that it gets mounted every time, you need to add the following line to
-\fI/etc/fstab\fP\|:
-.Dx
-/dev/da1h			/home		ufs	rw   0 0
-.De
-.X "mount command"
-.X "command, mount"
-This will cause \fIda1h\fP\| to be mounted at system startup time\(emsee the
-description of \fImount\fP\|
-on page
-.Sref \*[mount] ,
-and the man page on page
-.Sref \*[manpage-mount] .
-.\" .H3 "No geometry information"
-.\" If you can't calculate the number of heads.... XXX
-.\" Bruce:
-.\" 
-.\" I've had a look at sys/disklabel.h, and
-.\" from what I gather, it can be either in sector 0 or 1 of the slice,
-.\" depending on whether we have a bootstrap or not.  I've had a look in
-.\" sys/ufs/ufs/ufs_disksubr.c and find where it gets looked at, to find
-.\" how the system decides, and also found a comment with which I can
-.\" agree:
-.\" 
-.\" 	/*
-.\" 	 * We read the label first to see if it's there,
-.\" 	 * in which case we will put ours at the same offset into the block..
-.\" 	 * (I think this is stupid [Julian])
-.\" 	 * Note that you can't write a label out over a corrupted label!
-.\" 	 * (also stupid.. how do you write the first one? by raw writes?)
-.\" 	 */
-.\" 
-.\" If I understand the code correctly, it goes through the whole intial
-.\" sector 4 bytes at a time until it finds a couple of magic numbers, and
-.\" that the disk label *and* the bootstrap must fit in the first sector.
-.\" Correct?
-.\" 
+This writes any error messages to the file
+.File -n /var/tmp/tarerrors .
+If you don't do this, any errors will get lost.
+.LI
+\f(BICheck /var/tmp/tarerrors and make sure that the files really made it to the
+right place!\fP\/
+.LI
+.ne 3v
+Remove the old files:
+.Dx
+# \f(CBrm -rf /usr/home\fP
+.De
+.SPUP
+.LI
+In this case,
+.Directory /home
+was a symbolic link, so we need to remove it and create a directory called
+.Directory /home \/:
+.Dx
+# \f(CBrm /home\fP
+# \f(CBmkdir /home\fP
+.De
+You don't need to do this if
+.Directory /home
+was already a directory (for example, if you're moving a complete file system).
+.LI
+Modify
+.File /etc/fstab
+to contain a line like:
+.Dx
+/dev/da1s2h             /home           ufs     rw      0       0
+.De
+.SPUP
+.LI
+Unmount the
+.Directory /newhome
+directory and mount it as
+.Directory /home \/:
+.Dx
+# \f(CBumount /newhome\fP
+# \f(CBmount /home\fP
+.De
+.Le
+.\" XXX
+.sp -2v
 .H2 "Recovering from disk data errors"
+.Pn disk-error-recovery
 .X "recovering from disk data errors"
 .X "disk, recovering from data errors"
-Modern hard disks are a miracle in evolution.  Today you can buy a 16 GB hard
-disk for well under $500, and it will fit in your shirt pocket.  30 years ago, a
-typical disk was the size of a washing machine and stored 20 MB.  You would need
-800 of them to store 16 GB.
+Modern hard disks are a miracle in evolution.  Today you can buy a 200 GB hard
+disk for under $200, and it will fit in your shirt pocket.  Thirty years ago, a
+typical disk drive was the size of a washing machine and stored 20 MB.  You
+would need 10,000 of them to store 200 GB.
 .P
+.ne 3v
 At the same time, reliability has gone up, but disks are still relatively
 unreliable devices.  You can achieve maximum reliability by keeping them cool,
 but sooner or later you are going to run into some kind of problem.  One kind is
@@ -1234,1255 +1069,38 @@
 .P
 Modern disks make provisions for recovering from such errors by allocating an
 alternate sector for the data.  IDE drives do this automatically, but with SCSI
-drives you have the option of enabling or disabling reallocation.  Usually it is
-turned on when you buy them, but occasionally it is not.  When installing a new
-disk, you should check that the parameters \fIARRE\fP\| (\fIAuto Read
-Reallocation Enable\fP\|) and \fIAWRE\fP\| (\fIAuto Write Reallocation
-Enable\fP\|) are turned on.  For example, to check and set the values for disk
-\fIda1\fP, you would enter:
+drives you have the option of enabling or disabling reallocation.  Usually
+reallocation is enabled when you buy the disk, but occasionally it is not.  When
+installing a new disk, you should check that the parameters \fIARRE\fP\/
+(\fIAuto Read Reallocation Enable\fP\/) and \fIAWRE\fP\/ (\fIAuto Write
+Reallocation Enable\fP\/) are turned on.  For example, to check and set the
+values for disk
+.Device -n da1 ,
+you would enter:
 .Dx
-# \f(CBscsi -f /dev/rda1c -m 1 -e -P 3\fP
+# \f(CBcamcontrol modepage da1 -m 1 -e\fP
 .De
 This command will start up your favourite editor (either the one specified in
-the \f(CWEDITOR\fP environment variable, or \fIvi\fP\| by default) with the
-following data:
+the \f(CWEDITOR\fP environment variable, or
+.Command vi
+by default) with the following data:
 .Dx
 AWRE (Auto Write Reallocation Enbld):  0
-ARRE (Auto Read Reallocation Enbld):  1
-TB (Transfer Block):  0
-PER (Post Error):  0
+ARRE (Auto Read Reallocation Enbld):  0
+TB (Transfer Block):  1
+EER (Enable Early Recovery):  0
+PER (Post Error):  1
 DTE (Disable Transfer on Error):  0
 DCR (Disable Correction):  0
-Read Retry Count:  1
-Correction Span:  0
-Write Retry Count:  1
+Read Retry Count:  41
+Write Retry Count:  24
 .De
 The values for \f(CWAWRE\fP and \f(CWARRE\fP should both be 1.  If they aren't,
 as in this case, where \f(CWAWRE\fP is 0, change the data with the editor, write
-it back, and exit.  The \fIscsi\fP\| program will write the data back to the
-disk and enable the option.
-.H2 "Virtual disks: the Vinum Volume Manager"
-.Pn vinum
-No matter what disks you have, there will always be limitations:
-.Ls B
-.LI
-They can be too small.
-.LI
-They can be too slow.
-.LI
-They can be too unreliable. 
-.Le
-.X "Vinum"
-.X "Volume Manager"
-\fIVinum\fP\| is a so-called \fIVolume Manager\fP, a virtual disk driver that
-addresses these three problems.  Let's look at them in more detail.  Various
-solutions to these problems have been proposed and implemented:
-.H3 "Disks are too small"
-Disks are getting bigger, but so are data storage requirements.  Often you'll
-find you want a file system that is bigger than the disks you have available.
-Admittedly, this problem is not as acute as it was ten years ago, but it still
-exists.  Some systems have solve this by creating an abstract device which
-stores its data on a number of disks.
-.H3 "Access bottlenecks"
-Modern systems frequently need to access data in a highly concurrent manner.
-For example, large FTP or HTTP servers can maintain thousands of concurrent
-sessions and have multiple 100 Mbit/s connections to the outside world, well
-beyond the sustained transfer rate of most disks.
-.P
-Current disk drives can transfer data sequentially at up to 30 MB/s, but this
-value is of little importance in an environment where many independent processes
-access a drive, where they may achieve only a fraction of these values.  In such
-cases it's more interesting to view the problem from the viewpoint of the disk
-subsystem: the important parameter is the load that a transfer places on the
-subsystem, in other words the time for which a transfer occupies the drives
-involved in the transfer.
-.P
-In any disk transfer, the drive must first position the heads, wait for the
-first sector to pass under the read head, and then perform the transfer.  These
-actions can be considered to be atomic: it doesn't make any sense to interrupt
-them.
-.P
-.Pn latency
-Consider a typical transfer of about 10 kB: the current generation of
-high-performance disks can position the heads in an average of 6 ms.  The
-fastest drives spin at 10,000 rpm, so the average rotational latency (half a
-revolution) is 3 ms.  At 30 MB/s, the transfer itself takes about 350 s, almost
-nothing compared to the positioning time.  In such a case, the effective
-transfer rate drops to a little over 1 MB/s and is clearly highly dependent on
-the transfer size.
-.P
-The traditional and obvious solution to this bottleneck is ``more spindles'':
-rather than using one large disk, it uses several smaller disks with the same
-aggregate storage space.  Each disk is capable of positioning and transferring
-independently, so the effective throughput increases by a factor close to the
-number of disks used.
-.P
-The exact throughput improvement is, of course, smaller than the number of disks
-involved: although each drive is capable of transferring in parallel, there is
-no way to ensure that the requests are evenly distributed across the drives.
-Inevitably the load on one drive will be higher than on another.
-.P
-.X "concatenation, Vinum"
-.X "Vinum, concatenation"
-The evenness of the load on the disks is strongly dependent on the way the data
-is shared across the drives.  In the following discussion, it's convenient to
-think of the disk storage as a large number of data sectors which are
-addressable by number, rather like the pages in a book.  The most obvious method
-is to divide the virtual disk into groups of consecutive sectors the size of the
-individual physical disks and store them in this manner, rather like taking a
-large book and tearing it into smaller sections.  This method is called
-\fIconcatenation\fP\| and has the advantage that the disks do not need to have
-any specific size relationships.  It works well when the access to the virtual
-disk is spread evenly about its address space.  When access is concentrated on a
-smaller area, the improvement is less marked.  Figure \*[concat] illustrates the
-sequence in which storage units are allocated in a concatenated organization.
-.PS
-h = .3i
-dh = .02i
-dw = .8i
-down
-[
-        [
-                boxht = h; boxwid = dw
-.\" 
-.\"     ORIG:   box invis "\f(CW0\fP"
-.\"             box invis "\f(CW1\fP"
-.\"             box invis "\f(CW2\fP"
-.\"             box invis "\f(CW3\fP"
-.\"             box invis "\f(CW4\fP"
-.\"             box invis "\f(CW5\fP"
-
-.\"       A:    box dotted at ORIG.e+(.4,0) ht h "\f(CW0\fP"
-move right 1i; down
-          A:    box dotted ht h "\f(CW0\fP"
-          B:    box dotted ht h "\f(CW1\fP"
-          C:    box dotted ht h "\f(CW2\fP"
-          D:    box dotted ht h "\f(CW3\fP"
-          E:    box dotted ht h "\f(CW4\fP"
-          F:    box dotted ht h "\f(CW5\fP"
-                box ht h * 6 at C.s
-
-          A1:   box dotted at A+(dw*1.6,0) ht h "\f(CW6\fP"
-          B1:    box dotted ht h "\f(CW7\fP"
-          C1:    box dotted ht h "\f(CW8\fP"
-          D1:    box dotted ht h "\f(CW9\fP"
-                box ht h * 4 at C1.n
-
-          A2:   box dotted at A1+(dw*1.6,0) "\f(CW10\fP"
-          F2:    box dotted ht h "\f(CW11\fP"
-                box ht h * 2 at A2.s
-
-          A3:   box dotted at A2+(dw*1.6,0) ht h "\f(CW12\fP"
-          B3:    box dotted ht h "\f(CW13\fP"
-          C3:    box dotted ht h "\f(CW14\fP"
-          D3:    box dotted ht h "\f(CW15\fP"
-          E3:    box dotted ht h "\f(CW16\fP"
-          F3:    box dotted ht h "\f(CW17\fP"
-                box ht h * 6 at C3.s
-
-.\" "Offset" at ORIG.n+(0,.2i)
-"Disk 1" at A.n+(0,.2i)
-"Disk 2" at A1.n+(0,.2i)
-"Disk 3" at A2.n+(0,.2i)
-"Disk 4" at A3.n+(0,.2i)
-
-
-.\" arrow from A.e+(-.07,-.04) to B.e+(-.07,.02)
-.\" arrow from B.e+(-.07,-.04) to C.e+(-.07,.02)
-.\" arrow from C.e+(-.07,-.04) to D.e+(-.07,.02)
-.\" arrow from D.e+(-.07,-.04) to E.e+(-.07,.02)
-.\" arrow from E.e+(-.07,-.04) to F.e+(-.07,.02)
-
-.\" line from F.e right .1i; arc radius .1i; line  to A1.w-(.3i,.1i); arc cw radius .1i; arrow to A1.w
-
-.\" arrow from A1.e+(-.07,-.04) to B1.e+(-.07,.02)
-.\" arrow from B1.e+(-.07,-.04) to C1.e+(-.07,.02)
-.\" arrow from C1.e+(-.07,-.04) to D1.e+(-.07,.02)
-
-.\" line from D1.e right .1i; arc radius .1i; line  to A2.w-(.3i,.1i); arc cw radius .1i; arrow to A2.w
-
-.\" arrow from A2.e+(-.07,-.04) to F2.e+(-.07,.02)
-
-.\" line from F2.e right .1i; arc radius .1i; line  to A3.w-(.3i,.1i); arc cw radius .1i; arrow to A3.w
-
-.\" arrow from A3.e+(-.07,-.04) to B3.e+(-.07,.02)
-.\" arrow from B3.e+(-.07,-.04) to C3.e+(-.07,.02)
-.\" arrow from C3.e+(-.07,-.04) to D3.e+(-.07,.02)
-.\" arrow from D3.e+(-.07,-.04) to E3.e+(-.07,.02)
-.\" arrow from E3.e+(-.07,-.04) to F3.e+(-.07,.02)
-               ]
-]
-.PE
-.ce
-.Figure-heading "Concatenated organization"
-.Tn concat
-.P
-.X "striping, Vinum"
-.X "Vinum, striping"
-An alternative mapping is to divide the address space into smaller, equal-sized
-components and store them sequentially on different devices.  For example, the
-first 256 sectors may be stored on the first disk, the next 256 sectors on the
-next disk and so on.  After filling the last disk, the process repeats until the
-disks are full.  This mapping is called \fIstriping\fP or RAID-0,\*F
-.FS
-.X "RAID"
-.X "Redundant Array of Inexpensive Disks"
-\fIRAID\fP\| stands for \fIRedundant Array of Inexpensive Disks\fP\| and offers
-various forms of fault tolerance.
-.FE
-though the latter term is somewhat misleading: it provides no redundancy.
-Striping requires somewhat more effort to locate the data, and it can cause
-additional I/O load where a transfer is spread over multiple disks, but it can
-also provide a more constant load across the disks.  Figure \*[striped]
-illustrates the sequence in which storage units are allocated in a striped
-organization.
-.PS
-h = .3i
-dh = .02i
-dw = .8i
-down
-[
-        [
-                boxht = h; boxwid = dw
-
-.\"     ORIG:   box invis "\f(CW0\fP"
-.\"             box invis "\f(CW1\fP"
-.\"             box invis "\f(CW2\fP"
-.\"             box invis "\f(CW3\fP"
-.\"             box invis "\f(CW4\fP"
-.\"             box invis "\f(CW5\fP"
-.\" 
-.\"           A:    box at ORIG.e+(.4,0) ht h "\f(CW0\fP"
-move right 1i; down
-          A:    box ht h "\f(CW0\fP"
-          B:    box ht h "\f(CW4\fP"
-          C:    box ht h "\f(CW8\fP"
-          D:    box ht h "\f(CW12\fP"
-          E:    box ht h "\f(CW16\fP"
-          F:    box ht h "\f(CW20\fP"
-
-          A1:   box at A+(dw*1.6,0) ht h "\f(CW1\fP"
-          B1:    box ht h "\f(CW5\fP"
-          C1:    box ht h "\f(CW9\fP"
-          D1:    box ht h "\f(CW13\fP"
-          E1:    box ht h "\f(CW17\fP"
-          F1:    box ht h "\f(CW21\fP"
-
-          A2:   box at A1+(dw*1.6,0) ht h "\f(CW2\fP"
-          B2:    box ht h "\f(CW6\fP"
-          C2:    box ht h "\f(CW10\fP"
-          D2:    box ht h "\f(CW14\fP"
-          E2:    box ht h "\f(CW18\fP"
-          F2:    box ht h "\f(CW22\fP"
-
-          A3:   box at A2+(dw*1.6,0) ht h "\f(CW3\fP"
-          B3:    box ht h "\f(CW7\fP"
-          C3:    box ht h "\f(CW11\fP"
-          D3:    box ht h "\f(CW15\fP"
-          E3:    box ht h "\f(CW19\fP"
-          F3:    box ht h "\f(CW23\fP"
-
-.\" "Offset" at ORIG.n+(0,.2i)
-"Disk 1" at A.n+(0,.2i)
-"Disk 2" at A1.n+(0,.2i)
-"Disk 3" at A2.n+(0,.2i)
-"Disk 4" at A3.n+(0,.2i)
-
-.\" 
-.\"   arrow from A.e to A1.w
-.\"   arrow from B.e to B1.w
-.\"   arrow from C.e to C1.w
-.\"   arrow from D.e to D1.w
-.\"   arrow from E.e to E1.w
-.\"   arrow from F.e to F1.w
-.\" 
-.\"   arrow from A1.e to A2.w
-.\"   arrow from B1.e to B2.w
-.\"   arrow from C1.e to C2.w
-.\"   arrow from D1.e to D2.w
-.\"   arrow from E1.e to E2.w
-.\"   arrow from F1.e to F2.w
-.\" 
-.\"   arrow from A2.e to A3.w
-.\"   arrow from B2.e to B3.w
-.\"   arrow from C2.e to C3.w
-.\"   arrow from D2.e to D3.w
-.\"   arrow from E2.e to E3.w
-.\"   arrow from F2.e to F3.w
-.\" 
-.\"   arrow right .2i from A3.e
-.\"   arrow right .2i from B3.e
-.\"   arrow right .2i from C3.e
-.\"   arrow right .2i from D3.e
-.\"   arrow right .2i from E3.e
-.\"   arrow right .2i from F3.e
-               ]
-]
-.PE
-.Figure-heading "Striped organization"
-.Tn striped
-.H3 "Data integrity"
-The final problem with current disks is that they are unreliable.  Although disk
-drive reliability has increased tremendously over the last few years, they are
-still the most likely core component of a server to fail.  When they do, the
-results can be catastrophic: replacing a failed disk drive and restoring data to
-it can take days.
-.P
-.X "mirroring, Vinum"
-.X "Vinum, mirroring"
-.X "RAID, level 1"
-.X "RAID-1"
-The traditional way to approach this problem has been \fImirroring\fP, keeping
-two copies of the data on different physical hardware.  Since the advent of the
-RAID levels, this technique has also been called \fIRAID level 1\fP\| or
-\fIRAID-1\fP.  Any write to the volume writes to both locations; a read can be
-satisfied from either, so if one drive fails, the data is still available on the
-other drive.
-.P
-Mirroring has two problems:
-.Ls B
-.LI
-The price.  It requires twice as much disk storage as a non-redundant solution.
-.LI
-The performance impact.  Writes must be performed to both drives, so they take
-up twice the bandwidth of a non-mirrored volume.  Reads do not suffer from a
-performance penalty: it even looks as if they are faster.
-.LE
-.ig
-.P
-.X "RAID-5"
-An alternative solution is \fIparity\fP, implemented in the RAID levels 2, 3, 4
-and 5.  Of these, RAID-5 is the most interesting.  As implemented in Vinum, it
-is a variant on a striped organization which dedicates one block of each stripe
-to parity of the other blocks: As implemented by Vinum, a \fIRAID-5\fP\| plex is
-similar to a striped plex, except that it implements RAID-5 by including a
-parity block in each stripe.  As required by RAID-5, the location of this parity
-block changes from one stripe to the next.  The numbers in the data blocks
-indicate the relative block numbers.
-.PS
-h = .3i
-dh = .02i
-dw = .8i
-down
-[
-        [
-                boxht = h; boxwid = dw
-
-.\"     ORIG:   box invis "\f(CW0\fP"
-.\"             box invis "\f(CW1\fP"
-.\"             box invis "\f(CW2\fP"
-.\"             box invis "\f(CW3\fP"
-.\"             box invis "\f(CW4\fP"
-.\"             box invis "\f(CW5\fP"
-.\" 
-.\"
-move right 1i; down
-          A:    box ht h "\f(CW0\fP"
-          B:    box ht h "\f(CW3\fP"
-          C:    box ht h "\f(CW6\fP"
-          D:    box ht h "Parity" filled 0.2
-          E:    box ht h "\f(CW12\fP"
-          F:    box ht h "\f(CW15\fP"
-
-          A1:   box at A+(dw*1.6,0) ht h "\f(CW1\fP"
-          B1:    box ht h "\f(CW4\fP"
-          C1:    box ht h "Parity" filled 0.2
-          D1:    box ht h "\f(CW9\fP"
-          E1:    box ht h "\f(CW13\fP"
-          F1:    box ht h "\f(CW16\fP"
-
-          A2:   box at A1+(dw*1.6,0) ht h "\f(CW2\fP"
-          B2:    box ht h "Parity" filled 0.2
-          C2:    box ht h "\f(CW7\fP"
-          D2:    box ht h "\f(CW10\fP"
-          E2:    box ht h "\f(CW14\fP"
-          F2:    box ht h "Parity" filled 0.2
-
-          A3:   box at A2+(dw*1.6,0) ht h "Parity" filled 0.2
-          B3:    box ht h "\f(CW5\fP"
-          C3:    box ht h "\f(CW8\fP"
-          D3:    box ht h "\f(CW11\fP"
-          E3:    box ht h "Parity" filled 0.2
-          F3:    box ht h "\f(CW17\fP"
-
-.\" "Offset" at ORIG.n+(0,.2i)
-"Disk 1" at A.n+(0,.2i)
-"Disk 2" at A1.n+(0,.2i)
-"Disk 3" at A2.n+(0,.2i)
-"Disk 4" at A3.n+(0,.2i)
-
-.\"   arrow from A.e to A1.w
-.\"   arrow from B.e to B1.w
-.\"   arrow from C.e to C1.w
-.\"   arrow from D.e to D1.w
-.\"   arrow from E.e to E1.w
-.\"   arrow from F.e to F1.w
-.\" 
-.\"   arrow from A1.e to A2.w
-.\"   arrow from B1.e to B2.w
-.\"   arrow from C1.e to C2.w
-.\"   arrow from D1.e to D2.w
-.\"   arrow from E1.e to E2.w
-.\"   arrow from F1.e to F2.w
-.\" 
-.\"   arrow from A2.e to A3.w
-.\"   arrow from B2.e to B3.w
-.\"   arrow from C2.e to C3.w
-.\"   arrow from D2.e to D3.w
-.\"   arrow from E2.e to E3.w
-.\"   arrow from F2.e to F3.w
-.\" 
-.\"   arrow right .2i from A3.e
-.\"   arrow right .2i from B3.e
-.\"   arrow right .2i from C3.e
-.\"   arrow right .2i from D3.e
-.\"   arrow right .2i from E3.e
-.\"   arrow right .2i from F3.e
-               ]
-]
-.PE
-.Figure-heading "RAID-5 organization"
-.P
-Compared to mirroring, RAID-5 has the advantage of requiring significantly less
-storage space.  Read access is similar to that of striped organizations, but
-write access is significantly slower, approximately 25% of the read performance.
-If one drive fails, the array can continue to operate in degraded mode: a read
-from one of the remaining accessible drives continues normally, but a read from
-the failed drive is recalculated from the corresponding block from all the
-remaining drives.
-..
-.H2 "Vinum objects"
-In order to address these problems, Vinum implements a four-level hierarchy of
-objects:
-.Ls B
-.LI
-.X "volume, Vinum"
-.X "Vinum, volume"
-The most visible object is the virtual disk, called a \fIvolume\fP.  Volumes
-have essentially the same properties as a UNIX disk drive, though there are some
-minor differences.  They have no size limitations.
-.LI
-.X "plex, Vinum"
-.X "Vinum, plex"
-Volumes are composed of \fIplexes\fP, each of which represent the total address
-space of a volume.  This level in the hierarchy thus provides redundancy.  Think
-of plexes as individual disks in a mirrored array, each containing the same
-data.
-.LI
-.X "drive, Vinum"
-.X "Vinum, drive"
-.X "subdisk, Vinum"
-.X "Vinum, subdisk"
-Since Vinum exists within the UNIX disk storage framework, it would be possible
-to use UNIX partitions as the building block for multi-disk plexes, but in fact
-this turns out to be too inflexible: UNIX disks can have only a limited number
-of partitions.  Instead, Vinum subdivides a single UNIX partition (the
-\fIdrive\fP\|) into contiguous areas called \fIsubdisks\fP, which it uses as
-building blocks for plexes.
-.LI
-Subdisks reside on Vinum \fIdrives\fP, currently UNIX partitions.  Vinum drives
-can contain any number of subdisks.  With the exception of a small area at the
-beginning of the drive, which is used for storing configuration and state
-information, the entire drive is available for data storage.
-.Le
-The following sections describe the way these objects provide the functionality
-required of Vinum.
-.H3 "Volume size considerations"
-Plexes can include multiple subdisks spread over all drives in the Vinum
-configuration.  As a result, the size of an individual drive does not limit the
-size of a plex, and thus of a volume.
-.H3 "Redundant data storage"
-Vinum 
-..if raid5
-provides both mirroring and RAID-5.  It 
-..endif
-implements mirroring by attaching multiple plexes to a volume.  Each plex is a
-representation of the data in a volume.  A volume may contain between one and
-eight plexes.
-.P
-Although a plex represents the complete data of a volume, it is possible for
-parts of the representation to be physically missing, either by design (by not
-defining a subdisk for parts of the plex) or by accident (as a result of the
-failure of a drive).  As long as at least one plex can provide the data for the
-complete address range of the volume, the volume is fully functional.
-..if raid5
-.P
-From an implementation standpoint, it is not practical to represent a RAID-5
-organization as a collection of plexes.  This issue is discussed below.
-..endif
-.H3 "Performance issues"
-Vinum implements both concatenation and striping at the plex level:
-.Ls B
-.LI
-A \fIconcatenated plex\fP\| uses the address space of each subdisk in turn.
-.LI
-A \fIstriped plex\fP\| stripes the data across each subdisk.  The subdisks must
-all have the same size, and there must be at least two subdisks in order to
-distinguish it from a concatenated plex.
-..if raid5
-.LI
-Like a striped plex, a \fIRAID-5 plex\fP\| stripes the data across each subdisk.
-The subdisks must all have the same size, and there must be at least three
-subdisks, since otherwise mirroring would be more efficient.
-..endif
-.LE
-..if raid5
-.H3 "RAID-5"
-Conceptually, RAID-5 is used for redundancy, but in fact the implementation is a
-kind of striping.  This poses problems for the implementation of Vinum: should
-it be a kind of plex or a kind of volume?  It would have been possible to
-implement it either way, but it proved to be simpler to implement RAID-5 as a
-plex type.  This means that there are two different ways of ensuring data
-redundancy: either have more than one plex in a volume, or have a single RAID-5
-plex.  These methods can be combined.
-..endif
-.H3 "Which plex organization?"
-..if raid5
-Vinum implements only that subset of RAID organizations which make sense in the
-framework of the implementation.  It would have been possible to implement all
-RAID levels, but there was no reason to do so.  Each of the chosen organizations
-has unique advantages:
-..else
-The version of Vinum supplied with FreeBSD \*[Fver] implements two kinds of
-plex:
-..endif
-.Ls B
-.LI
-Concatenated plexes are the most flexible: they can contain any number of
-subdisks, and the subdisks may be of different length.  The plex may be extended
-by adding additional subdisks.
-They require less CPU time than striped
-..if raid5
-or RAID-5
-..endif
-plexes, though the difference in CPU overhead
-..if raid5
-from striped plexes
-..endif
-is not measurable.  On the other hand, they are most susceptible to hot spots,
-where one disk is very active and others are idle.
-.LI
-The greatest advantage of striped (RAID-0) plexes is that they reduce hot spots:
-by choosing an optimum sized stripe (about 256 kB), you can even out the load on
-the component drives.  The disadvantages of this approach are (fractionally)
-more complex code and restrictions on subdisks: they must be all the same size,
-and extending a plex by adding new subdisks is so complicated that Vinum
-currently does not implement it.  Vinum imposes an additional, trivial
-restriction: a striped plex must have at least two subdisks, since otherwise it
-is indistinguishable from a concatenated plex.
-..if raid5
-.LI
-RAID-5 plexes are effectively an extension of striped plexes.  Compared to
-striped plexes, they offer the advantage of fault tolerance, but the
-disadvantages of higher storage cost and significantly higher CPU overhead,
-particularly for writes.  The code is an order of magnitude more complex than
-for concatenated and striped plexes.  Like striped plexes, RAID-5 plexes must
-have equal-sized subdisks and cannot currently be extended.  Vinum enforces a
-minimum of three subdisks for a RAID-5 plex, since any smaller number would not
-make any sense.
-..endif
-.Le
-Table \*[comparison] summarizes the advantages and disadvantages of each plex
-organization.
-.br
-.na
-.ne 1i
-.TS
-box,center,tab(#) ;
-l | l | l | l | lw26 .
-#Minimum#Can#Must be
-Plex type#subdisks#add#equal#Application
-##subdisks#size
-=
-concatenated#1#yes#no#T{
-Large data storage with maximum placement flexibility and
-moderate performance.
-T}
-.sp .4v
-striped#2#no#yes#T{
-High performance in combination with highly concurrent access.
-T}
-..if raid5
-.sp .4v
-RAID-5#3#no#yes#T{
-Highly reliable storage, primarily read access.
-T}
-..endif
-.TE
-.ad
-.sp 1.5v
-.Figure-heading "Vinum plex organizations"
-.Tn comparison
-.H2 "Some examples"
-.X "configuration database, Vinum"
-.X "Vinum, configuration database"
-Vinum maintains a \fIconfiguration database\fP\| which describes the objects
-known to an individual system.  Initially, the user creates the configuration
-database from one or more configuration files with the aid of the
-\fIvinum(8)\fP\| utility program.  Vinum stores a copy of its configuration
-database on each disk slice (which Vinum calls a \fIdevice\fP\|) under its
-control.  This database is updated on each state change, so that a restart
-accurately restores the state of each Vinum object.
-.H3 "The configuration file"
-The configuration file describes individual Vinum objects.  The definition of a
-simple volume might be:
-.Dx
-drive a device /dev/da3h
-volume myvol
-  plex org concat
-    sd length 512m drive a
-.De
-This file describes four Vinum objects:
-.Ls B
-.LI
-The \f(CWdrive\fP line describes a disk partition (\fIdrive\fP\|) and its
-location relative to the underlying hardware.  It is given the symbolic name
-\fIa\fP.  This separation of the symbolic names from the device names allows
-disks to be moved from one location to another without confusion.
-.LI
-The \f(CWvolume\fP line describes a volume.  The only required attribute is the
-name, in this case \f(CWmyvol\fP.
-.LI
-The \f(CWplex\fP line defines a plex.  The only required parameter is the
-organization, in this case \f(CWconcat\fP.  No name is necessary: the system
-automatically generates a name from the volume name by adding the suffix
-\&\f(CW.p\f(BIx\fR, where \f(BIx\fP\| is the number of the plex in the volume.
-Thus this plex will be called \fImyvol.p0\fP.
-.LI
-The \f(CWsd\fP line describes a subdisk.  The minimum specifications are the
-name of a drive on which to store it, and the length of the subdisk.  As with
-plexes, no name is necessary: the system automatically assigns names derived
-from the plex name by adding the suffix \f(CW.s\f(BIx\fR, where \f(BIx\fP\| is
-the number of the subdisk in the plex.  Thus Vinum gives this subdisk the name
-\fImyvol.p0.s0\fP
-.Le
-After processing this file, \fIvinum(8)\fP\| produces the following output:
-.Dx
-vinum -> \f(CBcreate config1\fP
-Configuration summary
-
-Drives:         1 (4 configured)
-Volumes:        1 (4 configured)
-Plexes:         1 (8 configured)
-Subdisks:       1 (16 configured)
-
-D a                     State: up       Device /dev/da3h        Avail: 2061/2573 MB (80%)
-
-V myvol                 State: up       Plexes:       1 Size:        512 MB
-
-P myvol.p0            C State: up       Subdisks:     1 Size:        512 MB
-
-S myvol.p0.s0           State: up       PO:        0  B Size:        512 MB
-.De
-This output shows the brief listing format of \fIvinum(8)\fP.  It is represented
-graphically in Figure \*[simple-vol].
-.br
-.DF
-.PS
-move right 1i
-T: ellipse ht .3i wid 4i
-   line from T.e down 4i
-   line from T.w down 4i
-B: arc rad 10i to T.e+(0,-4)
-
-P1: S1: box ht 3i wid 1i "Subdisk" above "\s-2\f(CWmyvol.p0.s0\fP\s0" below with .c at T.w+(2,-1.95)
-        "Plex 1" at S1.s+(0,-.3)
-        move down .17i; "\s-2\f(CWmyvol.p0\fP\s0"
-
-"\s-2\&0 MB\s0" at S1.ne+(.5,0)
-"\s-2\&512 MB\s0" at S1.se+(.5,0)
-
-A: arrow from S1.ne+(.1,0) to S1.se+(.1,0)
-
- "\s-2volume" ljust at A.n+(.1,-.63)
- "address" ljust at A.n+(.1,-.8)
- "space\s0" ljust at A.n+(.1,-.97)
-.PE
-.Figure-heading "A simple Vinum volume"
-.Tn simple-vol
-.DE
-.P
-This figure, and the ones which follow, represent a volume, which contains the
-plexes, which in turn contain the subdisks.  In this trivial example, the volume
-contains one plex, and the plex contains one subdisk.
-.P
-This particular volume has no specific advantage over a conventional disk
-partition.  It contains a single plex, so it is not redundant.  The plex
-contains a single subdisk, so there is no difference in storage allocation from
-a conventional disk partition.  The following sections illustrate various more
-interesting configuration methods.
-.H3 "Increased resilience: mirroring"
-The resilience of a volume can be increased 
-..if raid5
-either by mirroring or by using
-RAID-5 plexes.
-..else
-by mirroring.
-..endif
-When laying out a mirrored volume, it is important to ensure that the subdisks
-of each plex are on different drives, so that a drive failure will not take down
-both plexes.  The following configuration mirrors a volume:
-.Dx
-drive b device /dev/da4h
-volume mirror
-  plex org concat
-    sd length 512m drive a
-  plex org concat
-    sd length 512m drive b
-.De
-In this example, it was not necessary to specify a definition of drive \fIa\fP\|
-again, since Vinum keeps track of all objects in its configuration database.
-After processing this definition, the configuration looks like:
-.Dx
-Drives:         2 (4 configured)
-Volumes:        2 (4 configured)
-Plexes:         3 (8 configured)
-Subdisks:       3 (16 configured)
-
-D a                     State: up       Device /dev/da3h        Avail: 1549/2573 MB (60%)
-D b                     State: up       Device /dev/da4h        Avail: 2061/2573 MB (80%)
-
-V myvol                 State: up       Plexes:       1 Size:        512 MB
-V mirror                State: up       Plexes:       2 Size:        512 MB
-
-P myvol.p0            C State: up       Subdisks:     1 Size:        512 MB
-P mirror.p0           C State: up       Subdisks:     1 Size:        512 MB
-P mirror.p1           C State: initializing     Subdisks:     1 Size:        512 MB
-
-S myvol.p0.s0           State: up       PO:        0  B Size:        512 MB
-S mirror.p0.s0          State: up       PO:        0  B Size:        512 MB
-S mirror.p1.s0          State: empty    PO:        0  B Size:        512 MB
-.De
-Figure \*[mirrored-vol] shows the structure graphically.
-.br
-.DF
-.PS
-move right 1i
-T: ellipse ht .3i wid 4i
-   line from T.e down 4i
-   line from T.w down 4i
-B: arc rad 10i to T.e+(0,-4)
-
-P1: S1: box ht 3i wid 1i "Subdisk 1" above "\s-2\f(CWmirror.p0.s0\fP\s0" below with .c at T.c+(-1,-2)
-        "Plex 1" at S1.s+(0,-.3)
-        move down .17i; "\s-2\f(CWmirror.p0\fP\s0"
-P2: S3: box ht 3i wid 1i "Subdisk 2" above "\s-2\f(CWmirror.p1.s0\fP\s0" below with .c at T.c+(1,-2)
-        "Plex 2" at S3.s+(0,-.3) 
-        move down .17i; "\s-2\f(CWmirror.p1\fP\s0"
-
-"\s-2\&0 MB\s0" at S1.ne+(.5,0)
-"\s-2\&512 MB\s0" at S1.se+(.5,0)
-
-A: arrow from S1.ne+(.1,0) to S1.se+(.1,0)
-   arrow from S1.se+(.1,0) to S1.ne+(.1,0)
-
- "\s-2volume" ljust at A.n+(.1,-.63)
- "address" ljust at A.n+(.1,-.8)
- "space\s0" ljust at A.n+(.1,-.97)
-.PE
-.Figure-heading "A mirrored Vinum volume"
-.Tn mirrored-vol
-.DE
-.P
-In this example, each plex contains the full 512 MB of address space.  As in the
-previous example, each plex contains only a single subdisk.
-.H3 "Optimizing performance"
-The mirrored volume in the previous example is more resistant to failure than an
-unmirrored volume, but its performance is less: each write to the volume
-requires a write to both drives, using up a greater proportion of the total disk
-bandwidth.  Performance considerations demand a different approach: instead of
-mirroring, the data is striped across as many disk drives as possible.  The
-following configuration shows a volume with a plex striped across four disk
-drives:
-.Dx
-drive c device /dev/da5h
-drive d device /dev/da6h
-volume stripe
-  plex org striped 512k
-    sd length 128m drive a
-    sd length 128m drive b
-    sd length 128m drive c
-    sd length 128m drive d
-.De
-.P
-As before, it is not necessary to define the drives which are already known to
-Vinum.  After processing this definition, the configuration looks like:
-.Dx
-Drives:         4 (4 configured)
-Volumes:        3 (4 configured)
-Plexes:         4 (8 configured)
-Subdisks:       7 (16 configured)
-
-D a                     State: up       Device /dev/da3h        Avail: 1421/2573 MB (55%)
-D b                     State: up       Device /dev/da4h        Avail: 1933/2573 MB (75%)
-D c                     State: up       Device /dev/da5h        Avail: 2445/2573 MB (95%)
-D d                     State: up       Device /dev/da6h        Avail: 2445/2573 MB (95%)
-
-V myvol                 State: up       Plexes:       1 Size:        512 MB
-V mirror                State: up       Plexes:       2 Size:        512 MB
-V striped               State: up       Plexes:       1 Size:        512 MB
-
-P myvol.p0            C State: up       Subdisks:     1 Size:        512 MB
-P mirror.p0           C State: up       Subdisks:     1 Size:        512 MB
-P mirror.p1           C State: initializing     Subdisks:     1 Size:        512 MB
-P striped.p1            State: up       Subdisks:     1 Size:        512 MB
-
-S myvol.p0.s0           State: up       PO:        0  B Size:        512 MB
-S mirror.p0.s0          State: up       PO:        0  B Size:        512 MB
-S mirror.p1.s0          State: empty    PO:        0  B Size:        512 MB
-S striped.p0.s0         State: up       PO:        0  B Size:        128 MB
-S striped.p0.s1         State: up       PO:      512 kB Size:        128 MB
-S striped.p0.s2         State: up       PO:     1024 kB Size:        128 MB
-S striped.p0.s3         State: up       PO:     1536 kB Size:        128 MB
-.De
-.DF
-.PS
-move right 1i
-T: ellipse ht .3i wid 4i
-   line from T.e down 4i
-   line from T.w down 4i
-B: arc rad 10i to T.e+(0,-4)
-
-P1: S1: box ht .7i wid 1i with .c at T.w+(2,-0.825)
-    S2: box ht .7i wid 1i
-    S3: box ht .7i wid 1i
-    S4: box ht .7i wid 1i
-        "Plex 1" at S4.s+(0,-.3)
-        move down .17i; "\s-2\f(CWstriped.p0\fP\s0"
-
-"\s-2\&0 MB\s0" at S1.ne+(.5,0)
-"\s-2\&512 MB\s0" at S4.se+(.5,0)
-
-A: arrow from S1.ne+(.1,0) to S4.se+(.1,0)
-
- "\s-2volume" ljust at A.n+(.1,-.63)
- "address" ljust at A.n+(.1,-.8)
- "space\s0" ljust at A.n+(.1,-.97)
- "\f(CW\s-2striped.p0.s0\fP\s0" at S1.w-(.2,0) rjust
- "\f(CW\s-2striped.p0.s1\fP\s0" at S2.w-(.2,0) rjust
- "\f(CW\s-2striped.p0.s2\fP\s0" at S3.w-(.2,0) rjust
- "\f(CW\s-2striped.p0.s3\fP\s0" at S4.w-(.2,0) rjust
-
-.\" Stripes
-  box filled .1 wid 1i ht .1i at S1.n+(0, -.05)
-  box filled .2 wid 1i ht .1i at S1.n+(0, -.15)
-  box filled .3 wid 1i ht .1i at S1.n+(0, -.25)
-  box filled .4 wid 1i ht .1i at S1.n+(0, -.35)
-  box filled .5 wid 1i ht .1i at S1.n+(0, -.45)
-  box filled .6 wid 1i ht .1i at S1.n+(0, -.55)
-  box filled .7 wid 1i ht .1i at S1.n+(0, -.65)
-
-  box filled .1 wid 1i ht .1i at S2.n+(0, -.05)
-  box filled .2 wid 1i ht .1i at S2.n+(0, -.15)
-  box filled .3 wid 1i ht .1i at S2.n+(0, -.25)
-  box filled .4 wid 1i ht .1i at S2.n+(0, -.35)
-  box filled .5 wid 1i ht .1i at S2.n+(0, -.45)
-  box filled .6 wid 1i ht .1i at S2.n+(0, -.55)
-  box filled .7 wid 1i ht .1i at S2.n+(0, -.65)
-
-  box filled .1 wid 1i ht .1i at S3.n+(0, -.05)
-  box filled .2 wid 1i ht .1i at S3.n+(0, -.15)
-  box filled .3 wid 1i ht .1i at S3.n+(0, -.25)
-  box filled .4 wid 1i ht .1i at S3.n+(0, -.35)
-  box filled .5 wid 1i ht .1i at S3.n+(0, -.45)
-  box filled .6 wid 1i ht .1i at S3.n+(0, -.55)
-  box filled .7 wid 1i ht .1i at S3.n+(0, -.65)
-
-  box filled .1 wid 1i ht .1i at S4.n+(0, -.05)
-  box filled .2 wid 1i ht .1i at S4.n+(0, -.15)
-  box filled .3 wid 1i ht .1i at S4.n+(0, -.25)
-  box filled .4 wid 1i ht .1i at S4.n+(0, -.35)
-  box filled .5 wid 1i ht .1i at S4.n+(0, -.45)
-  box filled .6 wid 1i ht .1i at S4.n+(0, -.55)
-  box filled .7 wid 1i ht .1i at S4.n+(0, -.65)
-
-.PE
-.Figure-heading "A striped Vinum volume"
-.Tn striped-vol
-.DE
-.P
-This volume is represented in Figure \*[striped-vol].  The darkness of the
-stripes indicates the position within the plex address space: the lightest
-stripes come first, the darkest last.
-.H3 "Resilience and performance"
-.Pn resilience
-With sufficient hardware, it is possible to build volumes which show both
-increased resilience and increased performance compared to standard UNIX
-partitions.  
-..if raid5
-Mirrored disks will always give better performance than RAID-5, so
-a
-..else
-A
-..endif
-typical configuration file might be:
-.Dx
-volume raid10
-  plex org striped 512k
-    sd length 102480k drive a
-    sd length 102480k drive b
-    sd length 102480k drive c
-    sd length 102480k drive d
-    sd length 102480k drive e
-  plex org striped 512k
-    sd length 102480k drive c
-    sd length 102480k drive d
-    sd length 102480k drive e
-    sd length 102480k drive a
-    sd length 102480k drive b
-.De
-The subdisks of the second plex are offset by two drives from those of the first
-plex: this helps ensure that writes do not go to the same subdisks even if a
-transfer goes over two drives.
-.P
-Figure \*[raid10-vol] represents the structure of this volume.
-.br
-.DF
-.PS
-move right 1i
-T: ellipse ht .3i wid 4i
-   line from T.e down 4i
-   line from T.w down 4i
-B: arc rad 10i to T.e+(0,-4)
-
-P1: S1: box ht .6i wid 1i with .c at T.w+(1.3,-0.825)
-    S2: box ht .6i wid 1i
-    S3: box ht .6i wid 1i
-    S4: box ht .6i wid 1i
-    S5: box ht .6i wid 1i
-        "Plex 1" at S5.s+(0,-.3)
-        move down .17i; "\s-2\f(CWstriped.p0\fP\s0"
-
-P1: S11: box ht .6i wid 1i with .c at T.w+(3.3,-0.825)
-    S12: box ht .6i wid 1i
-    S13: box ht .6i wid 1i
-    S14: box ht .6i wid 1i
-    S15: box ht .6i wid 1i
-        "Plex 2" at S15.s+(0,-.3)
-        move down .17i; "\s-2\f(CWstriped.p1\fP\s0"
-
- "\f(CW\s-2.p0.s0\fP\s0" at S1.w-(.2,0) rjust
- "\f(CW\s-2.p0.s1\fP\s0" at S2.w-(.2,0) rjust
- "\f(CW\s-2.p0.s2\fP\s0" at S3.w-(.2,0) rjust
- "\f(CW\s-2.p0.s3\fP\s0" at S4.w-(.2,0) rjust
- "\f(CW\s-2.p0.s4\fP\s0" at S5.w-(.2,0) rjust
-
- "\f(CW\s-2.p1.s0\fP\s0" at S11.w-(.2,0) rjust
- "\f(CW\s-2.p1.s1\fP\s0" at S12.w-(.2,0) rjust
- "\f(CW\s-2.p1.s2\fP\s0" at S13.w-(.2,0) rjust
- "\f(CW\s-2.p1.s3\fP\s0" at S14.w-(.2,0) rjust
- "\f(CW\s-2.p1.s4\fP\s0" at S15.w-(.2,0) rjust
-
-.\" Stripes
-  box filled .1 wid 1i ht .1i at S1.n+(0, -.05)
-  box filled .2 wid 1i ht .1i at S1.n+(0, -.15)
-  box filled .3 wid 1i ht .1i at S1.n+(0, -.25)
-  box filled .4 wid 1i ht .1i at S1.n+(0, -.35)
-  box filled .5 wid 1i ht .1i at S1.n+(0, -.45)
-  box filled .6 wid 1i ht .1i at S1.n+(0, -.55)
-
-  box filled .1 wid 1i ht .1i at S2.n+(0, -.05)
-  box filled .2 wid 1i ht .1i at S2.n+(0, -.15)
-  box filled .3 wid 1i ht .1i at S2.n+(0, -.25)
-  box filled .4 wid 1i ht .1i at S2.n+(0, -.35)
-  box filled .5 wid 1i ht .1i at S2.n+(0, -.45)
-  box filled .6 wid 1i ht .1i at S2.n+(0, -.55)
-
-  box filled .1 wid 1i ht .1i at S3.n+(0, -.05)
-  box filled .2 wid 1i ht .1i at S3.n+(0, -.15)
-  box filled .3 wid 1i ht .1i at S3.n+(0, -.25)
-  box filled .4 wid 1i ht .1i at S3.n+(0, -.35)
-  box filled .5 wid 1i ht .1i at S3.n+(0, -.45)
-  box filled .6 wid 1i ht .1i at S3.n+(0, -.55)
-
-  box filled .1 wid 1i ht .1i at S4.n+(0, -.05)
-  box filled .2 wid 1i ht .1i at S4.n+(0, -.15)
-  box filled .3 wid 1i ht .1i at S4.n+(0, -.25)
-  box filled .4 wid 1i ht .1i at S4.n+(0, -.35)
-  box filled .5 wid 1i ht .1i at S4.n+(0, -.45)
-  box filled .6 wid 1i ht .1i at S4.n+(0, -.55)
-
-  box filled .1 wid 1i ht .1i at S5.n+(0, -.05)
-  box filled .2 wid 1i ht .1i at S5.n+(0, -.15)
-  box filled .3 wid 1i ht .1i at S5.n+(0, -.25)
-  box filled .4 wid 1i ht .1i at S5.n+(0, -.35)
-  box filled .5 wid 1i ht .1i at S5.n+(0, -.45)
-  box filled .6 wid 1i ht .1i at S5.n+(0, -.55)
-
-  box filled .1 wid 1i ht .1i at S11.n+(0, -.05)
-  box filled .2 wid 1i ht .1i at S11.n+(0, -.15)
-  box filled .3 wid 1i ht .1i at S11.n+(0, -.25)
-  box filled .4 wid 1i ht .1i at S11.n+(0, -.35)
-  box filled .5 wid 1i ht .1i at S11.n+(0, -.45)
-  box filled .6 wid 1i ht .1i at S11.n+(0, -.55)
-
-  box filled .1 wid 1i ht .1i at S12.n+(0, -.05)
-  box filled .2 wid 1i ht .1i at S12.n+(0, -.15)
-  box filled .3 wid 1i ht .1i at S12.n+(0, -.25)
-  box filled .4 wid 1i ht .1i at S12.n+(0, -.35)
-  box filled .5 wid 1i ht .1i at S12.n+(0, -.45)
-  box filled .6 wid 1i ht .1i at S12.n+(0, -.55)
-
-  box filled .1 wid 1i ht .1i at S13.n+(0, -.05)
-  box filled .2 wid 1i ht .1i at S13.n+(0, -.15)
-  box filled .3 wid 1i ht .1i at S13.n+(0, -.25)
-  box filled .4 wid 1i ht .1i at S13.n+(0, -.35)
-  box filled .5 wid 1i ht .1i at S13.n+(0, -.45)
-  box filled .6 wid 1i ht .1i at S13.n+(0, -.55)
-
-  box filled .1 wid 1i ht .1i at S14.n+(0, -.05)
-  box filled .2 wid 1i ht .1i at S14.n+(0, -.15)
-  box filled .3 wid 1i ht .1i at S14.n+(0, -.25)
-  box filled .4 wid 1i ht .1i at S14.n+(0, -.35)
-  box filled .5 wid 1i ht .1i at S14.n+(0, -.45)
-  box filled .6 wid 1i ht .1i at S14.n+(0, -.55)
-
-  box filled .1 wid 1i ht .1i at S15.n+(0, -.05)
-  box filled .2 wid 1i ht .1i at S15.n+(0, -.15)
-  box filled .3 wid 1i ht .1i at S15.n+(0, -.25)
-  box filled .4 wid 1i ht .1i at S15.n+(0, -.35)
-  box filled .5 wid 1i ht .1i at S15.n+(0, -.45)
-  box filled .6 wid 1i ht .1i at S15.n+(0, -.55)
-
-.PE
-.Figure-heading "A mirrored, striped Vinum volume"
-.Tn raid10-vol
-.DE
-.H2 "Object naming"
-As described above, Vinum assigns default names to plexes and subdisks, although
-they may be overridden.  Overriding the default names is not recommended:
-experience with the VERITAS\(rg volume manager, which allows arbitary naming of
-objects, has shown that this flexibility does not bring a significant advantage,
-and it can cause confusion.
-.P
-Names may contain any non-blank character, but it is recommended to restrict
-them to letters, digits and the underscore characters.  The names of volumes,
-plexes and subdisks may be up to 64 characters long, and the names of drives may
-up to 32 characters long.
-.P
-.X "/dev/vinum"
-Vinum objects are assigned device nodes in the hierarchy \fI/dev/vinum\fP.  The
-configuration shown above would cause Vinum to create the following device
-nodes:
-.Ls B
-.LI
-.X "/dev/vinum/control"
-The control devices \fI/dev/vinum/control\fP\| and \fI/dev/vinum/controld\fP,
-which are used by \fIvinum(8)\fP\| and the Vinum dmon respectively.
-.LI
-Block and character device entries for each volume.  These are the main devices
-used by Vinum.  The block device names are the name of the volume, while the
-character device names follow the BSD tradition of prepending the letter
-\f(CWr\fP to the name.  Thus the configuration above would include the block
-devices \fI/dev/vinum/myvol\fP, \fI/dev/vinum/mirror\fP,
-\fI/dev/vinum/striped\fP, \fI/dev/vinum/raid5\fP\| and \fI/dev/vinum/raid10\fP,
-and the character devices \fI/dev/vinum/rmyvol\fP, \fI/dev/vinum/rmirror\fP,
-\fI/dev/vinum/rstriped\fP, \fI/dev/vinum/rraid5\fP\| and
-\fI/dev/vinum/rraid10\fP.  There is obviously a problem here: it is possible to
-have two volumes called \fIr\fP\| and \fIrr\fP, but there will be a conflict
-creating the device node \fI/dev/vinum/rr\fP\|: is it a character device for
-volume \fIr\fP\| or a block device for volume \fIrr\fP\|?  Currently Vinum does
-not address this conflict: the first-defined volume will get the name.
-.LI
-A directory \fI/dev/vinum/drive\fP\| with entries for each drive.  These entries
-are in fact symbolic links to the corresponding disk nodes.
-.LI
-A directory \fI/dev/vinum/volume\fP\| with entries for each volume.  It contains
-subdirectories for each plex, which in turn contain subdirectories for their
-component subdisks.
-.LI
-The directories \fI/dev/vinum/plex\fP\| and \fI/dev/vinum/sd\fP,
-\fI/dev/vinum/rsd\fP, which contain block device nodes for each plex and block
-and character device nodes respectively for subdisk.
-.Le
-For example, consider the following configuration file:
-.Dx
-drive drive1 device /dev/sd1h
-drive drive2 device /dev/sd2h
-drive drive3 device /dev/sd3h
-drive drive4 device /dev/sd4h
-volume s64 setupstate
- plex org striped 64k
-   sd length 100m drive drive1
-   sd length 100m drive drive2
-   sd length 100m drive drive3
-   sd length 100m drive drive4
-.De
-After processing this file, \fIvinum(8)\fP\| creates the following structure in
-\fI/dev/vinum\fP\|:
-.Dx
-brwx------  1 root  wheel   25, 0x40000001 Apr 13 16:46 Control
-brwx------  1 root  wheel   25, 0x40000002 Apr 13 16:46 control
-brwx------  1 root  wheel   25, 0x40000000 Apr 13 16:46 controld
-drwxr-xr-x  2 root  wheel       512 Apr 13 16:46 drive
-drwxr-xr-x  2 root  wheel       512 Apr 13 16:46 plex
-crwxr-xr--  1 root  wheel   91,   2 Apr 13 16:46 rs64
-drwxr-xr-x  2 root  wheel       512 Apr 13 16:46 rsd
-drwxr-xr-x  2 root  wheel       512 Apr 13 16:46 rvol
-brwxr-xr--  1 root  wheel   25,   2 Apr 13 16:46 s64
-drwxr-xr-x  2 root  wheel       512 Apr 13 16:46 sd
-drwxr-xr-x  3 root  wheel       512 Apr 13 16:46 vol
-
-/dev/vinum/drive:
-total 0
-lrwxr-xr-x  1 root  wheel  9 Apr 13 16:46 drive1 -> /dev/sd1h
-lrwxr-xr-x  1 root  wheel  9 Apr 13 16:46 drive2 -> /dev/sd2h
-lrwxr-xr-x  1 root  wheel  9 Apr 13 16:46 drive3 -> /dev/sd3h
-lrwxr-xr-x  1 root  wheel  9 Apr 13 16:46 drive4 -> /dev/sd4h
-
-/dev/vinum/plex:
-total 0
-brwxr-xr--  1 root  wheel   25, 0x10000002 Apr 13 16:46 s64.p0
-
-/dev/vinum/rsd:
-total 0
-crwxr-xr--  1 root  wheel   91, 0x20000002 Apr 13 16:46 s64.p0.s0
-crwxr-xr--  1 root  wheel   91, 0x20100002 Apr 13 16:46 s64.p0.s1
-crwxr-xr--  1 root  wheel   91, 0x20200002 Apr 13 16:46 s64.p0.s2
-crwxr-xr--  1 root  wheel   91, 0x20300002 Apr 13 16:46 s64.p0.s3
-
-/dev/vinum/rvol:
-total 0
-crwxr-xr--  1 root  wheel   91,   2 Apr 13 16:46 s64
-
-/dev/vinum/sd:
-total 0
-brwxr-xr--  1 root  wheel   25, 0x20000002 Apr 13 16:46 s64.p0.s0
-brwxr-xr--  1 root  wheel   25, 0x20100002 Apr 13 16:46 s64.p0.s1
-brwxr-xr--  1 root  wheel   25, 0x20200002 Apr 13 16:46 s64.p0.s2
-brwxr-xr--  1 root  wheel   25, 0x20300002 Apr 13 16:46 s64.p0.s3
-
-/dev/vinum/vol:
-total 1
-brwxr-xr--  1 root  wheel   25,   2 Apr 13 16:46 s64
-drwxr-xr-x  3 root  wheel       512 Apr 13 16:46 s64.plex
-
-/dev/vinum/vol/s64.plex:
-total 1
-brwxr-xr--  1 root  wheel   25, 0x10000002 Apr 13 16:46 s64.p0
-drwxr-xr-x  2 root  wheel       512 Apr 13 16:46 s64.p0.sd
-
-/dev/vinum/vol/s64.plex/s64.p0.sd:
-total 0
-brwxr-xr--  1 root  wheel   25, 0x20000002 Apr 13 16:46 s64.p0.s0
-brwxr-xr--  1 root  wheel   25, 0x20100002 Apr 13 16:46 s64.p0.s1
-brwxr-xr--  1 root  wheel   25, 0x20200002 Apr 13 16:46 s64.p0.s2
-brwxr-xr--  1 root  wheel   25, 0x20300002 Apr 13 16:46 s64.p0.s3
-.De
-.P
-Although it is recommended that plexes and subdisks should not be allocated
-specific names, Vinum drives must be named.  This makes it possible to move a
-drive to a different location and still recognize it automatically.  Drive names
-may be up to 32 characters long.
-.H3 "Creating file systems"
-.X "newfs"
-Volumes appear to the system to be identical to disks, with one exception.
-Unlike UNIX drives, Vinum does not partition volumes, which thus do not contain
-a partition table.  This has required modification to some disk utilities,
-notably \fInewfs\fP\|, which previously tried to interpret the last letter of a
-Vinum volume name as a partition identifier.  For example, a disk drive may have
-a name like \fI/dev/wd0a\fP\| or \fI/dev/da2h\fP.  These names represent the
-first partition (\f(CWa\fP) on the first (0) IDE disk (\f(CWwd\fP) and the eight
-partition (\f(CWh\fP) on the third (2) SCSI disk (\f(CWda\fP) respectively.  By
-contrast, a Vinum volume might be called \fI/dev/vinum/concat\fP, a name which
-has no relationship with a partition name.
-.P
-Normally, \fInewfs(8)\fP\| interprets the name of the disk and complains if it
-cannot understand it.  For example:
-.Dx
-# \f(CBnewfs /dev/vinum/concat\fP
-newfs: /dev/vinum/concat: can't figure out file system partition
-.De
-In order to create a file system on this volume, use the \f(CW-v\fP option to
-\fInewfs(8)\fP\|:
-.Dx
-# \f(CBnewfs -v /dev/vinum/concat\fP
-.De
-.sp -1v
-.H2 "Configuring Vinum"
-The \f(CWGENERIC\fP kernel does not contain Vinum.  It's possible to build a
-special kernel which includes Vinum, but this is not recommended.  The standard
-way to start Vinum is as a \fIkld\fP\| (see page \*[kld] for more details).  You
-don't even need to use \fIkldload\fP\| for Vinum: when you start \fIvinum(8)\fP,
-it checks whether the module has been loaded, and if it isn't, it loads it
-automatically.
-.H2 "Startup"
-Vinum stores configuration information on the disk slices in essentially the
-same form as in the configuration files.  When reading from the configuration
-database, Vinum recognizes a number of keywords which are not allowed in the
-configuration files.  For example, a disk configuration might contain the
-following text:
-.Dx
-volume myvol state up
-volume bigraid state down
-plex name myvol.p0 state up org concat vol myvol
-plex name myvol.p1 state up org concat vol myvol
-plex name myvol.p2 state init org striped 512b vol myvol
-plex name bigraid.p0 state initializing org raid5 512b vol bigraid
-sd name myvol.p0.s0 drive a plex myvol.p0 state up len 1048576b driveoffset 265b plexo
-ffset 0b
-sd name myvol.p0.s1 drive b plex myvol.p0 state up len 1048576b driveoffset 265b plexo
-ffset 1048576b
-sd name myvol.p1.s0 drive c plex myvol.p1 state up len 1048576b driveoffset 265b plexo
-ffset 0b
-sd name myvol.p1.s1 drive d plex myvol.p1 state up len 1048576b driveoffset 265b plexo
-ffset 1048576b
-sd name myvol.p2.s0 drive a plex myvol.p2 state init len 524288b driveoffset 1048841b 
-plexoffset 0b
-sd name myvol.p2.s1 drive b plex myvol.p2 state init len 524288b driveoffset 1048841b 
-plexoffset 524288b
-sd name myvol.p2.s2 drive c plex myvol.p2 state init len 524288b driveoffset 1048841b 
-plexoffset 1048576b
-sd name myvol.p2.s3 drive d plex myvol.p2 state init len 524288b driveoffset 1048841b 
-plexoffset 1572864b
-sd name bigraid.p0.s0 drive a plex bigraid.p0 state initializing len 4194304b driveoff
-set 1573129b plexoffset 0b
-sd name bigraid.p0.s1 drive b plex bigraid.p0 state initializing len 4194304b driveoff
-set 1573129b plexoffset 4194304b
-sd name bigraid.p0.s2 drive c plex bigraid.p0 state initializing len 4194304b driveoff
-set 1573129b plexoffset 8388608b
-sd name bigraid.p0.s3 drive d plex bigraid.p0 state initializing len 4194304b driveoff
-set 1573129b plexoffset 12582912b
-sd name bigraid.p0.s4 drive e plex bigraid.p0 state initializing len 4194304b driveoff
-set 1573129b plexoffset 16777216b
-.De
-The obvious differences here are the presence of explicit location information
-and naming (both of which are also allowed, but discouraged, for use by the
-user) and the information on the states (which are not available to the user).
-Vinum does not store information about drives in the configuration information:
-it finds the drives by scanning the configured disk drives for partitions with a
-Vinum label.  This enables Vinum to identify drives correctly even if they have
-been assigned different UNIX drive IDs.
-.H3 "Automatic startup"
-In order to start Vinum automatically when you boot the system, ensure that you
-have the following line in your \fI/etc/rc.conf\fP\|:
-.Dx
-start_vinum="YES"		# set to YES to start vinum
-.De
-If you don't have a file \fI/etc/rc.conf\fP, create one with this content.  This
-will cause the system to load the Vinum kld at startup, and to start any objects
-mentioned in the configuration.  This is done before mounting file systems, so
-it's possible to automatically \fIfsck\fP\| and mount file systems on Vinum
-volumes.
-.P
-When you start Vinum with the \f(CWvinum\ start\fP command, Vinum reads the
-configuration database from one of the Vinum drives.  Under normal
-circumstances, each drive contains an identical copy of the configuration
-database, so it does not matter which drive is read.  After a crash, however,
-Vinum must determine which drive was updated most recently and read the
-configuration from this drive.  It then updates the configuration if necessary
-from progressively older drives.
-.P
-XXXXXXX
-bmah        2002/01/11 15:55:59 PST
-
-  Modified files:
-    share/man/man7       tuning.7
-  Log:
-  newfs -U enables softupdates beginning with FreeBSD 4.5.
-
-  PR:             33391
-  Submitted by:   Ceri <setantae@submonkey.net>
- 
-  Revision  Changes    Path
-  1.43      +2 -2      src/share/man/man7/tuning.7
+it back, and exit.
+.Command camcontrol
+writes the data back to the disk and enables the option.
+.P
+Note the last two lines in this example.  They give the number of actual retries
+that this drive has performed.  You can reset these values too if you want; they
+will be updated if the drive performs any additional retries.
