1 .\" Hey, Emacs, edit this file in -*- nroff-fill -*- mode
3 .\" Copyright (c) 1997, 1998
4 .\" Nan Yang Computer Services Limited. All rights reserved.
6 .\" This software is distributed under the so-called ``Berkeley
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in the
16 .\" documentation and/or other materials provided with the distribution.
17 .\" 3. Neither the name of the Company nor the names of its contributors
18 .\" may be used to endorse or promote products derived from this software
19 .\" without specific prior written permission.
21 .\" This software is provided ``as is'', and any express or implied
22 .\" warranties, including, but not limited to, the implied warranties of
23 .\" merchantability and fitness for a particular purpose are disclaimed.
24 .\" In no event shall the company or contributors be liable for any
25 .\" direct, indirect, incidental, special, exemplary, or consequential
26 .\" damages (including, but not limited to, procurement of substitute
27 .\" goods or services; loss of use, data, or profits; or business
28 .\" interruption) however caused and on any theory of liability, whether
29 .\" in contract, strict liability, or tort (including negligence or
30 .\" otherwise) arising in any way out of the use of this software, even if
31 .\" advised of the possibility of such damage.
33 .\" $Id: vinum.8,v 1.48 2001/01/15 22:15:05 grog Exp $
34 .\" $FreeBSD: src/sbin/vinum/vinum.8,v 1.33.2.10 2002/12/29 16:35:38 schweikh Exp $
41 .Nd Logical Volume Manager control program
47 .Bl -tag -width indent
48 .It Ic attach Ar plex volume Op Cm rename
50 .Ic attach Ar subdisk plex
54 Attach a plex to a volume, or a subdisk to a plex.
56 .Ic checkparity Ar plex
60 Check the parity blocks of a RAID-4 or RAID-5 plex.
68 Create a concatenated volume from the specified drives.
74 Create a volume as described in
75 .Ar description-file .
77 Cause the volume manager to enter the kernel debugger.
85 Detach a plex or subdisk from the volume or plex to which it is attached.
86 .It Ic dumpconfig Op Ar drive ...
87 List the configuration information stored on the specified drives, or all drives
88 in the system if no drive names are specified.
94 List information about volume manager state.
102 Initialize the contents of a subdisk or all the subdisks of a plex to all zeros.
103 .It Ic label Ar volume
104 Create a volume label.
111 .Op Ar volume | plex | subdisk
113 List information about specified objects.
122 List information about drives.
131 List information about subdisks.
140 List information about plexes.
149 List information about volumes.
151 Remake the device nodes in
161 Create a mirrored volume from the specified drives.
167 Move the object(s) to the specified drive.
168 .It Ic printconfig Op Ar file
169 Write a copy of the current configuration to
174 program when running in interactive mode. Normally this would be done by
178 .It Ic read Ar disk ...
181 configuration from the specified disks.
184 .Op Ar drive | subdisk | plex | volume
187 Change the name of the specified object.
189 .\".It Ic replace Ar drive newdrive
190 .\"Move all the subdisks from the specified drive onto the new drive.
192 .Ic rebuildparity Ar plex Op Fl f
196 Rebuild the parity blocks of a RAID-4 or RAID-5 plex.
204 .Op Ar volume | plex | subdisk
206 Reset statistics counters for the specified objects, or for all objects if none
212 .Ar volume | plex | subdisk
218 configuration to disk after configuration failures.
224 .\".Ar volume | plex | subdisk | disk
226 .\"Set the state of the object to
228 .It Ic setdaemon Op Ar value
229 Set daemon configuration.
233 .Op Ar volume | plex | subdisk | drive
235 Set state without influencing other objects, for diagnostic purposes only.
237 Read configuration from all vinum drives.
243 .Ar volume | plex | subdisk
245 Allow the system to access the objects.
249 .Op Ar volume | plex | subdisk
251 Terminate access to the objects, or stop
253 if no parameters are specified.
261 Create a striped volume from the specified drives.
265 is a utility program to communicate with the
270 is designed either for interactive use, when started without command line
271 arguments, or to execute a single command if the command is supplied on the
272 command line. In interactive mode,
274 maintains a command line history.
277 commands may optionally be followed by an option. Any of the following options
278 may be specified with any command, but in some cases the options are ignored.
286 .Bl -tag -width indent
291 option overrides safety checks. Use with extreme care. This option is for
292 emergency use only. For example, the command
298 even if it is open. Any subsequent access to the volume will almost certainly
300 .It Fl i Ar millisecs
307 milliseconds between copying each block. This lowers the load on the system.
311 option to specify a volume name to the simplified configuration commands
319 option is used by the list commands to display information not
320 only about the specified objects, but also about subordinate objects. For
321 example, in conjunction with the
325 option will also show information about the plexes and subdisks belonging to the
331 option is used by the list commands to display statistical information. The
333 command also uses this option to specify that it should create striped plexes.
337 option specifies the transfer size for the
346 option can be used to request more detailed information.
351 option can be used to request more detailed information than the
360 to wait for completion of commands which normally run in the background, such as
363 .Sh COMMANDS IN DETAIL
365 commands perform the following functions:
367 .Bl -tag -width indent -compact
368 .It Ic attach Ar plex volume Op Cm rename
370 .Ic attach Ar subdisk plex
375 inserts the specified plex or subdisk in a volume or plex. In the case of a
376 subdisk, an offset in the plex may be specified. If it is not, the subdisk will
377 be attached at the first possible location. After attaching a plex to a
380 reintegrates the plex.
386 renames the object (and in the case of a plex, any subordinate subdisks) to fit
389 naming convention. To rename the object to any other name, use the
393 A number of considerations apply to attaching subdisks:
396 Subdisks can normally only be attached to concatenated plexes.
398 If a striped or RAID-5 plex is missing a subdisk (for example after drive
399 failure), it should be replaced by a subdisk of the same size only.
401 In order to add further subdisks to a striped or RAID-5 plex, use the
403 (force) option. This will corrupt the data in the plex.
404 .\"No other attachment of
405 .\"subdisks is currently allowed for striped and RAID-5 plexes.
407 For concatenated plexes, the
409 parameter specifies the offset in blocks from the beginning of the plex. For
410 striped and RAID-5 plexes, it specifies the offset of the first block of the
411 subdisk: in other words, the offset is the numerical position of the subdisk
412 multiplied by the stripe size. For example, in a plex with stripe size 271k,
413 the first subdisk will have offset 0, the second offset 271k, the third 542k,
414 etc. This calculation ignores parity blocks in RAID-5 plexes.
423 Check the parity blocks on the specified RAID-4 or RAID-5 plex. This operation
424 maintains a pointer in the plex, so it can be stopped and later restarted from
425 the same position if desired. In addition, this pointer is used by the
427 command, so rebuilding the parity blocks need only start at the location where
428 the first parity problem has been detected.
434 starts checking at the beginning of the plex. If the
438 prints a running progress report.
449 command provides a simplified alternative to the
451 command for creating volumes with a single concatenated plex. The largest
452 contiguous space available on each drive is used to create the subdisks for the
457 command creates an arbitrary name for the volume and its components. The name
458 is composed of the text
460 and a small integer, for example
462 You can override this with the
464 option, which assigns the name specified to the volume. The plexes and subdisks
465 are named after the volume in the default manner.
467 There is no choice of name for the drives. If the drives have already been
470 drives, the name remains. Otherwise the drives are given names starting with
473 and a small integer, for example
479 option can be used to specify that a previous name should be overwritten. The
481 is used to specify verbose output.
484 .Sx SIMPLIFIED CONFIGURATION
485 below for some examples of this
494 is used to create any object. In view of the relatively complicated
495 relationship and the potential dangers involved in creating a
497 object, there is no interactive interface to this function. If you do not
500 starts an editor on a temporary file. If the environment variable
504 starts this editor. If not, it defaults to
507 .Sx CONFIGURATION FILE
508 below for more information on the format of
513 function is additive: if you run it multiple times, you will create multiple
514 copies of all unnamed objects.
518 command will not change the names of existing
520 drives, in order to avoid accidentally erasing them. The correct way to dispose
523 drives is to reset the configuration with the
525 command. In some cases, however, it may be necessary to create new data on
527 drives which can no longer be started. In this case, use the
533 without any arguments, is used to enter the remote kernel debugger. It is only
538 option. This option will stop the execution of the operating system until the
539 kernel debugger is exited. If remote debugging is set and there is no remote
540 connection for a kernel debugger, it will be necessary to reset the system and
541 reboot in order to leave the debugger.
543 .It Ic debug Ar flags
544 Set a bit mask of internal debugging flags. These will change without warning
545 as the product matures; to be certain, read the header file
546 .Pa /sys/dev/raid/vinum/vinumvar.h .
547 The bit mask is composed of the following values:
548 .Bl -tag -width indent
549 .It Dv DEBUG_ADDRESSES Pq No 1
550 Show buffer information during requests
551 .\".It Dv DEBUG_NUMOUTPUT Pq No 2
553 .\".Va vp->v_numoutput .
554 .It Dv DEBUG_RESID Pq No 4
557 .It Dv DEBUG_LASTREQS Pq No 8
558 Keep a circular buffer of last requests.
559 .It Dv DEBUG_REVIVECONFLICT Pq No 16
560 Print info about revive conflicts.
561 .It Dv DEBUG_EOFINFO Pq No 32
562 Print information about internal state when returning an
565 .It Dv DEBUG_MEMFREE Pq No 64
566 Maintain a circular list of the last memory areas freed by the memory allocator.
567 .It Dv DEBUG_REMOTEGDB Pq No 256
573 .It Dv DEBUG_WARNINGS Pq No 512
574 Print some warnings about minor problems in the implementation.
577 .It Ic detach Oo Fl f Oc Ar plex
578 .It Ic detach Oo Fl f Oc Ar subdisk
580 removes the specified plex or subdisk from the volume or plex to which it is
581 attached. If removing the object would impair the data integrity of the volume,
582 the operation will fail unless the
584 option is specified. If the object is named after the object above it (for
589 the name will be changed
590 by prepending the text
593 .Li ex-vol1.p7.s0 ) .
594 If necessary, the name will be truncated in the
598 does not reduce the number of subdisks in a striped or RAID-5 plex. Instead,
599 the subdisk is marked absent, and can later be replaced with the
603 .It Ic dumpconfig Op Ar drive ...
606 shows the configuration information stored on the specified drives. If no drive
609 searches all drives on the system for Vinum partitions and dumps the
610 information. If configuration updates are disabled, it is possible that this
611 information is not the same as the information returned by the
613 command. This command is used primarily for maintenance and debugging.
617 displays information about
619 memory usage. This is intended primarily for debugging. With the
621 option, it will give detailed information about the memory areas in use.
627 displays information about the last up to 64 I/O requests handled by the
629 driver. This information is only collected if debug flag 8 is set. The format
634 Total of 38 blocks malloced, total memory: 16460
635 Maximum allocs: 56, malloc table at 0xf0f72dbc
637 Time Event Buf Dev Offset Bytes SD SDoff Doffset Goffset
639 14:40:00.637758 1VS Write 0xf2361f40 91.3 0x10 16384
640 14:40:00.639280 2LR Write 0xf2361f40 91.3 0x10 16384
641 14:40:00.639294 3RQ Read 0xf2361f40 4.39 0x104109 8192 19 0 0 0
642 14:40:00.639455 3RQ Read 0xf2361f40 4.23 0xd2109 8192 17 0 0 0
643 14:40:00.639529 3RQ Read 0xf2361f40 4.15 0x6e109 8192 16 0 0 0
644 14:40:00.652978 4DN Read 0xf2361f40 4.39 0x104109 8192 19 0 0 0
645 14:40:00.667040 4DN Read 0xf2361f40 4.15 0x6e109 8192 16 0 0 0
646 14:40:00.668556 4DN Read 0xf2361f40 4.23 0xd2109 8192 17 0 0 0
647 14:40:00.669777 6RP Write 0xf2361f40 4.39 0x104109 8192 19 0 0 0
648 14:40:00.685547 4DN Write 0xf2361f40 4.39 0x104109 8192 19 0 0 0
649 11:11:14.975184 Lock 0xc2374210 2 0x1f8001
650 11:11:15.018400 7VS Write 0xc2374210 0x7c0 32768 10
651 11:11:15.018456 8LR Write 0xc2374210 13.39 0xcc0c9 32768
652 11:11:15.046229 Unlock 0xc2374210 2 0x1f8001
657 field always contains the address of the user buffer header. This can be used
658 to identify the requests associated with a user request, though this is not 100%
659 reliable: theoretically two requests in sequence could use the same buffer
660 header, though this is not common. The beginning of a request can be identified
665 The first example above shows the requests involved in a user request. The
666 second is a subdisk I/O request with locking.
670 field contains information related to the sequence of events in the request
675 indicates the approximate sequence of events, and the two-letter abbreviation is
676 a mnemonic for the location:
677 .Bl -tag -width Lockwait
679 (vinumstrategy) shows information about the user request on entry to
681 The device number is the
683 device, and offset and length are the user parameters. This is always the
684 beginning of a request sequence.
686 (launch_requests) shows the user request just prior to launching the low-level
688 requests in the function
689 .Fn launch_requests .
690 The parameters should be the same as in the
695 In the following requests,
697 is the device number of the associated disk partition,
699 is the offset from the beginning of the partition,
701 is the subdisk index in
704 is the offset from the beginning of the subdisk,
706 is the offset of the associated data request, and
708 is the offset of the associated group request, where applicable.
709 .Bl -tag -width Lockwait
711 (request) shows one of possibly several low-level
713 requests which are launched to satisfy the high-level request. This information
715 .Fn launch_requests .
717 (done) is called from
719 showing the completion of a request. This completion should match a request
720 launched either at stage
723 .Fn launch_requests ,
725 .Fn complete_raid5_write
731 (RAID-5 data) is called from
732 .Fn complete_raid5_write
733 and represents the data written to a RAID-5 data stripe after calculating
736 (RAID-5 parity) is called from
737 .Fn complete_raid5_write
738 and represents the data written to a RAID-5 parity stripe after calculating
741 shows a subdisk I/O request. These requests are usually internal to
743 for operations like initialization or rebuilding plexes.
745 shows the low-level operation generated for a subdisk I/O request.
747 specifies that the process is waiting for a range lock. The parameters are the
748 buffer header associated with the request, the plex number and the block number.
749 For internal reasons the block number is one higher than the address of the
750 beginning of the stripe.
752 specifies that a range lock has been obtained. The parameters are the same as
755 specifies that a range lock has been released. The parameters are the same as
767 initializes a subdisk by writing zeroes to it. You can initialize all subdisks
768 in a plex by specifying the plex name. This is the only way to ensure
769 consistent data in a plex. You must perform this initialization before using a
770 RAID-5 plex. It is also recommended for other new plexes.
772 initializes all subdisks of a plex in parallel. Since this operation can take a
773 long time, it is normally performed in the background. If you want to wait for
774 completion of the command, use the
780 option if you want to write blocks of a different size from the default value of
783 prints a console message when the initialization is complete.
785 .It Ic label Ar volume
790 style volume label on a volume. It is a simple alternative to an appropriate
793 This is needed because some
795 commands still read the disk to find the label instead of using the correct
799 maintains a volume label separately from the volume data, so this command is not
802 This command is deprecated.
808 .Op Ar volume | plex | subdisk
814 .Op Ar volume | plex | subdisk
849 is used to show information about the specified object. If the argument is
850 omitted, information is shown about all objects known to
854 command is a synonym for
859 option relates to volumes and plexes: if specified, it recursively lists
860 information for the subdisks and (for a volume) plexes subordinate to the
861 objects. The commands
865 list only volumes, plexes, subdisks and drives respectively. This is
866 particularly useful when used without parameters.
872 to output device statistics, the
874 (verbose) option causes some additional information to be output, and the
876 causes considerable additional information to be output.
881 command removes the directory
883 and recreates it with device nodes
884 which reflect the current configuration. This command is not intended for
885 general use, and is provided for emergency use only.
897 command provides a simplified alternative to the
899 command for creating mirrored volumes. Without any options, it creates a RAID-1
900 (mirrored) volume with two concatenated plexes. The largest contiguous space
901 available on each drive is used to create the subdisks for the plexes. The
902 first plex is built from the odd-numbered drives in the list, and the second
903 plex is built from the even-numbered drives. If the drives are of different
904 sizes, the plexes will be of different sizes.
910 builds striped plexes with a stripe size of 256 kB. The size of the subdisks in
911 each plex is the size of the smallest contiguous storage available on any of the
912 drives which form the plex. Again, the plexes may differ in size.
916 command creates an arbitrary name for the volume and its components. The name
917 is composed of the text
919 and a small integer, for example
921 You can override this with the
923 option, which assigns the name specified to the volume. The plexes and subdisks
924 are named after the volume in the default manner.
926 There is no choice of name for the drives. If the drives have already been
929 drives, the name remains. Otherwise the drives are given names starting with
932 and a small integer, for example
938 option can be used to specify that a previous name should be overwritten. The
940 is used to specify verbose output.
943 .Sx SIMPLIFIED CONFIGURATION
944 below for some examples of this
947 .It Ic mv Fl f Ar drive object ...
948 .It Ic move Fl f Ar drive object ...
949 Move all the subdisks from the specified objects onto the new drive. The
950 objects may be subdisks, drives or plexes. When drives or plexes are specified,
951 all subdisks associated with the object are moved.
955 option is required for this function, since it currently does not preserve the
956 data in the subdisk. This functionality will be added at a later date. In this
957 form, however, it is suited to recovering a failed disk drive.
959 .It Ic printconfig Op Ar file
960 Write a copy of the current configuration to
962 in a format that can be used to recreate the
964 configuration. Unlike the configuration saved on disk, it includes definitions
965 of the drives. If you omit
974 program when running in interactive mode. Normally this would be done by
979 .It Ic read Ar disk ...
982 command scans the specified disks for
984 partitions containing previously created configuration information. It reads
985 the configuration in order from the most recently updated to least recently
986 updated configuration.
988 maintains an up-to-date copy of all configuration information on each disk
989 partition. You must specify all of the slices in a configuration as the
990 parameter to this command.
994 command is intended to selectively load a
996 configuration on a system which has other
998 partitions. If you want to start all partitions on the system, it is easier to
1005 encounters any errors during this command, it will turn off automatic
1006 configuration update to avoid corrupting the copies on disk. This will also
1007 happen if the configuration on disk indicates a configuration error (for
1008 example, subdisks which do not have a valid space specification). You can turn
1009 the updates on again with the
1013 commands. Reset bit 2 (numerical value 4) of the daemon options mask to
1014 re-enable configuration saves.
1023 Rebuild the parity blocks on the specified RAID-4 or RAID-5 plex. This
1024 operation maintains a pointer in the plex, so it can be stopped and later
1025 restarted from the same position if desired. In addition, this pointer is used
1028 command, so rebuilding the parity blocks need only start at the location where
1029 the first parity problem has been detected.
1035 starts rebuilding at the beginning of the plex. If the
1039 first checks the existing parity blocks prints information about those found to
1040 be incorrect before rebuilding. If the
1044 prints a running progress report.
1049 .Op Ar drive | subdisk | plex | volume
1052 Change the name of the specified object. If the
1054 option is specified, subordinate objects will be named by the default rules:
1055 plex names will be formed by appending
1057 to the volume name, and
1058 subdisk names will be formed by appending
1064 .\".Ar drive newdrive
1065 .\"Move all the subdisks from the specified drive onto the new drive. This will
1066 .\"attempt to recover those subdisks that can be recovered, and create the others
1067 .\"from scratch. If the new drive lacks the space for this operation, as many
1068 .\"subdisks as possible will be fitted onto the drive, and the rest will be left on
1069 .\"the original drive.
1074 command completely obliterates the
1076 configuration on a system. Use this command only when you want to completely
1077 delete the configuration.
1079 will ask for confirmation; you must type in the words
1082 .Bd -unfilled -offset indent
1083 .No # Nm Ic resetconfig
1085 WARNING! This command will completely wipe out your vinum
1086 configuration. All data will be lost. If you really want
1087 to do this, enter the text
1090 .No "Enter text ->" Sy "NO FUTURE"
1091 Vinum configuration obliterated
1094 As the message suggests, this is a last-ditch command. Don't use it unless you
1095 have an existing configuration which you never want to see again.
1100 .Op Ar volume | plex | subdisk
1103 maintains a number of statistical counters for each object. See the header file
1104 .Pa /sys/dev/raid/vinum/vinumvar.h
1105 for more information.
1106 .\" XXX put it in here when it's finalized
1109 command to reset these counters. In conjunction with the
1113 also resets the counters of subordinate objects.
1119 .Ar volume | plex | subdisk
1122 removes an object from the
1124 configuration. Once an object has been removed, there is no way to recover it.
1127 performs a large amount of consistency checking before removing an object. The
1131 to omit this checking and remove the object anyway. Use this option with great
1132 care: it can result in total loss of data on a volume.
1136 refuses to remove a volume or plex if it has subordinate plexes or subdisks
1137 respectively. You can tell
1139 to remove the object anyway by using the
1141 option, or you can cause
1143 to remove the subordinate objects as well by using the
1145 (recursive) option. If you remove a volume with the
1147 option, it will remove both the plexes and the subdisks which belong to the
1151 Save the current configuration to disk. Normally this is not necessary, since
1153 automatically saves any change in configuration. If an error occurs on startup,
1154 updates will be disabled. When you reenable them with the
1158 does not automatically save the configuration to disk. Use this command to save
1165 .\".Ar volume | plex | subdisk | disk
1168 .\"sets the state of the specified object to one of the valid states (see
1169 .\".Sx OBJECT STATES
1172 .\"performs a large amount of consistency checking before making the change. The
1176 .\"to omit this checking and perform the change anyway. Use this option with great
1177 .\"care: it can result in total loss of data on a volume.
1179 .It Ic setdaemon Op Ar value
1181 sets a variable bitmask for the
1183 daemon. This command is temporary and will be replaced. Currently, the bit mask
1184 may contain the bits 1 (log every action to syslog) and 4 (don't update
1185 configuration). Option bit 4 can be useful for error recovery.
1188 .Ic setstate Ar state
1189 .Op Ar volume | plex | subdisk | drive
1192 sets the state of the specified objects to the specified state. This bypasses
1193 the usual consistency mechanism of
1195 and should be used only for recovery purposes. It is possible to crash the
1196 system by incorrect use of this command.
1200 .Op Fl i Ar interval
1203 .Op Ar plex | subdisk
1206 starts (brings into to the
1212 If no object names are specified,
1214 scans the disks known to the system for
1216 drives and then reads in the configuration as described under the
1220 drive contains a header with all information about the data stored on the drive,
1221 including the names of the other drives which are required in order to represent
1226 encounters any errors during this command, it will turn off automatic
1227 configuration update to avoid corrupting the copies on disk. This will also
1228 happen if the configuration on disk indicates a configuration error (for
1229 example, subdisks which do not have a valid space specification). You can turn
1230 the updates on again with the
1234 command. Reset bit 4 of the daemon options mask to re-enable configuration
1237 If object names are specified,
1239 starts them. Normally this operation is only of use with subdisks. The action
1240 depends on the current state of the object:
1243 If the object is already in the
1249 If the object is a subdisk in the
1259 If the object is a subdisk in the
1261 state, the change depends on the subdisk. If it is part of a plex which is part
1262 of a volume which contains other plexes,
1264 places the subdisk in the
1266 state and attempts to copy the data from the volume. When the operation
1267 completes, the subdisk is set into the
1269 state. If it is part of a plex which is part of a volume which contains no
1270 other plexes, or if it is not part of a plex,
1276 If the object is a subdisk in the
1280 continues the revive
1281 operation offline. When the operation completes, the subdisk is set into the
1286 When a subdisk comes into the
1290 automatically checks the state of any plex and volume to which it may belong and
1291 changes their state where appropriate.
1293 If the object is a plex,
1295 checks the state of the subordinate subdisks (and plexes in the case of a
1296 volume) and starts any subdisks which can be started.
1298 To start a plex in a multi-plex volume, the data must be copied from another
1299 plex in the volume. Since this frequently takes a long time, it is normally
1300 done in the background. If you want to wait for this operation to complete (for
1301 example, if you are performing this operation in a script), use the
1305 Copying data doesn't just take a long time, it can also place a significant load
1306 on the system. You can specify the transfer size in bytes or sectors with the
1308 option, and an interval (in milliseconds) to wait between copying each block with
1311 option. Both of these options lessen the load on the system.
1316 .Op Ar volume | plex | subdisk
1318 If no parameters are specified,
1324 This can only be done if no objects are active. In particular, the
1326 option does not override this requirement. Normally, the
1328 command writes the current configuration back to the drives before terminating.
1329 This will not be possible if configuration updates are disabled, so
1331 will not stop if configuration updates are disabled. You can override this by
1338 command can only work if
1340 has been loaded as a KLD, since it is not possible to unload a statically
1345 is statically configured.
1347 If object names are specified,
1349 disables access to the objects. If the objects have subordinate objects, they
1350 subordinate objects must either already be inactive (stopped or in error), or
1355 options must be specified. This command does not remove the objects from the
1356 configuration. They can be accessed again after a
1362 does not stop active objects. For example, you cannot stop a plex which is
1363 attached to an active volume, and you cannot stop a volume which is open. The
1367 to omit this checking and remove the object anyway. Use this option with great
1368 care and understanding: used incorrectly, it can result in serious data
1380 command provides a simplified alternative to the
1382 command for creating volumes with a single striped plex. The size of the
1383 subdisks is the size of the largest contiguous space available on all the
1384 specified drives. The stripe size is fixed at 256 kB.
1388 command creates an arbitrary name for the volume and its components. The name
1389 is composed of the text
1391 and a small integer, for example
1393 You can override this with the
1395 option, which assigns the name specified to the volume. The plexes and subdisks
1396 are named after the volume in the default manner.
1398 There is no choice of name for the drives. If the drives have already been
1401 drives, the name remains. Otherwise the drives are given names starting with
1404 and a small integer, for example
1405 .Dq Li vinumdrive7 .
1410 option can be used to specify that a previous name should be overwritten. The
1412 is used to specify verbose output.
1415 .Sx SIMPLIFIED CONFIGURATION
1416 below for some examples of this
1419 .Sh SIMPLIFIED CONFIGURATION
1420 This section describes a simplified interface to
1422 configuration using the
1427 commands. These commands create convenient configurations for some more normal
1428 situations, but they are not as flexible as the
1432 See above for the description of the commands. Here are some examples, all
1433 performed with the same collection of disks. Note that the first drive,
1435 is smaller than the others. This has an effect on the sizes chosen for each
1438 The following examples all use the
1440 option to show the commands passed to the system, and also to list the structure
1441 of the volume. Without the
1443 option, these commands produce no output.
1444 .Ss Volume with a single concatenated plex
1445 Use a volume with a single concatenated plex for the largest possible storage
1446 without resilience to drive failures:
1448 vinum -> concat -v /dev/da1s0h /dev/da2s0h /dev/da3s0h /dev/da4s0h
1450 plex name vinum0.p0 org concat
1451 drive vinumdrive0 device /dev/da1s0h
1452 sd name vinum0.p0.s0 drive vinumdrive0 size 0
1453 drive vinumdrive1 device /dev/da2s0h
1454 sd name vinum0.p0.s1 drive vinumdrive1 size 0
1455 drive vinumdrive2 device /dev/da3s0h
1456 sd name vinum0.p0.s2 drive vinumdrive2 size 0
1457 drive vinumdrive3 device /dev/da4s0h
1458 sd name vinum0.p0.s3 drive vinumdrive3 size 0
1459 V vinum0 State: up Plexes: 1 Size: 2134 MB
1460 P vinum0.p0 C State: up Subdisks: 4 Size: 2134 MB
1461 S vinum0.p0.s0 State: up PO: 0 B Size: 414 MB
1462 S vinum0.p0.s1 State: up PO: 414 MB Size: 573 MB
1463 S vinum0.p0.s2 State: up PO: 988 MB Size: 573 MB
1464 S vinum0.p0.s3 State: up PO: 1561 MB Size: 573 MB
1467 In this case, the complete space on all four disks was used, giving a volume
1469 .Ss Volume with a single striped plex
1470 A volume with a single striped plex may give better performance than a
1471 concatenated plex, but restrictions on striped plexes can mean that the volume
1472 is smaller. It will also not be resilient to a drive failure:
1474 vinum -> stripe -v /dev/da1s0h /dev/da2s0h /dev/da3s0h /dev/da4s0h
1475 drive vinumdrive0 device /dev/da1s0h
1476 drive vinumdrive1 device /dev/da2s0h
1477 drive vinumdrive2 device /dev/da3s0h
1478 drive vinumdrive3 device /dev/da4s0h
1480 plex name vinum0.p0 org striped 256k
1481 sd name vinum0.p0.s0 drive vinumdrive0 size 849825b
1482 sd name vinum0.p0.s1 drive vinumdrive1 size 849825b
1483 sd name vinum0.p0.s2 drive vinumdrive2 size 849825b
1484 sd name vinum0.p0.s3 drive vinumdrive3 size 849825b
1485 V vinum0 State: up Plexes: 1 Size: 1659 MB
1486 P vinum0.p0 S State: up Subdisks: 4 Size: 1659 MB
1487 S vinum0.p0.s0 State: up PO: 0 B Size: 414 MB
1488 S vinum0.p0.s1 State: up PO: 256 kB Size: 414 MB
1489 S vinum0.p0.s2 State: up PO: 512 kB Size: 414 MB
1490 S vinum0.p0.s3 State: up PO: 768 kB Size: 414 MB
1493 In this case, the size of the subdisks has been limited to the smallest
1494 available disk, so the resulting volume is only 1659 MB in size.
1495 .Ss Mirrored volume with two concatenated plexes
1496 For more reliability, use a mirrored, concatenated volume:
1498 vinum -> mirror -v -n mirror /dev/da1s0h /dev/da2s0h /dev/da3s0h /dev/da4s0h
1499 drive vinumdrive0 device /dev/da1s0h
1500 drive vinumdrive1 device /dev/da2s0h
1501 drive vinumdrive2 device /dev/da3s0h
1502 drive vinumdrive3 device /dev/da4s0h
1503 volume mirror setupstate
1504 plex name mirror.p0 org concat
1505 sd name mirror.p0.s0 drive vinumdrive0 size 0b
1506 sd name mirror.p0.s1 drive vinumdrive2 size 0b
1507 plex name mirror.p1 org concat
1508 sd name mirror.p1.s0 drive vinumdrive1 size 0b
1509 sd name mirror.p1.s1 drive vinumdrive3 size 0b
1510 V mirror State: up Plexes: 2 Size: 1146 MB
1511 P mirror.p0 C State: up Subdisks: 2 Size: 988 MB
1512 P mirror.p1 C State: up Subdisks: 2 Size: 1146 MB
1513 S mirror.p0.s0 State: up PO: 0 B Size: 414 MB
1514 S mirror.p0.s1 State: up PO: 414 MB Size: 573 MB
1515 S mirror.p1.s0 State: up PO: 0 B Size: 573 MB
1516 S mirror.p1.s1 State: up PO: 573 MB Size: 573 MB
1519 This example specifies the name of the volume,
1521 Since one drive is smaller than the others, the two plexes are of different
1522 size, and the last 158 MB of the volume is non-resilient. To ensure complete
1523 reliability in such a situation, use the
1525 command to create a volume with 988 MB.
1526 .Ss Mirrored volume with two striped plexes
1527 Alternatively, use the
1529 option to create a mirrored volume with two striped plexes:
1531 vinum -> mirror -v -n raid10 -s /dev/da1s0h /dev/da2s0h /dev/da3s0h /dev/da4s0h
1532 drive vinumdrive0 device /dev/da1s0h
1533 drive vinumdrive1 device /dev/da2s0h
1534 drive vinumdrive2 device /dev/da3s0h
1535 drive vinumdrive3 device /dev/da4s0h
1536 volume raid10 setupstate
1537 plex name raid10.p0 org striped 256k
1538 sd name raid10.p0.s0 drive vinumdrive0 size 849825b
1539 sd name raid10.p0.s1 drive vinumdrive2 size 849825b
1540 plex name raid10.p1 org striped 256k
1541 sd name raid10.p1.s0 drive vinumdrive1 size 1173665b
1542 sd name raid10.p1.s1 drive vinumdrive3 size 1173665b
1543 V raid10 State: up Plexes: 2 Size: 1146 MB
1544 P raid10.p0 S State: up Subdisks: 2 Size: 829 MB
1545 P raid10.p1 S State: up Subdisks: 2 Size: 1146 MB
1546 S raid10.p0.s0 State: up PO: 0 B Size: 414 MB
1547 S raid10.p0.s1 State: up PO: 256 kB Size: 414 MB
1548 S raid10.p1.s0 State: up PO: 0 B Size: 573 MB
1549 S raid10.p1.s1 State: up PO: 256 kB Size: 573 MB
1552 In this case, the usable part of the volume is even smaller, since the first
1553 plex has shrunken to match the smallest drive.
1554 .Sh CONFIGURATION FILE
1556 requires that all parameters to the
1558 commands must be in a configuration file. Entries in the configuration file
1559 define volumes, plexes and subdisks, and may be in free format, except that each
1560 entry must be on a single line.
1562 Some configuration file parameters specify a size (lengths, stripe sizes).
1563 These values can be specified as bytes, or one of the following scale factors
1565 .Bl -tag -width indent
1567 specifies that the value is a number of sectors of 512 bytes.
1569 specifies that the value is a number of kilobytes (1024 bytes).
1571 specifies that the value is a number of megabytes (1048576 bytes).
1573 specifies that the value is a number of gigabytes (1073741824 bytes).
1575 is used for compatibility with
1577 It stands for blocks of 512 bytes.
1578 This abbreviation is confusing, since the word
1580 is used in different
1581 meanings, and its use is deprecated.
1584 For example, the value 16777216 bytes can also be written as
1590 The configuration file can contain the following entries:
1592 .It Ic drive Ar name devicename Op Ar options
1593 Define a drive. The options are:
1595 .It Cm device Ar devicename
1596 Specify the device on which the drive resides.
1598 must be the name of a disk partition, for example
1602 and it must be of type
1606 partition, which is reserved for the complete disk.
1608 Define the drive to be a
1610 drive, which is maintained to automatically replace a failed drive.
1612 does not allow this drive to be used for any other purpose. In particular, it
1613 is not possible to create subdisks on it. This functionality has not been
1614 completely implemented.
1616 .It Ic volume Ar name Op Ar options
1617 Define a volume with name
1621 .It Cm plex Ar plexname
1622 Add the specified plex to the volume. If
1627 will look for the definition of the plex as the next possible entry in the
1628 configuration file after the definition of the volume.
1629 .It Cm readpol Ar policy
1637 .Cm prefer Ar plexname .
1639 satisfies a read request from only one of the plexes. A
1641 read policy specifies that each read should be performed from a different plex
1646 read policy reads from the specified plex every time.
1648 When creating a multi-plex volume, assume that the contents of all the plexes
1649 are consistent. This is normally not the case, so by default
1651 sets all plexes except the first one to the
1655 command to first bring them to a consistent state. In the case of striped and
1656 concatenated plexes, however, it does not normally cause problems to leave them
1657 inconsistent: when using a volume for a file system or a swap partition, the
1658 previous contents of the disks are not of interest, so they may be ignored.
1659 If you want to take this risk, use the
1661 keyword. It will only apply to the plexes defined immediately after the volume
1662 in the configuration file. If you add plexes to a volume at a later time, you
1663 must integrate them manually with the
1671 command with RAID-5 plexes: otherwise extreme data corruption will result if one
1674 .It Ic plex Op Ar options
1675 Define a plex. Unlike a volume, a plex does not need a name. The options may
1678 .It Cm name Ar plexname
1679 Specify the name of the plex. Note that you must use the keyword
1681 when naming a plex or subdisk.
1682 .It Cm org Ar organization Op Ar stripesize
1683 Specify the organization of the plex.
1686 .Cm concat , striped
1693 plexes, the parameter
1695 must be specified, while for
1697 it must be omitted. For type
1699 it specifies the width of each stripe. For type
1701 it specifies the size of a group. A group is a portion of a plex which
1702 stores the parity bits all in the same subdisk. It must be a factor of the plex size (in
1703 other words, the result of dividing the plex size by the stripe size must be an
1704 integer), and it must be a multiple of a disk sector (512 bytes).
1706 For optimum performance, stripes should be at least 128 kB in size: anything
1707 smaller will result in a significant increase in I/O activity due to mapping of
1708 individual requests over multiple disks. The performance improvement due to the
1709 increased number of concurrent transfers caused by this mapping will not make up
1710 for the performance drop due to the increase in latency. A good guideline for
1711 stripe size is between 256 kB and 512 kB. Avoid powers of 2, however: they tend
1712 to cause all superblocks to be placed on the first subdisk.
1714 A striped plex must have at least two subdisks (otherwise it is a concatenated
1715 plex), and each must be the same size. A RAID-5 plex must have at least three
1716 subdisks, and each must be the same size. In practice, a RAID-5 plex should
1717 have at least 5 subdisks.
1718 .It Cm volume Ar volname
1719 Add the plex to the specified volume. If no
1721 keyword is specified, the plex will be added to the last volume mentioned in the
1723 .It Cm sd Ar sdname offset
1724 Add the specified subdisk to the plex at offset
1727 .It Ic subdisk Op Ar options
1728 Define a subdisk. Options may be:
1729 .Bl -hang -width 18n
1731 Specify the name of a subdisk. It is not necessary to specify a name for a
1733 Note that you must specify the keyword
1735 if you wish to name a subdisk.
1736 .It Cm plexoffset Ar offset
1737 Specify the starting offset of the subdisk in the plex. If not specified,
1739 allocates the space immediately after the previous subdisk, if any, or otherwise
1740 at the beginning of the plex.
1741 .It Cm driveoffset Ar offset
1742 Specify the starting offset of the subdisk in the drive. If not specified,
1744 allocates the first contiguous
1746 bytes of free space on the drive.
1747 .It Cm length Ar length
1748 Specify the length of the subdisk. This keyword must be specified. There is no
1749 default, but the value 0 may be specified to mean
1750 .Dq "use the largest available contiguous free area on the drive" .
1751 If the drive is empty, this means that the entire drive will be used for the
1757 Specify the plex to which the subdisk belongs. By default, the subdisk belongs
1758 to the last plex specified.
1759 .It Cm drive Ar drive
1760 Specify the drive on which the subdisk resides. By default, the subdisk resides
1761 on the last drive specified.
1764 .Sh EXAMPLE CONFIGURATION FILE
1766 # Sample vinum configuration file
1769 drive drive1 device /dev/da1s0h
1770 drive drive2 device /dev/da2s0h
1771 drive drive3 device /dev/da3s0h
1772 drive drive4 device /dev/da4s0h
1773 drive drive5 device /dev/da5s0h
1774 drive drive6 device /dev/da6s0h
1775 # A volume with one striped plex
1777 plex org striped 512b
1778 sd length 64m drive drive2
1779 sd length 64m drive drive4
1781 plex org striped 512b
1782 sd length 512m drive drive2
1783 sd length 512m drive drive4
1787 sd length 100m drive drive2
1788 sd length 50m drive drive4
1790 sd length 150m drive drive4
1791 # A volume with one striped plex and one concatenated plex
1793 plex org striped 512b
1794 sd length 100m drive drive2
1795 sd length 100m drive drive4
1797 sd length 150m drive drive2
1798 sd length 50m drive drive4
1799 # a volume with a RAID-5 and a striped plex
1800 # note that the RAID-5 volume is longer by
1801 # the length of one subdisk
1803 plex org striped 64k
1804 sd length 1000m drive drive2
1805 sd length 1000m drive drive4
1807 sd length 500m drive drive1
1808 sd length 500m drive drive2
1809 sd length 500m drive drive3
1810 sd length 500m drive drive4
1811 sd length 500m drive drive5
1813 .Sh DRIVE LAYOUT CONSIDERATIONS
1815 drives are currently
1817 disk partitions. They must be of type
1819 in order to avoid overwriting data used for other purposes. Use
1821 to edit a partition type definition. The following display shows a typical
1822 partition layout as shown by
1826 # size offset fstype
1827 a: 81920 344064 4.2BSD # 40.000M
1828 b: 262144 81920 swap # 128.000M
1829 c: 4226725 0 unused # 2063.830M
1830 e: 81920 0 4.2BSD # 40.000M
1831 f: 1900000 425984 4.2BSD # 927.734M
1832 g: 1900741 2325984 vinum # 928.095M
1835 In this example, partition
1839 partition. Partitions
1849 is a swap partition, and partition
1851 represents the whole disk and should not be used for any other purpose.
1854 uses the first 265 sectors on each partition for configuration information, so
1855 the maximum size of a subdisk is 265 sectors smaller than the drive.
1858 maintains a log file, by default
1859 .Pa /var/tmp/vinum_history ,
1860 in which it keeps track of the commands issued to
1862 You can override the name of this file by setting the environment variable
1864 to the name of the file.
1866 Each message in the log file is preceded by a date. The default format is
1867 .Qq Li %e %b %Y %H:%M:%S .
1870 for further details of the format string. It can be overridden by the
1871 environment variable
1872 .Ev VINUM_DATEFORMAT .
1873 .Sh HOW TO SET UP VINUM
1874 This section gives practical advice about how to implement a
1877 .Ss Where to put the data
1878 The first choice you need to make is where to put the data. You need dedicated
1881 They should be partitions, not devices, and they should not be partition
1883 For example, good names are
1891 both of which represent a device, not a partition, and
1893 which represents a complete disk and should be of type
1895 See the example under
1896 .Sx DRIVE LAYOUT CONSIDERATIONS
1898 .Ss Designing volumes
1901 volumes depends on your intentions. There are a number of possibilities:
1904 You may want to join up a number of small disks to make a reasonable sized file
1905 system. For example, if you had five small drives and wanted to use all the
1906 space for a single volume, you might write a configuration file like:
1907 .Bd -literal -offset indent
1908 drive d1 device /dev/da2s0e
1909 drive d2 device /dev/da3s0e
1910 drive d3 device /dev/da4s0e
1911 drive d4 device /dev/da5s0e
1912 drive d5 device /dev/da6s0e
1915 sd length 0 drive d1
1916 sd length 0 drive d2
1917 sd length 0 drive d3
1918 sd length 0 drive d4
1919 sd length 0 drive d5
1922 In this case, you specify the length of the subdisks as 0, which means
1923 .Dq "use the largest area of free space that you can find on the drive" .
1924 If the subdisk is the only subdisk on the drive, it will use all available
1929 to obtain additional resilience against disk failures. You have the choice of
1932 or RAID-5, also called
1935 To set up mirroring, create multiple plexes in a volume. For example, to create
1936 a mirrored volume of 2 GB, you might create the following configuration file:
1937 .Bd -literal -offset indent
1938 drive d1 device /dev/da2s0e
1939 drive d2 device /dev/da3s0e
1942 sd length 2g drive d1
1944 sd length 2g drive d2
1947 When creating mirrored drives, it is important to ensure that the data from each
1948 plex is on a different physical disk so that
1950 can access the complete address space of the volume even if a drive fails.
1951 Note that each plex requires as much data as the complete volume: in this
1952 example, the volume has a size of 2 GB, but each plex (and each subdisk)
1953 requires 2 GB, so the total disk storage requirement is 4 GB.
1955 To set up RAID-5, create a single plex of type
1957 For example, to create an equivalent resilient volume of 2 GB, you might use the
1958 following configuration file:
1959 .Bd -literal -offset indent
1960 drive d1 device /dev/da2s0e
1961 drive d2 device /dev/da3s0e
1962 drive d3 device /dev/da4s0e
1963 drive d4 device /dev/da5s0e
1964 drive d5 device /dev/da6s0e
1967 sd length 512m drive d1
1968 sd length 512m drive d2
1969 sd length 512m drive d3
1970 sd length 512m drive d4
1971 sd length 512m drive d5
1974 RAID-5 plexes require at least three subdisks, one of which is used for storing
1975 parity information and is lost for data storage. The more disks you use, the
1976 greater the proportion of the disk storage can be used for data storage. In
1977 this example, the total storage usage is 2.5 GB, compared to 4 GB for a mirrored
1978 configuration. If you were to use the minimum of only three disks, you would
1979 require 3 GB to store the information, for example:
1980 .Bd -literal -offset indent
1981 drive d1 device /dev/da2s0e
1982 drive d2 device /dev/da3s0e
1983 drive d3 device /dev/da4s0e
1986 sd length 1g drive d1
1987 sd length 1g drive d2
1988 sd length 1g drive d3
1991 As with creating mirrored drives, it is important to ensure that the data from
1992 each subdisk is on a different physical disk so that
1994 can access the complete address space of the volume even if a drive fails.
1998 to allow more concurrent access to a file system. In many cases, access to a
1999 file system is limited by the speed of the disk. By spreading the volume across
2000 multiple disks, you can increase the throughput in multi-access environments.
2001 This technique shows little or no performance improvement in single-access
2004 uses a technique called
2006 or sometimes RAID-0, to increase this concurrency of access. The name RAID-0 is
2007 misleading: striping does not provide any redundancy or additional reliability.
2008 In fact, it decreases the reliability, since the failure of a single disk will
2009 render the volume useless, and the more disks you have, the more likely it is
2010 that one of them will fail.
2012 To implement striping, use a
2015 .Bd -literal -offset indent
2016 drive d1 device /dev/da2s0e
2017 drive d2 device /dev/da3s0e
2018 drive d3 device /dev/da4s0e
2019 drive d4 device /dev/da5s0e
2021 plex org striped 512k
2022 sd length 512m drive d1
2023 sd length 512m drive d2
2024 sd length 512m drive d3
2025 sd length 512m drive d4
2028 A striped plex must have at least two subdisks, but the increase in performance
2029 is greater if you have a larger number of disks.
2031 You may want to have the best of both worlds and have both resilience and
2032 performance. This is sometimes called RAID-10 (a combination of RAID-1 and
2033 RAID-0), though again this name is misleading. With
2035 you can do this with the following configuration file:
2036 .Bd -literal -offset indent
2037 drive d1 device /dev/da2s0e
2038 drive d2 device /dev/da3s0e
2039 drive d3 device /dev/da4s0e
2040 drive d4 device /dev/da5s0e
2041 volume raid setupstate
2042 plex org striped 512k
2043 sd length 512m drive d1
2044 sd length 512m drive d2
2045 sd length 512m drive d3
2046 sd length 512m drive d4
2047 plex org striped 512k
2048 sd length 512m drive d4
2049 sd length 512m drive d3
2050 sd length 512m drive d2
2051 sd length 512m drive d1
2054 Here the plexes are striped, increasing performance, and there are two of them,
2055 increasing reliability. Note that this example shows the subdisks of the second
2056 plex in reverse order from the first plex. This is for performance reasons and
2057 will be discussed below. In addition, the volume specification includes the
2060 which ensures that all plexes are
2064 .Ss Creating the volumes
2065 Once you have created your configuration files, start
2067 and create the volumes. In this example, the configuration is in the file
2069 .Bd -literal -offset 2n
2070 # vinum create -v configfile
2071 1: drive d1 device /dev/da2s0e
2072 2: drive d2 device /dev/da3s0e
2075 5: sd length 2g drive d1
2077 7: sd length 2g drive d2
2078 Configuration summary
2080 Drives: 2 (4 configured)
2081 Volumes: 1 (4 configured)
2082 Plexes: 2 (8 configured)
2083 Subdisks: 2 (16 configured)
2085 Drive d1: Device /dev/da2s0e
2086 Created on vinum.lemis.com at Tue Mar 23 12:30:31 1999
2087 Config last updated Tue Mar 23 14:30:32 1999
2088 Size: 60105216000 bytes (57320 MB)
2089 Used: 2147619328 bytes (2048 MB)
2090 Available: 57957596672 bytes (55272 MB)
2093 Drive d2: Device /dev/da3s0e
2094 Created on vinum.lemis.com at Tue Mar 23 12:30:32 1999
2095 Config last updated Tue Mar 23 14:30:33 1999
2096 Size: 60105216000 bytes (57320 MB)
2097 Used: 2147619328 bytes (2048 MB)
2098 Available: 57957596672 bytes (55272 MB)
2102 Volume mirror: Size: 2147483648 bytes (2048 MB)
2106 Read policy: round robin
2108 Plex mirror.p0: Size: 2147483648 bytes (2048 MB)
2111 Organization: concat
2112 Part of volume mirror
2113 Plex mirror.p1: Size: 2147483648 bytes (2048 MB)
2116 Organization: concat
2117 Part of volume mirror
2119 Subdisk mirror.p0.s0:
2120 Size: 2147483648 bytes (2048 MB)
2122 Plex mirror.p0 at offset 0
2124 Subdisk mirror.p1.s0:
2125 Size: 2147483648 bytes (2048 MB)
2127 Plex mirror.p1 at offset 0
2134 to list the file as it configures. Subsequently it lists the current
2135 configuration in the same format as the
2138 .Ss Creating more volumes
2139 Once you have created the
2143 keeps track of them in its internal configuration files. You do not need to
2144 create them again. In particular, if you run the
2146 command again, you will create additional objects:
2148 # vinum create sampleconfig
2149 Configuration summary
2151 Drives: 2 (4 configured)
2152 Volumes: 1 (4 configured)
2153 Plexes: 4 (8 configured)
2154 Subdisks: 4 (16 configured)
2156 D d1 State: up Device /dev/da2s0e Avail: 53224/57320 MB (92%)
2157 D d2 State: up Device /dev/da3s0e Avail: 53224/57320 MB (92%)
2159 V mirror State: up Plexes: 4 Size: 2048 MB
2161 P mirror.p0 C State: up Subdisks: 1 Size: 2048 MB
2162 P mirror.p1 C State: up Subdisks: 1 Size: 2048 MB
2163 P mirror.p2 C State: up Subdisks: 1 Size: 2048 MB
2164 P mirror.p3 C State: up Subdisks: 1 Size: 2048 MB
2166 S mirror.p0.s0 State: up PO: 0 B Size: 2048 MB
2167 S mirror.p1.s0 State: up PO: 0 B Size: 2048 MB
2168 S mirror.p2.s0 State: up PO: 0 B Size: 2048 MB
2169 S mirror.p3.s0 State: up PO: 0 B Size: 2048 MB
2172 As this example (this time with the
2174 option) shows, re-running the
2176 has created four new plexes, each with a new subdisk. If you want to add other
2177 volumes, create new configuration files for them. They do not need to reference
2180 already knows about. For example, to create a volume
2183 .Pa /dev/da1s0e , /dev/da2s0e , /dev/da3s0e
2186 you only need to mention the other two:
2187 .Bd -literal -offset indent
2188 drive d3 device /dev/da1s0e
2189 drive d4 device /dev/da4s0e
2198 With this configuration file, we get:
2200 # vinum create newconfig
2201 Configuration summary
2203 Drives: 4 (4 configured)
2204 Volumes: 2 (4 configured)
2205 Plexes: 5 (8 configured)
2206 Subdisks: 8 (16 configured)
2208 D d1 State: up Device /dev/da2s0e Avail: 51176/57320 MB (89%)
2209 D d2 State: up Device /dev/da3s0e Avail: 53220/57320 MB (89%)
2210 D d3 State: up Device /dev/da1s0e Avail: 53224/57320 MB (92%)
2211 D d4 State: up Device /dev/da4s0e Avail: 53224/57320 MB (92%)
2213 V mirror State: down Plexes: 4 Size: 2048 MB
2214 V raid State: down Plexes: 1 Size: 6144 MB
2216 P mirror.p0 C State: init Subdisks: 1 Size: 2048 MB
2217 P mirror.p1 C State: init Subdisks: 1 Size: 2048 MB
2218 P mirror.p2 C State: init Subdisks: 1 Size: 2048 MB
2219 P mirror.p3 C State: init Subdisks: 1 Size: 2048 MB
2220 P raid.p0 R5 State: init Subdisks: 4 Size: 6144 MB
2222 S mirror.p0.s0 State: up PO: 0 B Size: 2048 MB
2223 S mirror.p1.s0 State: up PO: 0 B Size: 2048 MB
2224 S mirror.p2.s0 State: up PO: 0 B Size: 2048 MB
2225 S mirror.p3.s0 State: up PO: 0 B Size: 2048 MB
2226 S raid.p0.s0 State: empty PO: 0 B Size: 2048 MB
2227 S raid.p0.s1 State: empty PO: 512 kB Size: 2048 MB
2228 S raid.p0.s2 State: empty PO: 1024 kB Size: 2048 MB
2229 S raid.p0.s3 State: empty PO: 1536 kB Size: 2048 MB
2232 Note the size of the RAID-5 plex: it is only 6 GB, although together its
2233 components use 8 GB of disk space. This is because the equivalent of one
2234 subdisk is used for storing parity data.
2235 .Ss Restarting Vinum
2236 On rebooting the system, start
2244 This will start all the
2246 drives in the system. If for some reason you wish to start only some of them,
2250 .Ss Performance considerations
2251 A number of misconceptions exist about how to set up a RAID array for best
2252 performance. In particular, most systems use far too small a stripe size. The
2253 following discussion applies to all RAID systems, not just to
2258 block I/O system issues requests of between .5kB and 128 kB; a
2259 typical mix is somewhere round 8 kB. You can't stop any striping system from
2260 breaking a request into two physical requests, and if you make the stripe small
2261 enough, it can be broken into several. This will result in a significant drop
2262 in performance: the decrease in transfer time per disk is offset by the order of
2263 magnitude greater increase in latency.
2265 With modern disk sizes and the
2267 I/O system, you can expect to have a
2268 reasonably small number of fragmented requests with a stripe size between 256 kB
2269 and 512 kB; with correct RAID implementations there is no obvious reason not to
2270 increase the size to 2 or 4 MB on a large disk.
2272 When choosing a stripe size, consider that most current
2275 cylinder groups 32 MB in size. If you have a stripe size and number of disks
2276 both of which are a power of two, it is probable that all superblocks and inodes
2277 will be placed on the same subdisk, which will impact performance significantly.
2278 Choose an odd number instead, for example 479 kB.
2280 The easiest way to consider the impact of any transfer in a multi-access system
2281 is to look at it from the point of view of the potential bottleneck, the disk
2282 subsystem: how much total disk time does the transfer use?
2284 everything is cached, the time relationship between the request and its
2285 completion is not so important: the important parameter is the total time that
2286 the request keeps the disks active, the time when the disks are not available to
2287 perform other transfers. As a result, it doesn't really matter if the transfers
2288 are happening at the same time or different times. In practical terms, the time
2289 we're looking at is the sum of the total latency (positioning time and
2290 rotational latency, or the time it takes for the data to arrive under the disk
2291 heads) and the total transfer time. For a given transfer to disks of the same
2292 speed, the transfer time depends only on the total size of the transfer.
2294 Consider a typical news article or web page of 24 kB, which will probably be
2295 read in a single I/O. Take disks with a transfer rate of 6 MB/s and an average
2296 positioning time of 8 ms, and a file system with 4 kB blocks. Since it's 24 kB,
2297 we don't have to worry about fragments, so the file will start on a 4 kB
2298 boundary. The number of transfers required depends on where the block starts:
2299 it's (S + F - 1) / S, where S is the stripe size in file system blocks, and F is
2300 the file size in file system blocks.
2303 Stripe size of 4 kB. You'll have 6 transfers. Total subsystem load: 48 ms
2304 latency, 2 ms transfer, 50 ms total.
2306 Stripe size of 8 kB. On average, you'll have 3.5 transfers. Total subsystem
2307 load: 28 ms latency, 2 ms transfer, 30 ms total.
2309 Stripe size of 16 kB. On average, you'll have 2.25 transfers. Total subsystem
2310 load: 18 ms latency, 2 ms transfer, 20 ms total.
2312 Stripe size of 256 kB. On average, you'll have 1.08 transfers. Total subsystem
2313 load: 8.6 ms latency, 2 ms transfer, 10.6 ms total.
2315 Stripe size of 4 MB. On average, you'll have 1.0009 transfers. Total subsystem
2316 load: 8.01 ms latency, 2 ms transfer, 10.01 ms total.
2319 It appears that some hardware RAID systems have problems with large stripes:
2320 they appear to always transfer a complete stripe to or from disk, so that a
2321 large stripe size will have an adverse effect on performance.
2323 does not suffer from this problem: it optimizes all disk transfers and does not
2324 transfer unneeded data.
2326 Note that no well-known benchmark program tests true multi-access conditions
2327 (more than 100 concurrent users), so it is difficult to demonstrate the validity
2328 of these statements.
2330 Given these considerations, the following factors affect the performance of a
2335 Striping improves performance for multiple access only, since it increases the
2336 chance of individual requests being on different drives.
2340 file systems across multiple drives can also improve
2341 performance for multiple file access, since
2343 divides a file system into
2344 cylinder groups and attempts to keep files in a single cylinder group. In
2345 general, it is not as effective as striping.
2347 Mirroring can improve multi-access performance for reads, since by default
2349 issues consecutive reads to consecutive plexes.
2351 Mirroring decreases performance for all writes, whether multi-access or single
2352 access, since the data must be written to both plexes. This explains the
2353 subdisk layout in the example of a mirroring configuration above: if the
2354 corresponding subdisk in each plex is on a different physical disk, the write
2355 commands can be issued in parallel, whereas if they are on the same physical
2356 disk, they will be performed sequentially.
2358 RAID-5 reads have essentially the same considerations as striped reads, unless
2359 the striped plex is part of a mirrored volume, in which case the performance of
2360 the mirrored volume will be better.
2362 RAID-5 writes are approximately 25% of the speed of striped writes: to perform
2365 must first read the data block and the corresponding parity block, perform some
2366 calculations and write back the parity block and the data block, four times as
2367 many transfers as for writing a striped plex. On the other hand, this is offset
2368 by the cost of mirroring, so writes to a volume with a single RAID-5 plex are
2369 approximately half the speed of writes to a correctly configured volume with two
2374 configuration changes (for example, adding or removing objects, or the change of
2375 state of one of the objects),
2377 writes up to 128 kB of updated configuration to each drive. The larger the
2378 number of drives, the longer this takes.
2380 .Ss Creating file systems on Vinum volumes
2381 You do not need to run
2383 before creating a file system on a
2389 option to state that the device is not divided into partitions. For example, to
2390 create a file system on volume
2392 enter the following command:
2394 .Dl "# newfs -v /dev/vinum/mirror"
2396 A number of other considerations apply to
2401 There is no advantage in creating multiple drives on a single disk. Each drive
2402 uses 131.5 kB of data for label and configuration information, and performance
2403 will suffer when the configuration changes. Use appropriately sized subdisks instead.
2405 It is possible to increase the size of a concatenated
2407 plex, but currently the size of striped and RAID-5 plexes cannot be increased.
2408 Currently the size of an existing
2410 file system also cannot be increased, but
2411 it is planned to make both plexes and file systems extensible.
2413 .Sh STATE MANAGEMENT
2414 Vinum objects have the concept of
2418 for more details. They are only completely accessible if their state is
2420 To change an object state to
2424 command. To change an object state to
2428 command. Normally other states are created automatically by the relationship
2429 between objects. For example, if you add a plex to a volume, the subdisks of
2430 the plex will be set in the
2432 state, indicating that, though the hardware is accessible, the data on the
2433 subdisk is invalid. As a result of this state, the plex will be set in the
2436 .Ss The `reviving' state
2437 In many cases, when you start a subdisk the system must copy data to the
2438 subdisk. Depending on the size of the subdisk, this can take a long time.
2439 During this time, the subdisk is set in the
2441 state. On successful completion of the copy operation, it is automatically set
2444 state. It is possible for the process performing the revive to be stopped and
2445 restarted. The system keeps track of how far the subdisk has been revived, and
2448 command is reissued, the copying continues from this point.
2450 In order to maintain the consistency of a volume while one or more of its plexes
2453 writes to subdisks which have been revived up to the point of the write. It may
2454 also read from the plex if the area being read has already been revived.
2456 The following points are not bugs, and they have good reasons for existing, but
2457 they have shown to cause confusion. Each is discussed in the appropriate
2464 disk partitions and must have the partition type
2469 command will not accept a drive on partition
2473 is used by the system to represent the whole disk, and must be of type
2475 Clearly there is a conflict here, which
2477 resolves by not using the
2481 When you create a volume with multiple plexes,
2483 does not automatically initialize the plexes. This means that the contents are
2484 not known, but they are certainly not consistent. As a result, by default
2486 sets the state of all newly-created plexes except the first to
2488 In order to synchronize them with the first plex, you must
2492 to copy the data from a plex which is in the
2494 state. Depending on the size of the subdisks involved, this can take a long
2497 In practice, people aren't too interested in what was in the plex when it was
2498 created, and other volume managers cheat by setting them
2502 provides two ways to ensure that newly created plexes are
2506 Create the plexes and then synchronize them with
2509 Create the volume (not the plex) with the keyword
2513 to ignore any possible inconsistency and set the plexes to be
2517 Some of the commands currently supported by
2519 are not really needed. For reasons which I don't understand, however, I find
2520 that users frequently try the
2524 commands, though especially
2526 outputs all sort of dire warnings. Don't use these commands unless you have a
2527 good reason to do so.
2529 Some state transitions are not very intuitive. In fact, it's not clear whether
2530 this is a bug or a feature. If you find that you can't start an object in some
2531 strange state, such as a
2533 subdisk, try first to get it into
2539 commands. If that works, you should then be able to start it. If you find
2540 that this is the only way to get out of a position where easier methods fail,
2541 please report the situation.
2543 If you build the kernel module with the
2544 .Fl D Ns Dv VINUMDEBUG
2545 option, you must also build
2548 .Fl D Ns Dv VINUMDEBUG
2549 option, since the size of some data objects used by both components depends on
2550 this option. If you don't do so, commands will fail with the message
2551 .Sy Invalid argument ,
2552 and a console message will be logged such as
2554 .It "vinumioctl: invalid ioctl from process 247 (vinum): c0e44642"
2557 This error may also occur if you use old versions of KLD or userland program.
2561 command has a particularly emetic syntax. Once it was the only way to start
2563 but now the preferred method is with
2566 should be used for maintenance purposes only. Note that its syntax has changed,
2567 and the arguments must be disk slices, such as
2569 not partitions such as
2573 .Bl -tag -width VINUM_DATEFORMAT
2574 .It Ev VINUM_HISTORY
2575 The name of the log file, by default
2576 .Pa /var/log/vinum_history .
2577 .It Ev VINUM_DATEFORMAT
2578 The format of dates in the log file, by default
2579 .Qq Li %e %b %Y %H:%M:%S .
2581 The name of the editor to use for editing configuration files, by default
2585 .Bl -tag -width /dev/vinum/control -compact
2587 directory with device nodes for
2590 .It Pa /dev/vinum/control
2593 .It Pa /dev/vinum/plex
2594 directory containing device nodes for
2597 .It Pa /dev/vinum/sd
2598 directory containing device nodes for
2608 .Pa http://www.vinumvm.org/vinum/ ,
2609 .Pa http://www.vinumvm.org/vinum/how-to-debug.html .
2613 command first appeared in
2615 The RAID-5 component of
2617 was developed for Cybernet Inc.\&
2618 .Pq Pa www.cybernet.com
2619 for its NetMAX product.
2621 .An Greg Lehey Aq Mt grog@lemis.com