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 $
35 .\" $DragonFly: src/sbin/vinum/vinum.8,v 1.6 2007/01/20 19:20:39 dillon Exp $
42 .Nd Logical Volume Manager control program
48 .Bl -tag -width indent
49 .It Ic attach Ar plex volume Op Cm rename
51 .Ic attach Ar subdisk plex
55 Attach a plex to a volume, or a subdisk to a plex.
57 .Ic checkparity Ar plex
61 Check the parity blocks of a RAID-4 or RAID-5 plex.
69 Create a concatenated volume from the specified drives.
75 Create a volume as described in
76 .Ar description-file .
78 Cause the volume manager to enter the kernel debugger.
86 Detach a plex or subdisk from the volume or plex to which it is attached.
87 .It Ic dumpconfig Op Ar drive ...
88 List the configuration information stored on the specified drives, or all drives
89 in the system if no drive names are specified.
95 List information about volume manager state.
103 Initialize the contents of a subdisk or all the subdisks of a plex to all zeros.
104 .It Ic label Ar volume
105 Create a volume label.
112 .Op Ar volume | plex | subdisk
114 List information about specified objects.
123 List information about drives.
132 List information about subdisks.
141 List information about plexes.
150 List information about volumes.
152 Remake the device nodes in
162 Create a mirrored volume from the specified drives.
168 Move the object(s) to the specified drive.
169 .It Ic printconfig Op Ar file
170 Write a copy of the current configuration to
175 program when running in interactive mode. Normally this would be done by
179 .It Ic read Ar disk ...
182 configuration from the specified disks.
185 .Op Ar drive | subdisk | plex | volume
188 Change the name of the specified object.
190 .\".It Ic replace Ar drive newdrive
191 .\"Move all the subdisks from the specified drive onto the new drive.
193 .Ic rebuildparity Ar plex Op Fl f
197 Rebuild the parity blocks of a RAID-4 or RAID-5 plex.
205 .Op Ar volume | plex | subdisk
207 Reset statistics counters for the specified objects, or for all objects if none
213 .Ar volume | plex | subdisk
219 configuration to disk after configuration failures.
225 .\".Ar volume | plex | subdisk | disk
227 .\"Set the state of the object to
229 .It Ic setdaemon Op Ar value
230 Set daemon configuration.
234 .Op Ar volume | plex | subdisk | drive
236 Set state without influencing other objects, for diagnostic purposes only.
238 Read configuration from all vinum drives.
244 .Ar volume | plex | subdisk
246 Allow the system to access the objects.
250 .Op Ar volume | plex | subdisk
252 Terminate access to the objects, or stop
254 if no parameters are specified.
262 Create a striped volume from the specified drives.
266 is a utility program to communicate with the
271 is designed either for interactive use, when started without command line
272 arguments, or to execute a single command if the command is supplied on the
273 command line. In interactive mode,
275 maintains a command line history.
278 commands may optionally be followed by an option. Any of the following options
279 may be specified with any command, but in some cases the options are ignored.
287 .Bl -tag -width indent
292 option overrides safety checks. Use with extreme care. This option is for
293 emergency use only. For example, the command
299 even if it is open. Any subsequent access to the volume will almost certainly
301 .It Fl i Ar millisecs
308 milliseconds between copying each block. This lowers the load on the system.
312 option to specify a volume name to the simplified configuration commands
320 option is used by the list commands to display information not
321 only about the specified objects, but also about subordinate objects. For
322 example, in conjunction with the
326 option will also show information about the plexes and subdisks belonging to the
332 option is used by the list commands to display statistical information. The
334 command also uses this option to specify that it should create striped plexes.
338 option specifies the transfer size for the
347 option can be used to request more detailed information.
352 option can be used to request more detailed information than the
361 to wait for completion of commands which normally run in the background, such as
364 .Sh COMMANDS IN DETAIL
366 commands perform the following functions:
368 .Bl -tag -width indent -compact
369 .It Ic attach Ar plex volume Op Cm rename
371 .Ic attach Ar subdisk plex
376 inserts the specified plex or subdisk in a volume or plex. In the case of a
377 subdisk, an offset in the plex may be specified. If it is not, the subdisk will
378 be attached at the first possible location. After attaching a plex to a
381 reintegrates the plex.
387 renames the object (and in the case of a plex, any subordinate subdisks) to fit
390 naming convention. To rename the object to any other name, use the
394 A number of considerations apply to attaching subdisks:
397 Subdisks can normally only be attached to concatenated plexes.
399 If a striped or RAID-5 plex is missing a subdisk (for example after drive
400 failure), it should be replaced by a subdisk of the same size only.
402 In order to add further subdisks to a striped or RAID-5 plex, use the
404 (force) option. This will corrupt the data in the plex.
405 .\"No other attachment of
406 .\"subdisks is currently allowed for striped and RAID-5 plexes.
408 For concatenated plexes, the
410 parameter specifies the offset in blocks from the beginning of the plex. For
411 striped and RAID-5 plexes, it specifies the offset of the first block of the
412 subdisk: in other words, the offset is the numerical position of the subdisk
413 multiplied by the stripe size. For example, in a plex with stripe size 271k,
414 the first subdisk will have offset 0, the second offset 271k, the third 542k,
415 etc. This calculation ignores parity blocks in RAID-5 plexes.
424 Check the parity blocks on the specified RAID-4 or RAID-5 plex. This operation
425 maintains a pointer in the plex, so it can be stopped and later restarted from
426 the same position if desired. In addition, this pointer is used by the
428 command, so rebuilding the parity blocks need only start at the location where
429 the first parity problem has been detected.
435 starts checking at the beginning of the plex. If the
439 prints a running progress report.
450 command provides a simplified alternative to the
452 command for creating volumes with a single concatenated plex. The largest
453 contiguous space available on each drive is used to create the subdisks for the
458 command creates an arbitrary name for the volume and its components. The name
459 is composed of the text
461 and a small integer, for example
463 You can override this with the
465 option, which assigns the name specified to the volume. The plexes and subdisks
466 are named after the volume in the default manner.
468 There is no choice of name for the drives. If the drives have already been
471 drives, the name remains. Otherwise the drives are given names starting with
474 and a small integer, for example
480 option can be used to specify that a previous name should be overwritten. The
482 is used to specify verbose output.
485 .Sx SIMPLIFIED CONFIGURATION
486 below for some examples of this
495 is used to create any object. In view of the relatively complicated
496 relationship and the potential dangers involved in creating a
498 object, there is no interactive interface to this function. If you do not
501 starts an editor on a temporary file. If the environment variable
505 starts this editor. If not, it defaults to
508 .Sx CONFIGURATION FILE
509 below for more information on the format of
514 function is additive: if you run it multiple times, you will create multiple
515 copies of all unnamed objects.
519 command will not change the names of existing
521 drives, in order to avoid accidentally erasing them. The correct way to dispose
524 drives is to reset the configuration with the
526 command. In some cases, however, it may be necessary to create new data on
528 drives which can no longer be started. In this case, use the
534 without any arguments, is used to enter the remote kernel debugger. It is only
539 option. This option will stop the execution of the operating system until the
540 kernel debugger is exited. If remote debugging is set and there is no remote
541 connection for a kernel debugger, it will be necessary to reset the system and
542 reboot in order to leave the debugger.
544 .It Ic debug Ar flags
545 Set a bit mask of internal debugging flags. These will change without warning
546 as the product matures; to be certain, read the header file
547 .Pa /sys/dev/raid/vinum/vinumvar.h .
548 The bit mask is composed of the following values:
549 .Bl -tag -width indent
550 .It Dv DEBUG_ADDRESSES Pq No 1
551 Show buffer information during requests
552 .\".It Dv DEBUG_NUMOUTPUT Pq No 2
554 .\".Va vp->v_numoutput .
555 .It Dv DEBUG_RESID Pq No 4
558 .It Dv DEBUG_LASTREQS Pq No 8
559 Keep a circular buffer of last requests.
560 .It Dv DEBUG_REVIVECONFLICT Pq No 16
561 Print info about revive conflicts.
562 .It Dv DEBUG_EOFINFO Pq No 32
563 Print information about internal state when returning an
566 .It Dv DEBUG_MEMFREE Pq No 64
567 Maintain a circular list of the last memory areas freed by the memory allocator.
568 .It Dv DEBUG_REMOTEGDB Pq No 256
574 .It Dv DEBUG_WARNINGS Pq No 512
575 Print some warnings about minor problems in the implementation.
578 .It Ic detach Oo Fl f Oc Ar plex
579 .It Ic detach Oo Fl f Oc Ar subdisk
581 removes the specified plex or subdisk from the volume or plex to which it is
582 attached. If removing the object would impair the data integrity of the volume,
583 the operation will fail unless the
585 option is specified. If the object is named after the object above it (for
590 the name will be changed
591 by prepending the text
594 .Li ex-vol1.p7.s0 ) .
595 If necessary, the name will be truncated in the
599 does not reduce the number of subdisks in a striped or RAID-5 plex. Instead,
600 the subdisk is marked absent, and can later be replaced with the
604 .It Ic dumpconfig Op Ar drive ...
607 shows the configuration information stored on the specified drives. If no drive
610 searches all drives on the system for Vinum partitions and dumps the
611 information. If configuration updates are disabled, it is possible that this
612 information is not the same as the information returned by the
614 command. This command is used primarily for maintenance and debugging.
618 displays information about
620 memory usage. This is intended primarily for debugging. With the
622 option, it will give detailed information about the memory areas in use.
628 displays information about the last up to 64 I/O requests handled by the
630 driver. This information is only collected if debug flag 8 is set. The format
635 Total of 38 blocks malloced, total memory: 16460
636 Maximum allocs: 56, malloc table at 0xf0f72dbc
638 Time Event Buf Dev Offset Bytes SD SDoff Doffset Goffset
640 14:40:00.637758 1VS Write 0xf2361f40 91.3 0x10 16384
641 14:40:00.639280 2LR Write 0xf2361f40 91.3 0x10 16384
642 14:40:00.639294 3RQ Read 0xf2361f40 4.39 0x104109 8192 19 0 0 0
643 14:40:00.639455 3RQ Read 0xf2361f40 4.23 0xd2109 8192 17 0 0 0
644 14:40:00.639529 3RQ Read 0xf2361f40 4.15 0x6e109 8192 16 0 0 0
645 14:40:00.652978 4DN Read 0xf2361f40 4.39 0x104109 8192 19 0 0 0
646 14:40:00.667040 4DN Read 0xf2361f40 4.15 0x6e109 8192 16 0 0 0
647 14:40:00.668556 4DN Read 0xf2361f40 4.23 0xd2109 8192 17 0 0 0
648 14:40:00.669777 6RP Write 0xf2361f40 4.39 0x104109 8192 19 0 0 0
649 14:40:00.685547 4DN Write 0xf2361f40 4.39 0x104109 8192 19 0 0 0
650 11:11:14.975184 Lock 0xc2374210 2 0x1f8001
651 11:11:15.018400 7VS Write 0xc2374210 0x7c0 32768 10
652 11:11:15.018456 8LR Write 0xc2374210 13.39 0xcc0c9 32768
653 11:11:15.046229 Unlock 0xc2374210 2 0x1f8001
658 field always contains the address of the user buffer header. This can be used
659 to identify the requests associated with a user request, though this is not 100%
660 reliable: theoretically two requests in sequence could use the same buffer
661 header, though this is not common. The beginning of a request can be identified
666 The first example above shows the requests involved in a user request. The
667 second is a subdisk I/O request with locking.
671 field contains information related to the sequence of events in the request
676 indicates the approximate sequence of events, and the two-letter abbreviation is
677 a mnemonic for the location:
678 .Bl -tag -width Lockwait
680 (vinumstrategy) shows information about the user request on entry to
682 The device number is the
684 device, and offset and length are the user parameters. This is always the
685 beginning of a request sequence.
687 (launch_requests) shows the user request just prior to launching the low-level
689 requests in the function
690 .Fn launch_requests .
691 The parameters should be the same as in the
696 In the following requests,
698 is the device number of the associated disk partition,
700 is the offset from the beginning of the partition,
702 is the subdisk index in
705 is the offset from the beginning of the subdisk,
707 is the offset of the associated data request, and
709 is the offset of the associated group request, where applicable.
710 .Bl -tag -width Lockwait
712 (request) shows one of possibly several low-level
714 requests which are launched to satisfy the high-level request. This information
716 .Fn launch_requests .
718 (done) is called from
720 showing the completion of a request. This completion should match a request
721 launched either at stage
724 .Fn launch_requests ,
726 .Fn complete_raid5_write
732 (RAID-5 data) is called from
733 .Fn complete_raid5_write
734 and represents the data written to a RAID-5 data stripe after calculating
737 (RAID-5 parity) is called from
738 .Fn complete_raid5_write
739 and represents the data written to a RAID-5 parity stripe after calculating
742 shows a subdisk I/O request. These requests are usually internal to
744 for operations like initialization or rebuilding plexes.
746 shows the low-level operation generated for a subdisk I/O request.
748 specifies that the process is waiting for a range lock. The parameters are the
749 buffer header associated with the request, the plex number and the block number.
750 For internal reasons the block number is one higher than the address of the
751 beginning of the stripe.
753 specifies that a range lock has been obtained. The parameters are the same as
756 specifies that a range lock has been released. The parameters are the same as
768 initializes a subdisk by writing zeroes to it. You can initialize all subdisks
769 in a plex by specifying the plex name. This is the only way to ensure
770 consistent data in a plex. You must perform this initialization before using a
771 RAID-5 plex. It is also recommended for other new plexes.
773 initializes all subdisks of a plex in parallel. Since this operation can take a
774 long time, it is normally performed in the background. If you want to wait for
775 completion of the command, use the
781 option if you want to write blocks of a different size from the default value of
784 prints a console message when the initialization is complete.
786 .It Ic label Ar volume
791 style volume label on a volume. It is a simple alternative to an appropriate
794 This is needed because some
796 commands still read the disk to find the label instead of using the correct
800 maintains a volume label separately from the volume data, so this command is not
803 This command is deprecated.
809 .Op Ar volume | plex | subdisk
815 .Op Ar volume | plex | subdisk
850 is used to show information about the specified object. If the argument is
851 omitted, information is shown about all objects known to
855 command is a synonym for
860 option relates to volumes and plexes: if specified, it recursively lists
861 information for the subdisks and (for a volume) plexes subordinate to the
862 objects. The commands
866 list only volumes, plexes, subdisks and drives respectively. This is
867 particularly useful when used without parameters.
873 to output device statistics, the
875 (verbose) option causes some additional information to be output, and the
877 causes considerable additional information to be output.
882 command removes the directory
884 and recreates it with device nodes
885 which reflect the current configuration. This command is not intended for
886 general use, and is provided for emergency use only.
898 command provides a simplified alternative to the
900 command for creating mirrored volumes. Without any options, it creates a RAID-1
901 (mirrored) volume with two concatenated plexes. The largest contiguous space
902 available on each drive is used to create the subdisks for the plexes. The
903 first plex is built from the odd-numbered drives in the list, and the second
904 plex is built from the even-numbered drives. If the drives are of different
905 sizes, the plexes will be of different sizes.
911 builds striped plexes with a stripe size of 256 kB. The size of the subdisks in
912 each plex is the size of the smallest contiguous storage available on any of the
913 drives which form the plex. Again, the plexes may differ in size.
917 command creates an arbitrary name for the volume and its components. The name
918 is composed of the text
920 and a small integer, for example
922 You can override this with the
924 option, which assigns the name specified to the volume. The plexes and subdisks
925 are named after the volume in the default manner.
927 There is no choice of name for the drives. If the drives have already been
930 drives, the name remains. Otherwise the drives are given names starting with
933 and a small integer, for example
939 option can be used to specify that a previous name should be overwritten. The
941 is used to specify verbose output.
944 .Sx SIMPLIFIED CONFIGURATION
945 below for some examples of this
948 .It Ic mv Fl f Ar drive object ...
949 .It Ic move Fl f Ar drive object ...
950 Move all the subdisks from the specified objects onto the new drive. The
951 objects may be subdisks, drives or plexes. When drives or plexes are specified,
952 all subdisks associated with the object are moved.
956 option is required for this function, since it currently does not preserve the
957 data in the subdisk. This functionality will be added at a later date. In this
958 form, however, it is suited to recovering a failed disk drive.
960 .It Ic printconfig Op Ar file
961 Write a copy of the current configuration to
963 in a format that can be used to recreate the
965 configuration. Unlike the configuration saved on disk, it includes definitions
966 of the drives. If you omit
975 program when running in interactive mode. Normally this would be done by
980 .It Ic read Ar disk ...
983 command scans the specified disks for
985 partitions containing previously created configuration information. It reads
986 the configuration in order from the most recently updated to least recently
987 updated configuration.
989 maintains an up-to-date copy of all configuration information on each disk
990 partition. You must specify all of the slices in a configuration as the
991 parameter to this command.
995 command is intended to selectively load a
997 configuration on a system which has other
999 partitions. If you want to start all partitions on the system, it is easier to
1006 encounters any errors during this command, it will turn off automatic
1007 configuration update to avoid corrupting the copies on disk. This will also
1008 happen if the configuration on disk indicates a configuration error (for
1009 example, subdisks which do not have a valid space specification). You can turn
1010 the updates on again with the
1014 commands. Reset bit 2 (numerical value 4) of the daemon options mask to
1015 re-enable configuration saves.
1024 Rebuild the parity blocks on the specified RAID-4 or RAID-5 plex. This
1025 operation maintains a pointer in the plex, so it can be stopped and later
1026 restarted from the same position if desired. In addition, this pointer is used
1029 command, so rebuilding the parity blocks need only start at the location where
1030 the first parity problem has been detected.
1036 starts rebuilding at the beginning of the plex. If the
1040 first checks the existing parity blocks prints information about those found to
1041 be incorrect before rebuilding. If the
1045 prints a running progress report.
1050 .Op Ar drive | subdisk | plex | volume
1053 Change the name of the specified object. If the
1055 option is specified, subordinate objects will be named by the default rules:
1056 plex names will be formed by appending
1058 to the volume name, and
1059 subdisk names will be formed by appending
1065 .\".Ar drive newdrive
1066 .\"Move all the subdisks from the specified drive onto the new drive. This will
1067 .\"attempt to recover those subdisks that can be recovered, and create the others
1068 .\"from scratch. If the new drive lacks the space for this operation, as many
1069 .\"subdisks as possible will be fitted onto the drive, and the rest will be left on
1070 .\"the original drive.
1075 command completely obliterates the
1077 configuration on a system. Use this command only when you want to completely
1078 delete the configuration.
1080 will ask for confirmation; you must type in the words
1083 .Bd -unfilled -offset indent
1084 .No # Nm Ic resetconfig
1086 WARNING! This command will completely wipe out your vinum
1087 configuration. All data will be lost. If you really want
1088 to do this, enter the text
1091 .No "Enter text ->" Sy "NO FUTURE"
1092 Vinum configuration obliterated
1095 As the message suggests, this is a last-ditch command. Don't use it unless you
1096 have an existing configuration which you never want to see again.
1101 .Op Ar volume | plex | subdisk
1104 maintains a number of statistical counters for each object. See the header file
1105 .Pa /sys/dev/raid/vinum/vinumvar.h
1106 for more information.
1107 .\" XXX put it in here when it's finalized
1110 command to reset these counters. In conjunction with the
1114 also resets the counters of subordinate objects.
1120 .Ar volume | plex | subdisk
1123 removes an object from the
1125 configuration. Once an object has been removed, there is no way to recover it.
1128 performs a large amount of consistency checking before removing an object. The
1132 to omit this checking and remove the object anyway. Use this option with great
1133 care: it can result in total loss of data on a volume.
1137 refuses to remove a volume or plex if it has subordinate plexes or subdisks
1138 respectively. You can tell
1140 to remove the object anyway by using the
1142 option, or you can cause
1144 to remove the subordinate objects as well by using the
1146 (recursive) option. If you remove a volume with the
1148 option, it will remove both the plexes and the subdisks which belong to the
1152 Save the current configuration to disk. Normally this is not necessary, since
1154 automatically saves any change in configuration. If an error occurs on startup,
1155 updates will be disabled. When you reenable them with the
1159 does not automatically save the configuration to disk. Use this command to save
1166 .\".Ar volume | plex | subdisk | disk
1169 .\"sets the state of the specified object to one of the valid states (see
1170 .\".Sx OBJECT STATES
1173 .\"performs a large amount of consistency checking before making the change. The
1177 .\"to omit this checking and perform the change anyway. Use this option with great
1178 .\"care: it can result in total loss of data on a volume.
1180 .It Ic setdaemon Op Ar value
1182 sets a variable bitmask for the
1184 daemon. This command is temporary and will be replaced. Currently, the bit mask
1185 may contain the bits 1 (log every action to syslog) and 4 (don't update
1186 configuration). Option bit 4 can be useful for error recovery.
1189 .Ic setstate Ar state
1190 .Op Ar volume | plex | subdisk | drive
1193 sets the state of the specified objects to the specified state. This bypasses
1194 the usual consistency mechanism of
1196 and should be used only for recovery purposes. It is possible to crash the
1197 system by incorrect use of this command.
1201 .Op Fl i Ar interval
1204 .Op Ar plex | subdisk
1207 starts (brings into to the
1213 If no object names are specified,
1215 scans the disks known to the system for
1217 drives and then reads in the configuration as described under the
1221 drive contains a header with all information about the data stored on the drive,
1222 including the names of the other drives which are required in order to represent
1227 encounters any errors during this command, it will turn off automatic
1228 configuration update to avoid corrupting the copies on disk. This will also
1229 happen if the configuration on disk indicates a configuration error (for
1230 example, subdisks which do not have a valid space specification). You can turn
1231 the updates on again with the
1235 command. Reset bit 4 of the daemon options mask to re-enable configuration
1238 If object names are specified,
1240 starts them. Normally this operation is only of use with subdisks. The action
1241 depends on the current state of the object:
1244 If the object is already in the
1250 If the object is a subdisk in the
1260 If the object is a subdisk in the
1262 state, the change depends on the subdisk. If it is part of a plex which is part
1263 of a volume which contains other plexes,
1265 places the subdisk in the
1267 state and attempts to copy the data from the volume. When the operation
1268 completes, the subdisk is set into the
1270 state. If it is part of a plex which is part of a volume which contains no
1271 other plexes, or if it is not part of a plex,
1277 If the object is a subdisk in the
1281 continues the revive
1282 operation offline. When the operation completes, the subdisk is set into the
1287 When a subdisk comes into the
1291 automatically checks the state of any plex and volume to which it may belong and
1292 changes their state where appropriate.
1294 If the object is a plex,
1296 checks the state of the subordinate subdisks (and plexes in the case of a
1297 volume) and starts any subdisks which can be started.
1299 To start a plex in a multi-plex volume, the data must be copied from another
1300 plex in the volume. Since this frequently takes a long time, it is normally
1301 done in the background. If you want to wait for this operation to complete (for
1302 example, if you are performing this operation in a script), use the
1306 Copying data doesn't just take a long time, it can also place a significant load
1307 on the system. You can specify the transfer size in bytes or sectors with the
1309 option, and an interval (in milliseconds) to wait between copying each block with
1312 option. Both of these options lessen the load on the system.
1317 .Op Ar volume | plex | subdisk
1319 If no parameters are specified,
1325 This can only be done if no objects are active. In particular, the
1327 option does not override this requirement. Normally, the
1329 command writes the current configuration back to the drives before terminating.
1330 This will not be possible if configuration updates are disabled, so
1332 will not stop if configuration updates are disabled. You can override this by
1339 command can only work if
1341 has been loaded as a KLD, since it is not possible to unload a statically
1346 is statically configured.
1348 If object names are specified,
1350 disables access to the objects. If the objects have subordinate objects, they
1351 subordinate objects must either already be inactive (stopped or in error), or
1356 options must be specified. This command does not remove the objects from the
1357 configuration. They can be accessed again after a
1363 does not stop active objects. For example, you cannot stop a plex which is
1364 attached to an active volume, and you cannot stop a volume which is open. The
1368 to omit this checking and remove the object anyway. Use this option with great
1369 care and understanding: used incorrectly, it can result in serious data
1381 command provides a simplified alternative to the
1383 command for creating volumes with a single striped plex. The size of the
1384 subdisks is the size of the largest contiguous space available on all the
1385 specified drives. The stripe size is fixed at 256 kB.
1389 command creates an arbitrary name for the volume and its components. The name
1390 is composed of the text
1392 and a small integer, for example
1394 You can override this with the
1396 option, which assigns the name specified to the volume. The plexes and subdisks
1397 are named after the volume in the default manner.
1399 There is no choice of name for the drives. If the drives have already been
1402 drives, the name remains. Otherwise the drives are given names starting with
1405 and a small integer, for example
1406 .Dq Li vinumdrive7 .
1411 option can be used to specify that a previous name should be overwritten. The
1413 is used to specify verbose output.
1416 .Sx SIMPLIFIED CONFIGURATION
1417 below for some examples of this
1420 .Sh SIMPLIFIED CONFIGURATION
1421 This section describes a simplified interface to
1423 configuration using the
1428 commands. These commands create convenient configurations for some more normal
1429 situations, but they are not as flexible as the
1433 See above for the description of the commands. Here are some examples, all
1434 performed with the same collection of disks. Note that the first drive,
1436 is smaller than the others. This has an effect on the sizes chosen for each
1439 The following examples all use the
1441 option to show the commands passed to the system, and also to list the structure
1442 of the volume. Without the
1444 option, these commands produce no output.
1445 .Ss Volume with a single concatenated plex
1446 Use a volume with a single concatenated plex for the largest possible storage
1447 without resilience to drive failures:
1449 vinum -> concat -v /dev/da1h /dev/da2h /dev/da3h /dev/da4h
1451 plex name vinum0.p0 org concat
1452 drive vinumdrive0 device /dev/da1h
1453 sd name vinum0.p0.s0 drive vinumdrive0 size 0
1454 drive vinumdrive1 device /dev/da2h
1455 sd name vinum0.p0.s1 drive vinumdrive1 size 0
1456 drive vinumdrive2 device /dev/da3h
1457 sd name vinum0.p0.s2 drive vinumdrive2 size 0
1458 drive vinumdrive3 device /dev/da4h
1459 sd name vinum0.p0.s3 drive vinumdrive3 size 0
1460 V vinum0 State: up Plexes: 1 Size: 2134 MB
1461 P vinum0.p0 C State: up Subdisks: 4 Size: 2134 MB
1462 S vinum0.p0.s0 State: up PO: 0 B Size: 414 MB
1463 S vinum0.p0.s1 State: up PO: 414 MB Size: 573 MB
1464 S vinum0.p0.s2 State: up PO: 988 MB Size: 573 MB
1465 S vinum0.p0.s3 State: up PO: 1561 MB Size: 573 MB
1468 In this case, the complete space on all four disks was used, giving a volume
1470 .Ss Volume with a single striped plex
1471 A volume with a single striped plex may give better performance than a
1472 concatenated plex, but restrictions on striped plexes can mean that the volume
1473 is smaller. It will also not be resilient to a drive failure:
1475 vinum -> stripe -v /dev/da1h /dev/da2h /dev/da3h /dev/da4h
1476 drive vinumdrive0 device /dev/da1h
1477 drive vinumdrive1 device /dev/da2h
1478 drive vinumdrive2 device /dev/da3h
1479 drive vinumdrive3 device /dev/da4h
1481 plex name vinum0.p0 org striped 256k
1482 sd name vinum0.p0.s0 drive vinumdrive0 size 849825b
1483 sd name vinum0.p0.s1 drive vinumdrive1 size 849825b
1484 sd name vinum0.p0.s2 drive vinumdrive2 size 849825b
1485 sd name vinum0.p0.s3 drive vinumdrive3 size 849825b
1486 V vinum0 State: up Plexes: 1 Size: 1659 MB
1487 P vinum0.p0 S State: up Subdisks: 4 Size: 1659 MB
1488 S vinum0.p0.s0 State: up PO: 0 B Size: 414 MB
1489 S vinum0.p0.s1 State: up PO: 256 kB Size: 414 MB
1490 S vinum0.p0.s2 State: up PO: 512 kB Size: 414 MB
1491 S vinum0.p0.s3 State: up PO: 768 kB Size: 414 MB
1494 In this case, the size of the subdisks has been limited to the smallest
1495 available disk, so the resulting volume is only 1659 MB in size.
1496 .Ss Mirrored volume with two concatenated plexes
1497 For more reliability, use a mirrored, concatenated volume:
1499 vinum -> mirror -v -n mirror /dev/da1h /dev/da2h /dev/da3h /dev/da4h
1500 drive vinumdrive0 device /dev/da1h
1501 drive vinumdrive1 device /dev/da2h
1502 drive vinumdrive2 device /dev/da3h
1503 drive vinumdrive3 device /dev/da4h
1504 volume mirror setupstate
1505 plex name mirror.p0 org concat
1506 sd name mirror.p0.s0 drive vinumdrive0 size 0b
1507 sd name mirror.p0.s1 drive vinumdrive2 size 0b
1508 plex name mirror.p1 org concat
1509 sd name mirror.p1.s0 drive vinumdrive1 size 0b
1510 sd name mirror.p1.s1 drive vinumdrive3 size 0b
1511 V mirror State: up Plexes: 2 Size: 1146 MB
1512 P mirror.p0 C State: up Subdisks: 2 Size: 988 MB
1513 P mirror.p1 C State: up Subdisks: 2 Size: 1146 MB
1514 S mirror.p0.s0 State: up PO: 0 B Size: 414 MB
1515 S mirror.p0.s1 State: up PO: 414 MB Size: 573 MB
1516 S mirror.p1.s0 State: up PO: 0 B Size: 573 MB
1517 S mirror.p1.s1 State: up PO: 573 MB Size: 573 MB
1520 This example specifies the name of the volume,
1522 Since one drive is smaller than the others, the two plexes are of different
1523 size, and the last 158 MB of the volume is non-resilient. To ensure complete
1524 reliability in such a situation, use the
1526 command to create a volume with 988 MB.
1527 .Ss Mirrored volume with two striped plexes
1528 Alternatively, use the
1530 option to create a mirrored volume with two striped plexes:
1532 vinum -> mirror -v -n raid10 -s /dev/da1h /dev/da2h /dev/da3h /dev/da4h
1533 drive vinumdrive0 device /dev/da1h
1534 drive vinumdrive1 device /dev/da2h
1535 drive vinumdrive2 device /dev/da3h
1536 drive vinumdrive3 device /dev/da4h
1537 volume raid10 setupstate
1538 plex name raid10.p0 org striped 256k
1539 sd name raid10.p0.s0 drive vinumdrive0 size 849825b
1540 sd name raid10.p0.s1 drive vinumdrive2 size 849825b
1541 plex name raid10.p1 org striped 256k
1542 sd name raid10.p1.s0 drive vinumdrive1 size 1173665b
1543 sd name raid10.p1.s1 drive vinumdrive3 size 1173665b
1544 V raid10 State: up Plexes: 2 Size: 1146 MB
1545 P raid10.p0 S State: up Subdisks: 2 Size: 829 MB
1546 P raid10.p1 S State: up Subdisks: 2 Size: 1146 MB
1547 S raid10.p0.s0 State: up PO: 0 B Size: 414 MB
1548 S raid10.p0.s1 State: up PO: 256 kB Size: 414 MB
1549 S raid10.p1.s0 State: up PO: 0 B Size: 573 MB
1550 S raid10.p1.s1 State: up PO: 256 kB Size: 573 MB
1553 In this case, the usable part of the volume is even smaller, since the first
1554 plex has shrunken to match the smallest drive.
1555 .Sh CONFIGURATION FILE
1557 requires that all parameters to the
1559 commands must be in a configuration file. Entries in the configuration file
1560 define volumes, plexes and subdisks, and may be in free format, except that each
1561 entry must be on a single line.
1563 Some configuration file parameters specify a size (lengths, stripe sizes).
1564 These values can be specified as bytes, or one of the following scale factors
1566 .Bl -tag -width indent
1568 specifies that the value is a number of sectors of 512 bytes.
1570 specifies that the value is a number of kilobytes (1024 bytes).
1572 specifies that the value is a number of megabytes (1048576 bytes).
1574 specifies that the value is a number of gigabytes (1073741824 bytes).
1576 is used for compatibility with
1578 It stands for blocks of 512 bytes.
1579 This abbreviation is confusing, since the word
1581 is used in different
1582 meanings, and its use is deprecated.
1585 For example, the value 16777216 bytes can also be written as
1591 The configuration file can contain the following entries:
1593 .It Ic drive Ar name devicename Op Ar options
1594 Define a drive. The options are:
1596 .It Cm device Ar devicename
1597 Specify the device on which the drive resides.
1599 must be the name of a disk partition, for example
1603 and it must be of type
1607 partition, which is reserved for the complete disk.
1609 Define the drive to be a
1611 drive, which is maintained to automatically replace a failed drive.
1613 does not allow this drive to be used for any other purpose. In particular, it
1614 is not possible to create subdisks on it. This functionality has not been
1615 completely implemented.
1617 .It Ic volume Ar name Op Ar options
1618 Define a volume with name
1622 .It Cm plex Ar plexname
1623 Add the specified plex to the volume. If
1628 will look for the definition of the plex as the next possible entry in the
1629 configuration file after the definition of the volume.
1630 .It Cm readpol Ar policy
1638 .Cm prefer Ar plexname .
1640 satisfies a read request from only one of the plexes. A
1642 read policy specifies that each read should be performed from a different plex
1647 read policy reads from the specified plex every time.
1649 When creating a multi-plex volume, assume that the contents of all the plexes
1650 are consistent. This is normally not the case, so by default
1652 sets all plexes except the first one to the
1656 command to first bring them to a consistent state. In the case of striped and
1657 concatenated plexes, however, it does not normally cause problems to leave them
1658 inconsistent: when using a volume for a file system or a swap partition, the
1659 previous contents of the disks are not of interest, so they may be ignored.
1660 If you want to take this risk, use the
1662 keyword. It will only apply to the plexes defined immediately after the volume
1663 in the configuration file. If you add plexes to a volume at a later time, you
1664 must integrate them manually with the
1672 command with RAID-5 plexes: otherwise extreme data corruption will result if one
1675 .It Ic plex Op Ar options
1676 Define a plex. Unlike a volume, a plex does not need a name. The options may
1679 .It Cm name Ar plexname
1680 Specify the name of the plex. Note that you must use the keyword
1682 when naming a plex or subdisk.
1683 .It Cm org Ar organization Op Ar stripesize
1684 Specify the organization of the plex.
1687 .Cm concat , striped
1694 plexes, the parameter
1696 must be specified, while for
1698 it must be omitted. For type
1700 it specifies the width of each stripe. For type
1702 it specifies the size of a group. A group is a portion of a plex which
1703 stores the parity bits all in the same subdisk. It must be a factor of the plex size (in
1704 other words, the result of dividing the plex size by the stripe size must be an
1705 integer), and it must be a multiple of a disk sector (512 bytes).
1707 For optimum performance, stripes should be at least 128 kB in size: anything
1708 smaller will result in a significant increase in I/O activity due to mapping of
1709 individual requests over multiple disks. The performance improvement due to the
1710 increased number of concurrent transfers caused by this mapping will not make up
1711 for the performance drop due to the increase in latency. A good guideline for
1712 stripe size is between 256 kB and 512 kB. Avoid powers of 2, however: they tend
1713 to cause all superblocks to be placed on the first subdisk.
1715 A striped plex must have at least two subdisks (otherwise it is a concatenated
1716 plex), and each must be the same size. A RAID-5 plex must have at least three
1717 subdisks, and each must be the same size. In practice, a RAID-5 plex should
1718 have at least 5 subdisks.
1719 .It Cm volume Ar volname
1720 Add the plex to the specified volume. If no
1722 keyword is specified, the plex will be added to the last volume mentioned in the
1724 .It Cm sd Ar sdname offset
1725 Add the specified subdisk to the plex at offset
1728 .It Ic subdisk Op Ar options
1729 Define a subdisk. Options may be:
1730 .Bl -hang -width 18n
1732 Specify the name of a subdisk. It is not necessary to specify a name for a
1735 above. Note that you must specify the keyword
1737 if you wish to name a subdisk.
1738 .It Cm plexoffset Ar offset
1739 Specify the starting offset of the subdisk in the plex. If not specified,
1741 allocates the space immediately after the previous subdisk, if any, or otherwise
1742 at the beginning of the plex.
1743 .It Cm driveoffset Ar offset
1744 Specify the starting offset of the subdisk in the drive. If not specified,
1746 allocates the first contiguous
1748 bytes of free space on the drive.
1749 .It Cm length Ar length
1750 Specify the length of the subdisk. This keyword must be specified. There is no
1751 default, but the value 0 may be specified to mean
1752 .Dq "use the largest available contiguous free area on the drive" .
1753 If the drive is empty, this means that the entire drive will be used for the
1759 Specify the plex to which the subdisk belongs. By default, the subdisk belongs
1760 to the last plex specified.
1761 .It Cm drive Ar drive
1762 Specify the drive on which the subdisk resides. By default, the subdisk resides
1763 on the last drive specified.
1766 .Sh EXAMPLE CONFIGURATION FILE
1768 # Sample vinum configuration file
1771 drive drive1 device /dev/da1h
1772 drive drive2 device /dev/da2h
1773 drive drive3 device /dev/da3h
1774 drive drive4 device /dev/da4h
1775 drive drive5 device /dev/da5h
1776 drive drive6 device /dev/da6h
1777 # A volume with one striped plex
1779 plex org striped 512b
1780 sd length 64m drive drive2
1781 sd length 64m drive drive4
1783 plex org striped 512b
1784 sd length 512m drive drive2
1785 sd length 512m drive drive4
1789 sd length 100m drive drive2
1790 sd length 50m drive drive4
1792 sd length 150m drive drive4
1793 # A volume with one striped plex and one concatenated plex
1795 plex org striped 512b
1796 sd length 100m drive drive2
1797 sd length 100m drive drive4
1799 sd length 150m drive drive2
1800 sd length 50m drive drive4
1801 # a volume with a RAID-5 and a striped plex
1802 # note that the RAID-5 volume is longer by
1803 # the length of one subdisk
1805 plex org striped 64k
1806 sd length 1000m drive drive2
1807 sd length 1000m drive drive4
1809 sd length 500m drive drive1
1810 sd length 500m drive drive2
1811 sd length 500m drive drive3
1812 sd length 500m drive drive4
1813 sd length 500m drive drive5
1815 .Sh DRIVE LAYOUT CONSIDERATIONS
1817 drives are currently
1819 disk partitions. They must be of type
1821 in order to avoid overwriting data used for other purposes. Use
1823 to edit a partition type definition. The following display shows a typical
1824 partition layout as shown by
1828 # size offset fstype [fsize bsize bps/cpg]
1829 a: 81920 344064 4.2BSD 0 0 0 # (Cyl. 240*- 297*)
1830 b: 262144 81920 swap # (Cyl. 57*- 240*)
1831 c: 4226725 0 unused 0 0 # (Cyl. 0 - 2955*)
1832 e: 81920 0 4.2BSD 0 0 0 # (Cyl. 0 - 57*)
1833 f: 1900000 425984 4.2BSD 0 0 0 # (Cyl. 297*- 1626*)
1834 g: 1900741 2325984 vinum 0 0 0 # (Cyl. 1626*- 2955*)
1837 In this example, partition
1841 partition. Partitions
1850 partitions. Partition
1852 is a swap partition, and partition
1854 represents the whole disk and should not be used for any other purpose.
1857 uses the first 265 sectors on each partition for configuration information, so
1858 the maximum size of a subdisk is 265 sectors smaller than the drive.
1861 maintains a log file, by default
1862 .Pa /var/tmp/vinum_history ,
1863 in which it keeps track of the commands issued to
1865 You can override the name of this file by setting the environment variable
1867 to the name of the file.
1869 Each message in the log file is preceded by a date. The default format is
1870 .Qq Li %e %b %Y %H:%M:%S .
1873 for further details of the format string. It can be overridden by the
1874 environment variable
1875 .Ev VINUM_DATEFORMAT .
1876 .Sh HOW TO SET UP VINUM
1877 This section gives practical advice about how to implement a
1880 .Ss Where to put the data
1881 The first choice you need to make is where to put the data. You need dedicated
1884 They should be partitions, not devices, and they should not be partition
1886 For example, good names are
1894 both of which represent a device, not a partition, and
1896 which represents a complete disk and should be of type
1898 See the example under
1899 .Sx DRIVE LAYOUT CONSIDERATIONS
1901 .Ss Designing volumes
1904 volumes depends on your intentions. There are a number of possibilities:
1907 You may want to join up a number of small disks to make a reasonable sized file
1908 system. For example, if you had five small drives and wanted to use all the
1909 space for a single volume, you might write a configuration file like:
1910 .Bd -literal -offset indent
1911 drive d1 device /dev/da2e
1912 drive d2 device /dev/da3e
1913 drive d3 device /dev/da4e
1914 drive d4 device /dev/da5e
1915 drive d5 device /dev/da6e
1918 sd length 0 drive d1
1919 sd length 0 drive d2
1920 sd length 0 drive d3
1921 sd length 0 drive d4
1922 sd length 0 drive d5
1925 In this case, you specify the length of the subdisks as 0, which means
1926 .Dq "use the largest area of free space that you can find on the drive" .
1927 If the subdisk is the only subdisk on the drive, it will use all available
1932 to obtain additional resilience against disk failures. You have the choice of
1935 or RAID-5, also called
1938 To set up mirroring, create multiple plexes in a volume. For example, to create
1939 a mirrored volume of 2 GB, you might create the following configuration file:
1940 .Bd -literal -offset indent
1941 drive d1 device /dev/da2e
1942 drive d2 device /dev/da3e
1945 sd length 2g drive d1
1947 sd length 2g drive d2
1950 When creating mirrored drives, it is important to ensure that the data from each
1951 plex is on a different physical disk so that
1953 can access the complete address space of the volume even if a drive fails.
1954 Note that each plex requires as much data as the complete volume: in this
1955 example, the volume has a size of 2 GB, but each plex (and each subdisk)
1956 requires 2 GB, so the total disk storage requirement is 4 GB.
1958 To set up RAID-5, create a single plex of type
1960 For example, to create an equivalent resilient volume of 2 GB, you might use the
1961 following configuration file:
1962 .Bd -literal -offset indent
1963 drive d1 device /dev/da2e
1964 drive d2 device /dev/da3e
1965 drive d3 device /dev/da4e
1966 drive d4 device /dev/da5e
1967 drive d5 device /dev/da6e
1970 sd length 512m drive d1
1971 sd length 512m drive d2
1972 sd length 512m drive d3
1973 sd length 512m drive d4
1974 sd length 512m drive d5
1977 RAID-5 plexes require at least three subdisks, one of which is used for storing
1978 parity information and is lost for data storage. The more disks you use, the
1979 greater the proportion of the disk storage can be used for data storage. In
1980 this example, the total storage usage is 2.5 GB, compared to 4 GB for a mirrored
1981 configuration. If you were to use the minimum of only three disks, you would
1982 require 3 GB to store the information, for example:
1983 .Bd -literal -offset indent
1984 drive d1 device /dev/da2e
1985 drive d2 device /dev/da3e
1986 drive d3 device /dev/da4e
1989 sd length 1g drive d1
1990 sd length 1g drive d2
1991 sd length 1g drive d3
1994 As with creating mirrored drives, it is important to ensure that the data from
1995 each subdisk is on a different physical disk so that
1997 can access the complete address space of the volume even if a drive fails.
2001 to allow more concurrent access to a file system. In many cases, access to a
2002 file system is limited by the speed of the disk. By spreading the volume across
2003 multiple disks, you can increase the throughput in multi-access environments.
2004 This technique shows little or no performance improvement in single-access
2007 uses a technique called
2009 or sometimes RAID-0, to increase this concurrency of access. The name RAID-0 is
2010 misleading: striping does not provide any redundancy or additional reliability.
2011 In fact, it decreases the reliability, since the failure of a single disk will
2012 render the volume useless, and the more disks you have, the more likely it is
2013 that one of them will fail.
2015 To implement striping, use a
2018 .Bd -literal -offset indent
2019 drive d1 device /dev/da2e
2020 drive d2 device /dev/da3e
2021 drive d3 device /dev/da4e
2022 drive d4 device /dev/da5e
2024 plex org striped 512k
2025 sd length 512m drive d1
2026 sd length 512m drive d2
2027 sd length 512m drive d3
2028 sd length 512m drive d4
2031 A striped plex must have at least two subdisks, but the increase in performance
2032 is greater if you have a larger number of disks.
2034 You may want to have the best of both worlds and have both resilience and
2035 performance. This is sometimes called RAID-10 (a combination of RAID-1 and
2036 RAID-0), though again this name is misleading. With
2038 you can do this with the following configuration file:
2039 .Bd -literal -offset indent
2040 drive d1 device /dev/da2e
2041 drive d2 device /dev/da3e
2042 drive d3 device /dev/da4e
2043 drive d4 device /dev/da5e
2044 volume raid setupstate
2045 plex org striped 512k
2046 sd length 512m drive d1
2047 sd length 512m drive d2
2048 sd length 512m drive d3
2049 sd length 512m drive d4
2050 plex org striped 512k
2051 sd length 512m drive d4
2052 sd length 512m drive d3
2053 sd length 512m drive d2
2054 sd length 512m drive d1
2057 Here the plexes are striped, increasing performance, and there are two of them,
2058 increasing reliability. Note that this example shows the subdisks of the second
2059 plex in reverse order from the first plex. This is for performance reasons and
2060 will be discussed below. In addition, the volume specification includes the
2063 which ensures that all plexes are
2067 .Ss Creating the volumes
2068 Once you have created your configuration files, start
2070 and create the volumes. In this example, the configuration is in the file
2072 .Bd -literal -offset 2n
2073 # vinum create -v configfile
2074 1: drive d1 device /dev/da2e
2075 2: drive d2 device /dev/da3e
2078 5: sd length 2g drive d1
2080 7: sd length 2g drive d2
2081 Configuration summary
2083 Drives: 2 (4 configured)
2084 Volumes: 1 (4 configured)
2085 Plexes: 2 (8 configured)
2086 Subdisks: 2 (16 configured)
2088 Drive d1: Device /dev/da2e
2089 Created on vinum.lemis.com at Tue Mar 23 12:30:31 1999
2090 Config last updated Tue Mar 23 14:30:32 1999
2091 Size: 60105216000 bytes (57320 MB)
2092 Used: 2147619328 bytes (2048 MB)
2093 Available: 57957596672 bytes (55272 MB)
2096 Drive d2: Device /dev/da3e
2097 Created on vinum.lemis.com at Tue Mar 23 12:30:32 1999
2098 Config last updated Tue Mar 23 14:30:33 1999
2099 Size: 60105216000 bytes (57320 MB)
2100 Used: 2147619328 bytes (2048 MB)
2101 Available: 57957596672 bytes (55272 MB)
2105 Volume mirror: Size: 2147483648 bytes (2048 MB)
2109 Read policy: round robin
2111 Plex mirror.p0: Size: 2147483648 bytes (2048 MB)
2114 Organization: concat
2115 Part of volume mirror
2116 Plex mirror.p1: Size: 2147483648 bytes (2048 MB)
2119 Organization: concat
2120 Part of volume mirror
2122 Subdisk mirror.p0.s0:
2123 Size: 2147483648 bytes (2048 MB)
2125 Plex mirror.p0 at offset 0
2127 Subdisk mirror.p1.s0:
2128 Size: 2147483648 bytes (2048 MB)
2130 Plex mirror.p1 at offset 0
2137 to list the file as it configures. Subsequently it lists the current
2138 configuration in the same format as the
2141 .Ss Creating more volumes
2142 Once you have created the
2146 keeps track of them in its internal configuration files. You do not need to
2147 create them again. In particular, if you run the
2149 command again, you will create additional objects:
2151 # vinum create sampleconfig
2152 Configuration summary
2154 Drives: 2 (4 configured)
2155 Volumes: 1 (4 configured)
2156 Plexes: 4 (8 configured)
2157 Subdisks: 4 (16 configured)
2159 D d1 State: up Device /dev/da2e Avail: 53224/57320 MB (92%)
2160 D d2 State: up Device /dev/da3e Avail: 53224/57320 MB (92%)
2162 V mirror State: up Plexes: 4 Size: 2048 MB
2164 P mirror.p0 C State: up Subdisks: 1 Size: 2048 MB
2165 P mirror.p1 C State: up Subdisks: 1 Size: 2048 MB
2166 P mirror.p2 C State: up Subdisks: 1 Size: 2048 MB
2167 P mirror.p3 C State: up Subdisks: 1 Size: 2048 MB
2169 S mirror.p0.s0 State: up PO: 0 B Size: 2048 MB
2170 S mirror.p1.s0 State: up PO: 0 B Size: 2048 MB
2171 S mirror.p2.s0 State: up PO: 0 B Size: 2048 MB
2172 S mirror.p3.s0 State: up PO: 0 B Size: 2048 MB
2175 As this example (this time with the
2177 option) shows, re-running the
2179 has created four new plexes, each with a new subdisk. If you want to add other
2180 volumes, create new configuration files for them. They do not need to reference
2183 already knows about. For example, to create a volume
2186 .Pa /dev/da1e , /dev/da2e , /dev/da3e
2189 you only need to mention the other two:
2190 .Bd -literal -offset indent
2191 drive d3 device /dev/da1e
2192 drive d4 device /dev/da4e
2201 With this configuration file, we get:
2203 # vinum create newconfig
2204 Configuration summary
2206 Drives: 4 (4 configured)
2207 Volumes: 2 (4 configured)
2208 Plexes: 5 (8 configured)
2209 Subdisks: 8 (16 configured)
2211 D d1 State: up Device /dev/da2e Avail: 51176/57320 MB (89%)
2212 D d2 State: up Device /dev/da3e Avail: 53220/57320 MB (89%)
2213 D d3 State: up Device /dev/da1e Avail: 53224/57320 MB (92%)
2214 D d4 State: up Device /dev/da4e Avail: 53224/57320 MB (92%)
2216 V mirror State: down Plexes: 4 Size: 2048 MB
2217 V raid State: down Plexes: 1 Size: 6144 MB
2219 P mirror.p0 C State: init Subdisks: 1 Size: 2048 MB
2220 P mirror.p1 C State: init Subdisks: 1 Size: 2048 MB
2221 P mirror.p2 C State: init Subdisks: 1 Size: 2048 MB
2222 P mirror.p3 C State: init Subdisks: 1 Size: 2048 MB
2223 P raid.p0 R5 State: init Subdisks: 4 Size: 6144 MB
2225 S mirror.p0.s0 State: up PO: 0 B Size: 2048 MB
2226 S mirror.p1.s0 State: up PO: 0 B Size: 2048 MB
2227 S mirror.p2.s0 State: up PO: 0 B Size: 2048 MB
2228 S mirror.p3.s0 State: up PO: 0 B Size: 2048 MB
2229 S raid.p0.s0 State: empty PO: 0 B Size: 2048 MB
2230 S raid.p0.s1 State: empty PO: 512 kB Size: 2048 MB
2231 S raid.p0.s2 State: empty PO: 1024 kB Size: 2048 MB
2232 S raid.p0.s3 State: empty PO: 1536 kB Size: 2048 MB
2235 Note the size of the RAID-5 plex: it is only 6 GB, although together its
2236 components use 8 GB of disk space. This is because the equivalent of one
2237 subdisk is used for storing parity data.
2238 .Ss Restarting Vinum
2239 On rebooting the system, start
2247 This will start all the
2249 drives in the system. If for some reason you wish to start only some of them,
2253 .Ss Performance considerations
2254 A number of misconceptions exist about how to set up a RAID array for best
2255 performance. In particular, most systems use far too small a stripe size. The
2256 following discussion applies to all RAID systems, not just to
2261 block I/O system issues requests of between .5kB and 128 kB; a
2262 typical mix is somewhere round 8 kB. You can't stop any striping system from
2263 breaking a request into two physical requests, and if you make the stripe small
2264 enough, it can be broken into several. This will result in a significant drop
2265 in performance: the decrease in transfer time per disk is offset by the order of
2266 magnitude greater increase in latency.
2268 With modern disk sizes and the
2270 I/O system, you can expect to have a
2271 reasonably small number of fragmented requests with a stripe size between 256 kB
2272 and 512 kB; with correct RAID implementations there is no obvious reason not to
2273 increase the size to 2 or 4 MB on a large disk.
2275 When choosing a stripe size, consider that most current UFS file systems have
2276 cylinder groups 32 MB in size. If you have a stripe size and number of disks
2277 both of which are a power of two, it is probable that all superblocks and inodes
2278 will be placed on the same subdisk, which will impact performance significantly.
2279 Choose an odd number instead, for example 479 kB.
2281 The easiest way to consider the impact of any transfer in a multi-access system
2282 is to look at it from the point of view of the potential bottleneck, the disk
2283 subsystem: how much total disk time does the transfer use?
2285 everything is cached, the time relationship between the request and its
2286 completion is not so important: the important parameter is the total time that
2287 the request keeps the disks active, the time when the disks are not available to
2288 perform other transfers. As a result, it doesn't really matter if the transfers
2289 are happening at the same time or different times. In practical terms, the time
2290 we're looking at is the sum of the total latency (positioning time and
2291 rotational latency, or the time it takes for the data to arrive under the disk
2292 heads) and the total transfer time. For a given transfer to disks of the same
2293 speed, the transfer time depends only on the total size of the transfer.
2295 Consider a typical news article or web page of 24 kB, which will probably be
2296 read in a single I/O. Take disks with a transfer rate of 6 MB/s and an average
2297 positioning time of 8 ms, and a file system with 4 kB blocks. Since it's 24 kB,
2298 we don't have to worry about fragments, so the file will start on a 4 kB
2299 boundary. The number of transfers required depends on where the block starts:
2300 it's (S + F - 1) / S, where S is the stripe size in file system blocks, and F is
2301 the file size in file system blocks.
2304 Stripe size of 4 kB. You'll have 6 transfers. Total subsystem load: 48 ms
2305 latency, 2 ms transfer, 50 ms total.
2307 Stripe size of 8 kB. On average, you'll have 3.5 transfers. Total subsystem
2308 load: 28 ms latency, 2 ms transfer, 30 ms total.
2310 Stripe size of 16 kB. On average, you'll have 2.25 transfers. Total subsystem
2311 load: 18 ms latency, 2 ms transfer, 20 ms total.
2313 Stripe size of 256 kB. On average, you'll have 1.08 transfers. Total subsystem
2314 load: 8.6 ms latency, 2 ms transfer, 10.6 ms total.
2316 Stripe size of 4 MB. On average, you'll have 1.0009 transfers. Total subsystem
2317 load: 8.01 ms latency, 2 ms transfer, 10.01 ms total.
2320 It appears that some hardware RAID systems have problems with large stripes:
2321 they appear to always transfer a complete stripe to or from disk, so that a
2322 large stripe size will have an adverse effect on performance.
2324 does not suffer from this problem: it optimizes all disk transfers and does not
2325 transfer unneeded data.
2327 Note that no well-known benchmark program tests true multi-access conditions
2328 (more than 100 concurrent users), so it is difficult to demonstrate the validity
2329 of these statements.
2331 Given these considerations, the following factors affect the performance of a
2336 Striping improves performance for multiple access only, since it increases the
2337 chance of individual requests being on different drives.
2339 Concatenating UFS file systems across multiple drives can also improve
2340 performance for multiple file access, since UFS divides a file system into
2341 cylinder groups and attempts to keep files in a single cylinder group. In
2342 general, it is not as effective as striping.
2344 Mirroring can improve multi-access performance for reads, since by default
2346 issues consecutive reads to consecutive plexes.
2348 Mirroring decreases performance for all writes, whether multi-access or single
2349 access, since the data must be written to both plexes. This explains the
2350 subdisk layout in the example of a mirroring configuration above: if the
2351 corresponding subdisk in each plex is on a different physical disk, the write
2352 commands can be issued in parallel, whereas if they are on the same physical
2353 disk, they will be performed sequentially.
2355 RAID-5 reads have essentially the same considerations as striped reads, unless
2356 the striped plex is part of a mirrored volume, in which case the performance of
2357 the mirrored volume will be better.
2359 RAID-5 writes are approximately 25% of the speed of striped writes: to perform
2362 must first read the data block and the corresponding parity block, perform some
2363 calculations and write back the parity block and the data block, four times as
2364 many transfers as for writing a striped plex. On the other hand, this is offset
2365 by the cost of mirroring, so writes to a volume with a single RAID-5 plex are
2366 approximately half the speed of writes to a correctly configured volume with two
2371 configuration changes (for example, adding or removing objects, or the change of
2372 state of one of the objects),
2374 writes up to 128 kB of updated configuration to each drive. The larger the
2375 number of drives, the longer this takes.
2377 .Ss Creating file systems on Vinum volumes
2378 You do not need to run
2380 before creating a file system on a
2386 option to state that the device is not divided into partitions. For example, to
2387 create a file system on volume
2389 enter the following command:
2391 .Dl "# newfs -v /dev/vinum/mirror"
2393 A number of other considerations apply to
2398 There is no advantage in creating multiple drives on a single disk. Each drive
2399 uses 131.5 kB of data for label and configuration information, and performance
2400 will suffer when the configuration changes. Use appropriately sized subdisks instead.
2402 It is possible to increase the size of a concatenated
2404 plex, but currently the size of striped and RAID-5 plexes cannot be increased.
2405 Currently the size of an existing UFS file system also cannot be increased, but
2406 it is planned to make both plexes and file systems extensible.
2408 .Sh STATE MANAGEMENT
2409 Vinum objects have the concept of
2413 for more details. They are only completely accessible if their state is
2415 To change an object state to
2419 command. To change an object state to
2423 command. Normally other states are created automatically by the relationship
2424 between objects. For example, if you add a plex to a volume, the subdisks of
2425 the plex will be set in the
2427 state, indicating that, though the hardware is accessible, the data on the
2428 subdisk is invalid. As a result of this state, the plex will be set in the
2431 .Ss The `reviving' state
2432 In many cases, when you start a subdisk the system must copy data to the
2433 subdisk. Depending on the size of the subdisk, this can take a long time.
2434 During this time, the subdisk is set in the
2436 state. On successful completion of the copy operation, it is automatically set
2439 state. It is possible for the process performing the revive to be stopped and
2440 restarted. The system keeps track of how far the subdisk has been revived, and
2443 command is reissued, the copying continues from this point.
2445 In order to maintain the consistency of a volume while one or more of its plexes
2448 writes to subdisks which have been revived up to the point of the write. It may
2449 also read from the plex if the area being read has already been revived.
2451 The following points are not bugs, and they have good reasons for existing, but
2452 they have shown to cause confusion. Each is discussed in the appropriate
2459 disk partitions and must have the partition type
2461 This is different from
2463 which expects partitions of type
2467 is an invitation to shoot yourself in the foot: with
2469 you can easily overwrite a file system.
2471 will not permit this.
2473 For similar reasons, the
2475 command will not accept a drive on partition
2479 is used by the system to represent the whole disk, and must be of type
2481 Clearly there is a conflict here, which
2483 resolves by not using the
2487 When you create a volume with multiple plexes,
2489 does not automatically initialize the plexes. This means that the contents are
2490 not known, but they are certainly not consistent. As a result, by default
2492 sets the state of all newly-created plexes except the first to
2494 In order to synchronize them with the first plex, you must
2498 to copy the data from a plex which is in the
2500 state. Depending on the size of the subdisks involved, this can take a long
2503 In practice, people aren't too interested in what was in the plex when it was
2504 created, and other volume managers cheat by setting them
2508 provides two ways to ensure that newly created plexes are
2512 Create the plexes and then synchronize them with
2515 Create the volume (not the plex) with the keyword
2519 to ignore any possible inconsistency and set the plexes to be
2523 Some of the commands currently supported by
2525 are not really needed. For reasons which I don't understand, however, I find
2526 that users frequently try the
2530 commands, though especially
2532 outputs all sort of dire warnings. Don't use these commands unless you have a
2533 good reason to do so.
2535 Some state transitions are not very intuitive. In fact, it's not clear whether
2536 this is a bug or a feature. If you find that you can't start an object in some
2537 strange state, such as a
2539 subdisk, try first to get it into
2545 commands. If that works, you should then be able to start it. If you find
2546 that this is the only way to get out of a position where easier methods fail,
2547 please report the situation.
2549 If you build the kernel module with the
2550 .Fl D Ns Dv VINUMDEBUG
2551 option, you must also build
2554 .Fl D Ns Dv VINUMDEBUG
2555 option, since the size of some data objects used by both components depends on
2556 this option. If you don't do so, commands will fail with the message
2557 .Sy Invalid argument ,
2558 and a console message will be logged such as
2560 .It "vinumioctl: invalid ioctl from process 247 (vinum): c0e44642"
2563 This error may also occur if you use old versions of KLD or userland program.
2567 command has a particularly emetic syntax. Once it was the only way to start
2569 but now the preferred method is with
2572 should be used for maintenance purposes only. Note that its syntax has changed,
2573 and the arguments must be disk slices, such as
2575 not partitions such as
2579 .Bl -tag -width VINUM_DATEFORMAT
2580 .It Ev VINUM_HISTORY
2581 The name of the log file, by default
2582 .Pa /var/log/vinum_history .
2583 .It Ev VINUM_DATEFORMAT
2584 The format of dates in the log file, by default
2585 .Qq Li %e %b %Y %H:%M:%S .
2587 The name of the editor to use for editing configuration files, by default
2591 .Bl -tag -width /dev/vinum/control -compact
2593 directory with device nodes for
2596 .It Pa /dev/vinum/control
2599 .It Pa /dev/vinum/plex
2600 directory containing device nodes for
2603 .It Pa /dev/vinum/sd
2604 directory containing device nodes for
2614 .Pa http://www.vinumvm.org/vinum/ ,
2615 .Pa http://www.vinumvm.org/vinum/how-to-debug.html .
2619 command first appeared in
2621 The RAID-5 component of
2623 was developed for Cybernet Inc.\&
2624 .Pq Pa www.cybernet.com
2625 for its NetMAX product.
2627 .An Greg Lehey Aq grog@lemis.com