diff --git a/lib/geom/multipath/gmultipath.8 b/lib/geom/multipath/gmultipath.8 index 53761455080d..7f0346e1c307 100644 --- a/lib/geom/multipath/gmultipath.8 +++ b/lib/geom/multipath/gmultipath.8 @@ -1,377 +1,377 @@ .\" Copyright (c) 2007 Matthew Jacob .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" -.Dd September 8, 2016 +.Dd March 17, 2022 .Dt GMULTIPATH 8 .Os .Sh NAME .Nm gmultipath .Nd "disk multipath control utility" .Sh SYNOPSIS .Nm .Cm create .Op Fl ARv .Ar name .Ar prov ... .Nm .Cm label .Op Fl ARv .Ar name .Ar prov ... .Nm .Cm configure .Op Fl APRv .Ar name .Nm .Cm add .Op Fl v .Ar name prov .Nm .Cm remove .Op Fl v .Ar name prov .Nm .Cm fail .Op Fl v .Ar name prov .Nm .Cm restore .Op Fl v .Ar name prov .Nm .Cm rotate .Op Fl v .Ar name .Nm .Cm prefer .Op Fl v .Ar name .Ar prov .Nm .Cm getactive .Op Fl v .Ar name .Nm .Cm destroy .Op Fl v .Ar name .Nm .Cm stop .Op Fl v .Ar name .Nm .Cm clear .Op Fl v .Ar prov ... .Nm .Cm list .Nm .Cm status .Nm .Cm load .Nm .Cm unload .Sh DESCRIPTION The .Nm utility is used for device multipath configuration. .Pp The multipath device can be configured using two different methods: .Dq manual or .Dq automatic . When using the .Dq manual method, no metadata are stored on the devices, so the multipath device has to be configured by hand every time it is needed. Additional device paths also will not be detected automatically. The .Dq automatic method uses on-disk metadata to detect device and all its paths. Metadata use the last sector of the underlying disk device and include device name and UUID. The UUID guarantees uniqueness in a shared storage environment but is in general too cumbersome to use. The name is what is exported via the device interface. .Pp The first argument to .Nm indicates an action to be performed: .Bl -tag -width ".Cm destroy" .It Cm create Create multipath device with .Dq manual method without writing any on-disk metadata. It is up to administrator, how to properly identify device paths. Kernel will only check that all given providers have same media and sector sizes. .Pp .Fl A option enables Active/Active mode, .Fl R option enables Active/Read mode, otherwise Active/Passive mode is used by default. .It Cm label Create multipath device with .Dq automatic method. Label the first given provider with on-disk metadata using the specified .Ar name . The rest of given providers will be retasted to detect these metadata. It reliably protects against specifying unrelated providers. Providers with no matching metadata detected will not be added to the device. .Pp .Fl A option enables Active/Active mode, .Fl R option enables Active/Read mode, otherwise Active/Passive mode is used by default. .It Cm configure Configure the given multipath device. .Pp .Fl A option enables Active/Active mode, .Fl P option enables Active/Passive mode, .Fl R option enables Active/Read mode. .It Cm add Add the given provider as a path to the given multipath device. Should normally be used only for devices created with .Dq manual method, unless you know what you are doing (you are sure that it is another device path, but tasting its metadata in regular .Dq automatic way is not possible). .It Cm remove Remove the given provider as a path from the given multipath device. If the last path removed, the multipath device will be destroyed. .It Cm fail Mark specified provider as a path of the specified multipath device as failed. If there are other paths present, new requests will be forwarded there. .It Cm restore Mark specified provider as a path of the specified multipath device as operational, allowing it to handle requests. .It Cm rotate Change the active provider/path to the next available provider in Active/Passive mode. .It Cm prefer Change the active provider/path to the specified provider in Active/Passive mode. .It Cm getactive Get the currently active provider(s)/path(s). .It Cm destroy Destroy the given multipath device clearing metadata. .It Cm stop Stop the given multipath device without clearing metadata. .It Cm clear Clear metadata on the given provider. .It Cm list See .Xr geom 8 . .It Cm status See .Xr geom 8 . .It Cm load See .Xr geom 8 . .It Cm unload See .Xr geom 8 . .El .Sh SYSCTL VARIABLES The following .Xr sysctl 8 variable can be used to control the behavior of the .Nm MULTIPATH GEOM class. .Bl -tag -width indent .It Va kern.geom.multipath.debug : No 0 Debug level of the .Nm MULTIPATH GEOM class. This can be set to 0 (default) or 1 to disable or enable various forms of chattiness. .It Va kern.geom.multipath.exclusive : No 1 Open underlying providers exclusively, preventing individual paths access. .El .Sh EXIT STATUS Exit status is 0 on success, and 1 if the command fails. .Sh MULTIPATH ARCHITECTURE This is a multiple path architecture with no device knowledge or presumptions other than size matching built in. Therefore the user must exercise some care in selecting providers that do indeed represent multiple paths to the same underlying disk device. The reason for this is that there are several criteria across multiple underlying transport types that can .Ar indicate identity, but in all respects such identity can rarely be considered .Ar definitive . .Pp For example, if you use the World Wide Port Name of a Fibre Channel disk object you might believe that two disks that have the same WWPN on different paths (or even disjoint fabrics) might be considered the same disk. Nearly always this would be a safe assumption, until you realize that a WWPN, like an Ethernet MAC address, is a soft programmable entity, and that a misconfigured Director Class switch could lead you to believe incorrectly that you have found multiple paths to the same device. This is an extreme and theoretical case, but it is possible enough to indicate that the policy for deciding which of multiple pathnames refer to the same device should be left to the system operator who will use tools and knowledge of their own storage subsystem to make the correct configuration selection. .Pp There are Active/Passive, Active/Read and Active/Active operation modes supported. In Active/Passive mode only one path has I/O moving on it at any point in time. This I/O continues until an I/O is returned with a generic I/O error or a "Nonexistent Device" error. When this occurs, that path is marked FAIL, the next path in a list is selected as active and the failed I/O reissued. In Active/Active mode all paths not marked FAIL may handle I/O at the same time. Requests are distributed between paths to equalize load. For capable devices it allows the utilisation of the bandwidth available on all paths. In Active/Read mode all paths not marked FAIL may handle reads at the same time, but unlike in Active/Active mode only one path handles write requests at any point in time; closely following the original write request order if the layer above needs it for data consistency (not waiting for requisite write completion before sending dependent write). .Pp When new devices are added to the system the .Nm MULTIPATH GEOM class is given an opportunity to taste these new devices. If a new device has a .Nm MULTIPATH on-disk metadata label, the device is either used to create a new .Nm MULTIPATH GEOM, or added to the list of paths for an existing .Nm MULTIPATH GEOM. .Pp It is this mechanism that works reasonably with .Xr isp 4 and .Xr mpt 4 based Fibre Channel disk devices. For these devices, when a device disappears (due to e.g., a cable pull or power failure to a switch), the device is proactively marked as gone and I/O to it failed. This causes the .Nm MULTIPATH failure event just described. .Pp When Fibre Channel events inform either .Xr isp 4 or .Xr mpt 4 host bus adapters that new devices may have arrived (e.g., the arrival of an RSCN event from the Fabric Domain Controller), they can cause a rescan to occur and cause the attachment and configuration of any (now) new devices to occur, causing the taste event described above. .Pp This means that this multipath architecture is not a one-shot path failover, but can be considered to be steady state as long as failed paths are repaired (automatically or otherwise). .Pp Automatic rescanning is not a requirement. Nor is Fibre Channel. The same failover mechanisms work equally well for traditional "Parallel" SCSI but may require manual intervention with .Xr camcontrol 8 to cause the reattachment of repaired device links. .Sh EXAMPLES The following example shows how to use .Xr camcontrol 8 to find possible multiple path devices and to create a .Nm MULTIPATH GEOM class for them. .Bd -literal -offset indent mysys# camcontrol devlist at scbus0 target 0 lun 0 (da0,pass0) at scbus0 target 0 lun 1 (da1,pass1) at scbus1 target 0 lun 0 (da2,pass2) at scbus1 target 0 lun 1 (da3,pass3) mysys# camcontrol inquiry da0 -S ECNTX0LUN000000SER10ac0d01 mysys# camcontrol inquiry da2 -S ECNTX0LUN000000SER10ac0d01 .Ed .Pp Now that you have used the Serial Number to compare two disk paths it is not entirely unreasonable to conclude that these are multiple paths to the same device. However, only the user who is familiar with their storage is qualified to make this judgement. .Pp You can then use the .Nm command to label and create a .Nm MULTIPATH GEOM provider named .Ar FRED . .Bd -literal -offset indent gmultipath label -v FRED /dev/da0 /dev/da2 -disklabel -Brw /dev/multipath/FRED auto +disklabel -Bw /dev/multipath/FRED auto newfs /dev/multipath/FREDa mount /dev/multipath/FREDa /mnt.... .Ed .Pp The resultant console output looks something like: .Bd -literal -offset indent GEOM_MULTIPATH: da0 added to FRED GEOM_MULTIPATH: da0 is now active path in FRED GEOM_MULTIPATH: da2 added to FRED .Ed .Pp To load the .Nm module at boot time, add this entry to .Pa /boot/loader.conf : .Bd -literal -offset ident geom_multipath_load="YES" .Ed .Sh SEE ALSO .Xr geom 4 , .Xr isp 4 , .Xr mpt 4 , .Xr loader.conf 5 , .Xr camcontrol 8 , .Xr geom 8 , .Xr mount 8 , .Xr newfs 8 , .Xr sysctl 8 .Sh HISTORY The .Nm utility first appeared in .Fx 7.0 .Sh AUTHORS .An Matthew Jacob Aq Mt mjacob@FreeBSD.org .An Alexander Motin Aq Mt mav@FreeBSD.org diff --git a/sbin/bsdlabel/disktab b/sbin/bsdlabel/disktab index b9bf610d597f..cb0fba033699 100644 --- a/sbin/bsdlabel/disktab +++ b/sbin/bsdlabel/disktab @@ -1,204 +1,204 @@ # $FreeBSD$ # # Disk geometry and partition layout tables. # See disktab(5) for format of this file. # # # Floppy formats: # # To make a filesystem on a floppy: # fdformat [-f ] fd[.] -# disklabel -B -r -w fd[.] fd +# disklabel -B -w fd[.] fd # newfs fd[.] # # with : # -t 2 - two heads # -u 9|15|18 - sectors per track # (using the default value of 1/4096 is not much useful for floppies) # -l 1 - interleave 1 (for most floppies) # -i 65536 - bytes of data per i-node # (the default -i value will render you with a floppy wasting way # too much space in i-node areas) # fd360:\ :ty=floppy:se#512:nt#2:rm#300:ns#9:nc#40:\ :pa#720:oa#0:ba#4096:fa#512:\ :pc#720:oc#0:bc#4096:fc#512: fd720:\ :ty=floppy:se#512:nt#2:rm#300:ns#9:nc#80:\ :pa#1440:oa#0:ba#4096:fa#512:\ :pc#1440:oc#0:bc#4096:fc#512: fd1200|floppy5|5in|5.25in High Density Floppy:\ :ty=floppy:se#512:nt#2:rm#360:ns#15:nc#80:\ :pa#2400:oa#0:ba#4096:fa#512:\ :pc#2400:oc#0:bc#4096:fc#512: fd1440|floppy|floppy3|3in|3.5in High Density Floppy:\ :ty=floppy:se#512:nt#2:rm#300:ns#18:nc#80:\ :pa#2880:oa#0:ba#4096:fa#512:\ :pc#2880:oc#0:bc#4096:fc#512: fd2880|2.88MB 3.5in Extra High Density Floppy:\ :ty=floppy:se#512:nt#2:rm#300:ns#36:nc#80:\ :pa#5760:oa#0:ba#4096:fa#512:\ :pb#5760:ob#0:bb#4096:fa#512:\ :pc#5760:oc#0:bb#4096:fa#512: # # Stressed floppy-formats. No guarantees given. # fd800:\ :ty=floppy:se#512:nt#2:rm#300:ns#10:nc#80:\ :pa#1600:oa#0:ba#4096:fa#512:\ :pc#1600:oc#0:bc#4096:fc#512: fd820:\ :ty=floppy:se#512:nt#2:rm#300:ns#10:nc#82:\ :pa#1640:oa#0:ba#4096:fa#512:\ :pc#1640:oc#0:bc#4096:fc#512: fd1480:\ :ty=floppy:se#512:nt#2:rm#300:ns#18:nc#82:\ :pa#2952:oa#0:ba#4096:fa#512:\ :pc#2952:oc#0:bc#4096:fc#512: fd1720:\ :ty=floppy:se#512:nt#2:rm#300:ns#21:nc#82:\ :pa#3444:oa#0:ba#4096:fa#512:\ :pc#3444:oc#0:bc#4096:fc#512: # # LS-120 floppy-format. # fd120m|floppy120|floppy120m|3.5in LS-120 Floppy:\ :ty=floppy:se#512:nt#8:rm#300:ns#32:nc#963:\ :pa#246528:oa#0:ba#4096:fa#512:\ :pc#246528:oc#0:bc#4096:fc#512: # # Harddisk formats # qp120at|Quantum Peripherals 120MB IDE:\ :dt=ESDI:ty=winchester:se#512:nt#9:ns#32:nc#813:sf: \ :pa#13824:oa#0:ta=4.2BSD:ba#4096:fa#512: \ :pb#13824:ob#13824:tb=swap: \ :pc#234144:oc#0: \ :ph#206496:oh#27648:th=4.2BSD:bh#4096:fh#512: pan60|Panasonic Laptop's 60MB IDE:\ :dt=ST506:ty=winchester:se#512:nt#13:ns#17:nc#565:\ :pa#13260:oa#0:ta=4.2BSD:ba#4096:fa#512:\ :pb#13260:ob#13260:tb=swap: \ :pc#124865:oc#0: \ :ph#97682:oh#26520:th=4.2BSD:bh#4096:fh#512: mk156|toshiba156|Toshiba MK156 156Mb:\ :dt=SCSI:ty=winchester:se#512:nt#10:ns#35:nc#825:\ :pa#15748:oa#0:ba#4096:fa#512:ta=4.2BSD:\ :pb#15748:ob#15748:tb=swap:\ :pc#288750:oc#0:\ :ph#257250:oh#31500:bh#4096:fh#512:th=4.2BSD: cp3100|Connor Peripherals 100MB IDE:\ :dt=ST506:ty=winchester:se#512:nt#8:ns#33:nc#766: \ :pa#12144:oa#0:ta=4.2BSD:ba#4096:fa#512: \ :pb#12144:ob#12144:tb=swap: \ :pc#202224:oc#0: \ :ph#177936:oh#24288:th=4.2BSD:bh#4096:fh#512: # a == root # b == swap # c == d == whole disk # e == /var # f == scratch # h == /usr cp3100new|Connor Peripherals 100MB IDE, with a different configuration:\ :dt=ST506:ty=winchester:se#512:nt#8:ns#33:nc#766: \ :pa#15840:oa#0:ta=4.2BSD:ba#4096:fa#512: \ :pb#24288:ob#15840:tb=swap: \ :pc#202224:oc#0: \ :pd#202224:od#0: \ :pe#15840:oe#40128:te=4.2BSD:be#4096:fe#512: \ :pg#15840:og#55968:tg=4.2BSD:bg#4096:fg#512: \ :ph#130416:oh#71808:th=4.2BSD:bh#4096:fh#512: maxtor4380|Maxtor XT4380E ESDI :\ :dt=ESDI:ty=winchester:se#512:nt#15:ns#36:nc#1222:sf: \ :pa#21600:oa#0:ta=4.2BSD:ba#4096:fa#512:\ :pb#21600:ob#21600:tb=swap: \ :pc#659880:oc#0: \ :pd#216000:od#53200:td=4.2BSD:bd#4096:fd#512: \ :ph#398520:oh#269200:th=4.2BSD:bh#4096:fh#512: miniscribe9380|compaq38|Miniscribe 9380 ESDI :\ :ty=winchester:dt=ESDI:se#512:nt#15:ns#35:nc#1223:rm#3600:sf: \ :pa#21000:oa#0:ba#8192:fa#1024:ta=4.2BSD: \ :pb#42000:ob#21000:tb=swap: \ :pc#642075:oc#0: \ :pd#21000:od#63000:bd#8192:fd#1024:td=4.2BSD: \ :ph#556500:oh#84000:bh#8192:fh#1024:th=4.2BSD: ida4|compaq88|Compaq IDA (4 drives) :\ :ty=winchester:dt=IDA:se#512:nt#16:ns#63:nc#1644:rm#3600:\ :pa#20160:oa#0:ba#8192:fa#1024:ta=4.2BSD: \ :pb#80640:ob#20160:tb=swap: \ :pc#1659168:oc#0: \ :pd#201600:od#100800:bd#8192:fd#1024:td=4.2BSD: \ :pe#20160:oe#1310400:be#8192:fe#1024:te=4.2BSD: \ :ph#1008000:oh#302400:bh#8192:fh#1024:th=4.2BSD: \ :pg#302400:og#1330560:bg#4096:fg#512:tg=4.2BSD: fuji513|Fujitsu M22XXXX: \ :ty=winchester:dt=ESDI:se#512:nt#16:ns#63:nc#954:rm#3600:\ :pa#20160:oa#82656:ba#4096:fa#512:ta=4.2BSD: \ :pb#40320:ob#102816:tb=swap: \ :pc#961632:oc#0: \ :ph#656208:oh#143136:bh#4096:fh#512:th=4.2BSD: sony650|Sony 650 MB MOD|\ :ty=removable:dt=SCSI:se#512:nt#1:ns#31:nc#18600:ts#1:rm#4800:\ :pc#576600:oc#0:\ :pa#576600:oa#0:ta=4.2BSD:ba#8192:fa#1024: mta3230|mo230|IBM MTA-3230 230 Meg 3.5inch Magneto-Optical:\ :ty=removeable:dt=SCSI:rm#3600:\ :se#512:nt#64:ns#32:nc#216:sc#2048:su#444384:\ :pa#444384:oa#0:ba#4096:fa#0:ta=4.2BSD:\ :pc#444384:oc#0: minimum:ty=mfs:se#512:nt#1:rm#300:\ :ns#2880:nc#1:\ :pa#2880:oa#0:ba#4096:fa#512:\ :pc#2880:oc#0:bc#4096:fc#512: minimum2:ty=mfs:se#512:nt#1:rm#300:\ :ns#5760:nc#1:\ :pa#5760:oa#0:ba#4096:fa#512:\ :pc#5760:oc#0:bc#4096:fc#512: minimum3:ty=mfs:se#512:nt#1:rm#300:\ :ns#8640:nc#1:\ :pa#8640:oa#0:ba#4096:fa#512:\ :pc#8640:oc#0:bc#4096:fc#512: zip100|zip 100:\ :ty=removable:se#512:nc#96:nt#64:ns#32:\ :pa#196608:oa#0:ba#4096:fa#512:\ :pc#196608:oc#0:bc#4096:fc#512: zip250|zip 250:\ :ty=removable:se#512:nc#239:nt#64:ns#32:\ :pa#489472:oa#0:ba#4096:fa#512:\ :pc#489472:oc#0:bc#4096:fc#512: orb2200|orb22|orb:\ :ty=removable:ns#63:nt#128:nc#4273:sc#1008:su#4307184:se#512:\ :pa#4307184:oa#0:ba#8192:fa#1024:\ :pc#4307184:oc#0:bc#8192:fc#1024: diff --git a/sbin/ccdconfig/ccdconfig.8 b/sbin/ccdconfig/ccdconfig.8 index 778a7f921c70..e73864bc1fef 100644 --- a/sbin/ccdconfig/ccdconfig.8 +++ b/sbin/ccdconfig/ccdconfig.8 @@ -1,258 +1,258 @@ .\" Copyright (c) 1996 The NetBSD Foundation, Inc. .\" All rights reserved. .\" .\" This code is derived from software contributed to The NetBSD Foundation .\" by Jason R. Thorpe. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, .\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED .\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, .\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $NetBSD: ccdconfig.8,v 1.4 1996/02/28 01:01:17 thorpej Exp $ .\" $FreeBSD$ .\" -.Dd October 3, 2016 +.Dd March 17, 2022 .Dt CCDCONFIG 8 .Os .Sh NAME .Nm ccdconfig .Nd configuration utility for the concatenated disk driver .Sh SYNOPSIS .Nm .Op Fl cv .Ar ccd .Ar ileave .Op Ar flags .Ar dev ... .Nm .Fl C .Op Fl v .Op Fl f Ar config_file .Nm .Fl u .Op Fl v .Ar ccd ... .Nm .Fl U .Op Fl v .Op Fl f Ar config_file .Nm .Fl g .Op Ar ccd ... .Sh DESCRIPTION The .Nm utility is used to dynamically configure and unconfigure concatenated disk devices, or ccds. For more information about the ccd, see .Xr ccd 4 . .Pp The options are as follows: .Bl -tag -width indent .It Fl c Configure a ccd. This is the default behavior of .Nm . .It Fl C Configure all ccd devices listed in the ccd configuration file. .It Fl f Ar config_file When configuring or unconfiguring all devices, read the file .Pa config_file instead of the default .Pa /etc/ccd.conf . .It Fl g Dump the current ccd configuration in a format suitable for use as the ccd configuration file. If no arguments are specified, every configured ccd is dumped. Otherwise, the configuration of each listed ccd is dumped. .It Fl u Unconfigure a ccd. .It Fl U Unconfigure all ccd devices listed the ccd configuration file. .It Fl v Cause .Nm to be verbose. .El .Pp A ccd is described on the command line and in the ccd configuration file by the name of the ccd, the interleave factor, the ccd configuration flags, and a list of one or more devices. The flags may be represented as a decimal number, a hexadecimal number, a comma-separated list of strings, or the word .Dq none . The flags are as follows: .Bd -literal -offset indent CCDF_UNIFORM 0x02 Use uniform interleave CCDF_MIRROR 0x04 Support mirroring CCDF_NO_OFFSET 0x08 Do not use an offset CCDF_LINUX 0x0A Linux md(4) compatibility .Ed .Pp The format in the configuration file appears exactly as if it were entered on the command line. Note that on the command line and in the configuration file, the .Pa flags argument is optional. .Bd -literal -offset indent # # /etc/ccd.conf # Configuration file for concatenated disk devices # # ccd ileave flags component devices ccd0 16 none /dev/da2s1 /dev/da3s1 .Ed .Pp The component devices need to name partitions of type .Li FS_BSDFFS (or .Dq 4.2BSD as shown by .Xr disklabel 8 ) . .Pp If you want to use the .Tn Linux .Xr md 4 compatibility mode, please be sure to read the notes in .Xr ccd 4 . .Sh FILES .Bl -tag -width /etc/ccd.conf -compact .It Pa /etc/ccd.conf default ccd configuration file .El .Sh EXAMPLES A number of .Nm examples are shown below. The arguments passed to .Nm are exactly the same as you might place in the .Pa /etc/ccd.conf configuration file. The first example creates a 4-disk stripe out of four scsi disk partitions. The stripe uses a 64 sector interleave. The second example is an example of a complex stripe/mirror combination. It reads as a two disk stripe of da4 and da5 which is mirrored to a two disk stripe of da6 and da7. The last example is a simple mirror. The second slice of /dev/da8 is mirrored with the third slice of /dev/da9 and assigned to ccd0. .Bd -literal # ccdconfig ccd0 64 none /dev/da0s1 /dev/da1s1 /dev/da2s1 /dev/da3s1 # ccdconfig ccd0 128 CCDF_MIRROR /dev/da4 /dev/da5 /dev/da6 /dev/da7 # ccdconfig ccd0 128 CCDF_MIRROR /dev/da8s2 /dev/da9s3 .Ed .Pp The following are matching commands in .Tn Linux and .Fx to create a RAID-0 in .Tn Linux and read it from .Fx . .Bd -literal # Create a RAID-0 on Linux: mdadm --create --chunk=32 --level=0 --raid-devices=2 /dev/md0 \\ /dev/hda1 /dev/hdb1 # Make the RAID-0 just created available on FreeBSD: ccdconfig -c /dev/ccd0 32 linux /dev/ada0s1 /dev/ada0s2 .Ed .Pp When you create a new ccd disk you generally want to .Xr fdisk 8 and .Xr disklabel 8 it before doing anything else. Once you create the initial label you can edit it, adding additional partitions. The label itself takes up the first 16 sectors of the ccd disk. If all you are doing is creating file systems with newfs, you do not have to worry about this as newfs will skip the label area. However, if you intend to .Xr dd 1 to or from a ccd partition it is usually a good idea to construct the partition such that it does not overlap the label area. For example, if you have A ccd disk with 10000 sectors you might create a 'd' partition with offset 16 and size 9984. .Bd -literal # disklabel ccd0 > /tmp/disklabel.ccd0 -# disklabel -Rr ccd0 /tmp/disklabel.ccd0 +# disklabel -R ccd0 /tmp/disklabel.ccd0 # disklabel -e ccd0 .Ed .Pp The disklabeling of a ccd disk is usually a one-time affair. If you reboot the machine and reconfigure the ccd disk, the disklabel you had created before will still be there and not require reinitialization. Beware that changing any ccd parameters: interleave, flags, or the device list making up the ccd disk, will usually destroy any prior data on that ccd disk. If this occurs it is usually a good idea to reinitialize the label before [re]constructing your ccd disk. .Sh RECOVERY An error on a ccd disk is usually unrecoverable unless you are using the mirroring option. But mirroring has its own perils: It assumes that both copies of the data at any given sector are the same. This holds true until a write error occurs or until you replace either side of the mirror. This is a poor-man's mirroring implementation. It works well enough that if you begin to get disk errors you should be able to backup the ccd disk, replace the broken hardware, and then regenerate the ccd disk. If you need more than this you should look into external hardware RAID SCSI boxes, RAID controllers (see GENERIC), or software RAID systems such as .Xr geom 8 and .Xr gvinum 8 . .Sh SEE ALSO .Xr dd 1 , .Xr ccd 4 , .Xr disklabel 8 , .Xr fdisk 8 , .Xr gvinum 8 , .Xr rc 8 .Sh HISTORY The .Nm utility first appeared in .Nx 1.1 . .Sh BUGS The initial disklabel returned by .Xr ccd 4 specifies only 3 partitions. One needs to change the number of partitions to 8 using .Dq Nm disklabel Fl e to get the usual .Bx expectations. diff --git a/sbin/newfs/runtest00.sh b/sbin/newfs/runtest00.sh index a95dbcc83b25..ea51dee8dbda 100644 --- a/sbin/newfs/runtest00.sh +++ b/sbin/newfs/runtest00.sh @@ -1,19 +1,19 @@ #!/bin/sh # $FreeBSD$ set -e MD=99 ( for s in 1m 4m 60m 120m 240m 1g do ( mdconfig -d -u $MD || true mdconfig -a -t malloc -s $s -u $MD - disklabel -r -w md$MD auto + disklabel -w md$MD auto ./newfs -R /dev/md${MD}c ) 1>&2 md5 < /dev/md${MD}c done mdconfig -d -u $MD 1>&2 || true ) diff --git a/sbin/newfs/runtest01.sh b/sbin/newfs/runtest01.sh index 47128326ed24..6fe91cb86963 100644 --- a/sbin/newfs/runtest01.sh +++ b/sbin/newfs/runtest01.sh @@ -1,27 +1,27 @@ #!/bin/sh # $FreeBSD$ set -e MD=99 ME=98 s=1m mdconfig -d -u $MD || true mdconfig -d -u $ME || true mdconfig -a -t malloc -s $s -u $MD mdconfig -a -t malloc -s $s -u $ME -disklabel -r -w md$MD auto -disklabel -r -w md$ME auto +disklabel -w md$MD auto +disklabel -w md$ME auto ./newfs -R /dev/md${MD}c ./newfs -R /dev/md${ME}c if cmp /dev/md${MD}c /dev/md${ME}c ; then echo "Test passed" e=0 else echo "Test failed" e=1 fi mdconfig -d -u $MD || true mdconfig -d -u $ME || true exit $e