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. All advertising materials mentioning features or use of this software
18 .\" must display the following acknowledgement:
19 .\" This product includes software developed by Nan Yang Computer
21 .\" 4. Neither the name of the Company nor the names of its contributors
22 .\" may be used to endorse or promote products derived from this software
23 .\" without specific prior written permission.
25 .\" This software is provided ``as is'', and any express or implied
26 .\" warranties, including, but not limited to, the implied warranties of
27 .\" merchantability and fitness for a particular purpose are disclaimed.
28 .\" In no event shall the company or contributors be liable for any
29 .\" direct, indirect, incidental, special, exemplary, or consequential
30 .\" damages (including, but not limited to, procurement of substitute
31 .\" goods or services; loss of use, data, or profits; or business
32 .\" interruption) however caused and on any theory of liability, whether
33 .\" in contract, strict liability, or tort (including negligence or
34 .\" otherwise) arising in any way out of the use of this software, even if
35 .\" advised of the possibility of such damage.
37 .\" $Id: vinum.8,v 1.48 2001/01/15 22:15:05 grog Exp $
38 .\" $FreeBSD: src/sbin/vinum/vinum.8,v 1.33.2.10 2002/12/29 16:35:38 schweikh Exp $
39 .\" $DragonFly: src/sbin/vinum/vinum.8,v 1.5 2006/05/26 19:39:39 swildner Exp $
46 .Nd Logical Volume Manager control program
52 .Bl -tag -width indent
53 .It Ic attach Ar plex volume Op Cm rename
55 .Ic attach Ar subdisk plex
59 Attach a plex to a volume, or a subdisk to a plex.
61 .Ic checkparity Ar plex
65 Check the parity blocks of a RAID-4 or RAID-5 plex.
73 Create a concatenated volume from the specified drives.
79 Create a volume as described in
80 .Ar description-file .
82 Cause the volume manager to enter the kernel debugger.
90 Detach a plex or subdisk from the volume or plex to which it is attached.
91 .It Ic dumpconfig Op Ar drive ...
92 List the configuration information stored on the specified drives, or all drives
93 in the system if no drive names are specified.
99 List information about volume manager state.
107 Initialize the contents of a subdisk or all the subdisks of a plex to all zeros.
108 .It Ic label Ar volume
109 Create a volume label.
116 .Op Ar volume | plex | subdisk
118 List information about specified objects.
127 List information about drives.
136 List information about subdisks.
145 List information about plexes.
154 List information about volumes.
156 Remake the device nodes in
166 Create a mirrored volume from the specified drives.
172 Move the object(s) to the specified drive.
173 .It Ic printconfig Op Ar file
174 Write a copy of the current configuration to
179 program when running in interactive mode. Normally this would be done by
183 .It Ic read Ar disk ...
186 configuration from the specified disks.
189 .Op Ar drive | subdisk | plex | volume
192 Change the name of the specified object.
194 .\".It Ic replace Ar drive newdrive
195 .\"Move all the subdisks from the specified drive onto the new drive.
197 .Ic rebuildparity Ar plex Op Fl f
201 Rebuild the parity blocks of a RAID-4 or RAID-5 plex.
209 .Op Ar volume | plex | subdisk
211 Reset statistics counters for the specified objects, or for all objects if none
217 .Ar volume | plex | subdisk
223 configuration to disk after configuration failures.
229 .\".Ar volume | plex | subdisk | disk
231 .\"Set the state of the object to
233 .It Ic setdaemon Op Ar value
234 Set daemon configuration.
238 .Op Ar volume | plex | subdisk | drive
240 Set state without influencing other objects, for diagnostic purposes only.
242 Read configuration from all vinum drives.
248 .Ar volume | plex | subdisk
250 Allow the system to access the objects.
254 .Op Ar volume | plex | subdisk
256 Terminate access to the objects, or stop
258 if no parameters are specified.
266 Create a striped volume from the specified drives.
270 is a utility program to communicate with the
275 is designed either for interactive use, when started without command line
276 arguments, or to execute a single command if the command is supplied on the
277 command line. In interactive mode,
279 maintains a command line history.
282 commands may optionally be followed by an option. Any of the following options
283 may be specified with any command, but in some cases the options are ignored.
291 .Bl -tag -width indent
296 option overrides safety checks. Use with extreme care. This option is for
297 emergency use only. For example, the command
303 even if it is open. Any subsequent access to the volume will almost certainly
305 .It Fl i Ar millisecs
312 milliseconds between copying each block. This lowers the load on the system.
316 option to specify a volume name to the simplified configuration commands
324 option is used by the list commands to display information not
325 only about the specified objects, but also about subordinate objects. For
326 example, in conjunction with the
330 option will also show information about the plexes and subdisks belonging to the
336 option is used by the list commands to display statistical information. The
338 command also uses this option to specify that it should create striped plexes.
342 option specifies the transfer size for the
351 option can be used to request more detailed information.
356 option can be used to request more detailed information than the
365 to wait for completion of commands which normally run in the background, such as
368 .Sh COMMANDS IN DETAIL
370 commands perform the following functions:
372 .Bl -tag -width indent -compact
373 .It Ic attach Ar plex volume Op Cm rename
375 .Ic attach Ar subdisk plex
380 inserts the specified plex or subdisk in a volume or plex. In the case of a
381 subdisk, an offset in the plex may be specified. If it is not, the subdisk will
382 be attached at the first possible location. After attaching a plex to a
385 reintegrates the plex.
391 renames the object (and in the case of a plex, any subordinate subdisks) to fit
394 naming convention. To rename the object to any other name, use the
398 A number of considerations apply to attaching subdisks:
401 Subdisks can normally only be attached to concatenated plexes.
403 If a striped or RAID-5 plex is missing a subdisk (for example after drive
404 failure), it should be replaced by a subdisk of the same size only.
406 In order to add further subdisks to a striped or RAID-5 plex, use the
408 (force) option. This will corrupt the data in the plex.
409 .\"No other attachment of
410 .\"subdisks is currently allowed for striped and RAID-5 plexes.
412 For concatenated plexes, the
414 parameter specifies the offset in blocks from the beginning of the plex. For
415 striped and RAID-5 plexes, it specifies the offset of the first block of the
416 subdisk: in other words, the offset is the numerical position of the subdisk
417 multiplied by the stripe size. For example, in a plex with stripe size 271k,
418 the first subdisk will have offset 0, the second offset 271k, the third 542k,
419 etc. This calculation ignores parity blocks in RAID-5 plexes.
428 Check the parity blocks on the specified RAID-4 or RAID-5 plex. This operation
429 maintains a pointer in the plex, so it can be stopped and later restarted from
430 the same position if desired. In addition, this pointer is used by the
432 command, so rebuilding the parity blocks need only start at the location where
433 the first parity problem has been detected.
439 starts checking at the beginning of the plex. If the
443 prints a running progress report.
454 command provides a simplified alternative to the
456 command for creating volumes with a single concatenated plex. The largest
457 contiguous space available on each drive is used to create the subdisks for the
462 command creates an arbitrary name for the volume and its components. The name
463 is composed of the text
465 and a small integer, for example
467 You can override this with the
469 option, which assigns the name specified to the volume. The plexes and subdisks
470 are named after the volume in the default manner.
472 There is no choice of name for the drives. If the drives have already been
475 drives, the name remains. Otherwise the drives are given names starting with
478 and a small integer, for example
484 option can be used to specify that a previous name should be overwritten. The
486 is used to specify verbose output.
489 .Sx SIMPLIFIED CONFIGURATION
490 below for some examples of this
499 is used to create any object. In view of the relatively complicated
500 relationship and the potential dangers involved in creating a
502 object, there is no interactive interface to this function. If you do not
505 starts an editor on a temporary file. If the environment variable
509 starts this editor. If not, it defaults to
512 .Sx CONFIGURATION FILE
513 below for more information on the format of
518 function is additive: if you run it multiple times, you will create multiple
519 copies of all unnamed objects.
523 command will not change the names of existing
525 drives, in order to avoid accidentally erasing them. The correct way to dispose
528 drives is to reset the configuration with the
530 command. In some cases, however, it may be necessary to create new data on
532 drives which can no longer be started. In this case, use the
538 without any arguments, is used to enter the remote kernel debugger. It is only
543 option. This option will stop the execution of the operating system until the
544 kernel debugger is exited. If remote debugging is set and there is no remote
545 connection for a kernel debugger, it will be necessary to reset the system and
546 reboot in order to leave the debugger.
548 .It Ic debug Ar flags
549 Set a bit mask of internal debugging flags. These will change without warning
550 as the product matures; to be certain, read the header file
551 .Pa /sys/dev/raid/vinum/vinumvar.h .
552 The bit mask is composed of the following values:
553 .Bl -tag -width indent
554 .It Dv DEBUG_ADDRESSES Pq No 1
555 Show buffer information during requests
556 .\".It Dv DEBUG_NUMOUTPUT Pq No 2
558 .\".Va vp->v_numoutput .
559 .It Dv DEBUG_RESID Pq No 4
562 .It Dv DEBUG_LASTREQS Pq No 8
563 Keep a circular buffer of last requests.
564 .It Dv DEBUG_REVIVECONFLICT Pq No 16
565 Print info about revive conflicts.
566 .It Dv DEBUG_EOFINFO Pq No 32
567 Print information about internal state when returning an
570 .It Dv DEBUG_MEMFREE Pq No 64
571 Maintain a circular list of the last memory areas freed by the memory allocator.
572 .It Dv DEBUG_REMOTEGDB Pq No 256
578 .It Dv DEBUG_WARNINGS Pq No 512
579 Print some warnings about minor problems in the implementation.
582 .It Ic detach Oo Fl f Oc Ar plex
583 .It Ic detach Oo Fl f Oc Ar subdisk
585 removes the specified plex or subdisk from the volume or plex to which it is
586 attached. If removing the object would impair the data integrity of the volume,
587 the operation will fail unless the
589 option is specified. If the object is named after the object above it (for
594 the name will be changed
595 by prepending the text
598 .Li ex-vol1.p7.s0 ) .
599 If necessary, the name will be truncated in the
603 does not reduce the number of subdisks in a striped or RAID-5 plex. Instead,
604 the subdisk is marked absent, and can later be replaced with the
608 .It Ic dumpconfig Op Ar drive ...
611 shows the configuration information stored on the specified drives. If no drive
614 searches all drives on the system for Vinum partitions and dumps the
615 information. If configuration updates are disabled, it is possible that this
616 information is not the same as the information returned by the
618 command. This command is used primarily for maintenance and debugging.
622 displays information about
624 memory usage. This is intended primarily for debugging. With the
626 option, it will give detailed information about the memory areas in use.
632 displays information about the last up to 64 I/O requests handled by the
634 driver. This information is only collected if debug flag 8 is set. The format
639 Total of 38 blocks malloced, total memory: 16460
640 Maximum allocs: 56, malloc table at 0xf0f72dbc
642 Time Event Buf Dev Offset Bytes SD SDoff Doffset Goffset
644 14:40:00.637758 1VS Write 0xf2361f40 91.3 0x10 16384
645 14:40:00.639280 2LR Write 0xf2361f40 91.3 0x10 16384
646 14:40:00.639294 3RQ Read 0xf2361f40 4.39 0x104109 8192 19 0 0 0
647 14:40:00.639455 3RQ Read 0xf2361f40 4.23 0xd2109 8192 17 0 0 0
648 14:40:00.639529 3RQ Read 0xf2361f40 4.15 0x6e109 8192 16 0 0 0
649 14:40:00.652978 4DN Read 0xf2361f40 4.39 0x104109 8192 19 0 0 0
650 14:40:00.667040 4DN Read 0xf2361f40 4.15 0x6e109 8192 16 0 0 0
651 14:40:00.668556 4DN Read 0xf2361f40 4.23 0xd2109 8192 17 0 0 0
652 14:40:00.669777 6RP Write 0xf2361f40 4.39 0x104109 8192 19 0 0 0
653 14:40:00.685547 4DN Write 0xf2361f40 4.39 0x104109 8192 19 0 0 0
654 11:11:14.975184 Lock 0xc2374210 2 0x1f8001
655 11:11:15.018400 7VS Write 0xc2374210 0x7c0 32768 10
656 11:11:15.018456 8LR Write 0xc2374210 13.39 0xcc0c9 32768
657 11:11:15.046229 Unlock 0xc2374210 2 0x1f8001
662 field always contains the address of the user buffer header. This can be used
663 to identify the requests associated with a user request, though this is not 100%
664 reliable: theoretically two requests in sequence could use the same buffer
665 header, though this is not common. The beginning of a request can be identified
670 The first example above shows the requests involved in a user request. The
671 second is a subdisk I/O request with locking.
675 field contains information related to the sequence of events in the request
680 indicates the approximate sequence of events, and the two-letter abbreviation is
681 a mnemonic for the location:
682 .Bl -tag -width Lockwait
684 (vinumstrategy) shows information about the user request on entry to
686 The device number is the
688 device, and offset and length are the user parameters. This is always the
689 beginning of a request sequence.
691 (launch_requests) shows the user request just prior to launching the low-level
693 requests in the function
694 .Fn launch_requests .
695 The parameters should be the same as in the
700 In the following requests,
702 is the device number of the associated disk partition,
704 is the offset from the beginning of the partition,
706 is the subdisk index in
709 is the offset from the beginning of the subdisk,
711 is the offset of the associated data request, and
713 is the offset of the associated group request, where applicable.
714 .Bl -tag -width Lockwait
716 (request) shows one of possibly several low-level
718 requests which are launched to satisfy the high-level request. This information
720 .Fn launch_requests .
722 (done) is called from
724 showing the completion of a request. This completion should match a request
725 launched either at stage
728 .Fn launch_requests ,
730 .Fn complete_raid5_write
736 (RAID-5 data) is called from
737 .Fn complete_raid5_write
738 and represents the data written to a RAID-5 data stripe after calculating
741 (RAID-5 parity) is called from
742 .Fn complete_raid5_write
743 and represents the data written to a RAID-5 parity stripe after calculating
746 shows a subdisk I/O request. These requests are usually internal to
748 for operations like initialization or rebuilding plexes.
750 shows the low-level operation generated for a subdisk I/O request.
752 specifies that the process is waiting for a range lock. The parameters are the
753 buffer header associated with the request, the plex number and the block number.
754 For internal reasons the block number is one higher than the address of the
755 beginning of the stripe.
757 specifies that a range lock has been obtained. The parameters are the same as
760 specifies that a range lock has been released. The parameters are the same as
772 initializes a subdisk by writing zeroes to it. You can initialize all subdisks
773 in a plex by specifying the plex name. This is the only way to ensure
774 consistent data in a plex. You must perform this initialization before using a
775 RAID-5 plex. It is also recommended for other new plexes.
777 initializes all subdisks of a plex in parallel. Since this operation can take a
778 long time, it is normally performed in the background. If you want to wait for
779 completion of the command, use the
785 option if you want to write blocks of a different size from the default value of
788 prints a console message when the initialization is complete.
790 .It Ic label Ar volume
795 style volume label on a volume. It is a simple alternative to an appropriate
798 This is needed because some
800 commands still read the disk to find the label instead of using the correct
804 maintains a volume label separately from the volume data, so this command is not
807 This command is deprecated.
813 .Op Ar volume | plex | subdisk
819 .Op Ar volume | plex | subdisk
854 is used to show information about the specified object. If the argument is
855 omitted, information is shown about all objects known to
859 command is a synonym for
864 option relates to volumes and plexes: if specified, it recursively lists
865 information for the subdisks and (for a volume) plexes subordinate to the
866 objects. The commands
870 list only volumes, plexes, subdisks and drives respectively. This is
871 particularly useful when used without parameters.
877 to output device statistics, the
879 (verbose) option causes some additional information to be output, and the
881 causes considerable additional information to be output.
886 command removes the directory
888 and recreates it with device nodes
889 which reflect the current configuration. This command is not intended for
890 general use, and is provided for emergency use only.
902 command provides a simplified alternative to the
904 command for creating mirrored volumes. Without any options, it creates a RAID-1
905 (mirrored) volume with two concatenated plexes. The largest contiguous space
906 available on each drive is used to create the subdisks for the plexes. The
907 first plex is built from the odd-numbered drives in the list, and the second
908 plex is built from the even-numbered drives. If the drives are of different
909 sizes, the plexes will be of different sizes.
915 builds striped plexes with a stripe size of 256 kB. The size of the subdisks in
916 each plex is the size of the smallest contiguous storage available on any of the
917 drives which form the plex. Again, the plexes may differ in size.
921 command creates an arbitrary name for the volume and its components. The name
922 is composed of the text
924 and a small integer, for example
926 You can override this with the
928 option, which assigns the name specified to the volume. The plexes and subdisks
929 are named after the volume in the default manner.
931 There is no choice of name for the drives. If the drives have already been
934 drives, the name remains. Otherwise the drives are given names starting with
937 and a small integer, for example
943 option can be used to specify that a previous name should be overwritten. The
945 is used to specify verbose output.
948 .Sx SIMPLIFIED CONFIGURATION
949 below for some examples of this
952 .It Ic mv Fl f Ar drive object ...
953 .It Ic move Fl f Ar drive object ...
954 Move all the subdisks from the specified objects onto the new drive. The
955 objects may be subdisks, drives or plexes. When drives or plexes are specified,
956 all subdisks associated with the object are moved.
960 option is required for this function, since it currently does not preserve the
961 data in the subdisk. This functionality will be added at a later date. In this
962 form, however, it is suited to recovering a failed disk drive.
964 .It Ic printconfig Op Ar file
965 Write a copy of the current configuration to
967 in a format that can be used to recreate the
969 configuration. Unlike the configuration saved on disk, it includes definitions
970 of the drives. If you omit
979 program when running in interactive mode. Normally this would be done by
984 .It Ic read Ar disk ...
987 command scans the specified disks for
989 partitions containing previously created configuration information. It reads
990 the configuration in order from the most recently updated to least recently
991 updated configuration.
993 maintains an up-to-date copy of all configuration information on each disk
994 partition. You must specify all of the slices in a configuration as the
995 parameter to this command.
999 command is intended to selectively load a
1001 configuration on a system which has other
1003 partitions. If you want to start all partitions on the system, it is easier to
1010 encounters any errors during this command, it will turn off automatic
1011 configuration update to avoid corrupting the copies on disk. This will also
1012 happen if the configuration on disk indicates a configuration error (for
1013 example, subdisks which do not have a valid space specification). You can turn
1014 the updates on again with the
1018 commands. Reset bit 2 (numerical value 4) of the daemon options mask to
1019 re-enable configuration saves.
1028 Rebuild the parity blocks on the specified RAID-4 or RAID-5 plex. This
1029 operation maintains a pointer in the plex, so it can be stopped and later
1030 restarted from the same position if desired. In addition, this pointer is used
1033 command, so rebuilding the parity blocks need only start at the location where
1034 the first parity problem has been detected.
1040 starts rebuilding at the beginning of the plex. If the
1044 first checks the existing parity blocks prints information about those found to
1045 be incorrect before rebuilding. If the
1049 prints a running progress report.
1054 .Op Ar drive | subdisk | plex | volume
1057 Change the name of the specified object. If the
1059 option is specified, subordinate objects will be named by the default rules:
1060 plex names will be formed by appending
1062 to the volume name, and
1063 subdisk names will be formed by appending
1069 .\".Ar drive newdrive
1070 .\"Move all the subdisks from the specified drive onto the new drive. This will
1071 .\"attempt to recover those subdisks that can be recovered, and create the others
1072 .\"from scratch. If the new drive lacks the space for this operation, as many
1073 .\"subdisks as possible will be fitted onto the drive, and the rest will be left on
1074 .\"the original drive.
1079 command completely obliterates the
1081 configuration on a system. Use this command only when you want to completely
1082 delete the configuration.
1084 will ask for confirmation; you must type in the words
1087 .Bd -unfilled -offset indent
1088 .No # Nm Ic resetconfig
1090 WARNING! This command will completely wipe out your vinum
1091 configuration. All data will be lost. If you really want
1092 to do this, enter the text
1095 .No "Enter text ->" Sy "NO FUTURE"
1096 Vinum configuration obliterated
1099 As the message suggests, this is a last-ditch command. Don't use it unless you
1100 have an existing configuration which you never want to see again.
1105 .Op Ar volume | plex | subdisk
1108 maintains a number of statistical counters for each object. See the header file
1109 .Pa /sys/dev/raid/vinum/vinumvar.h
1110 for more information.
1111 .\" XXX put it in here when it's finalized
1114 command to reset these counters. In conjunction with the
1118 also resets the counters of subordinate objects.
1124 .Ar volume | plex | subdisk
1127 removes an object from the
1129 configuration. Once an object has been removed, there is no way to recover it.
1132 performs a large amount of consistency checking before removing an object. The
1136 to omit this checking and remove the object anyway. Use this option with great
1137 care: it can result in total loss of data on a volume.
1141 refuses to remove a volume or plex if it has subordinate plexes or subdisks
1142 respectively. You can tell
1144 to remove the object anyway by using the
1146 option, or you can cause
1148 to remove the subordinate objects as well by using the
1150 (recursive) option. If you remove a volume with the
1152 option, it will remove both the plexes and the subdisks which belong to the
1156 Save the current configuration to disk. Normally this is not necessary, since
1158 automatically saves any change in configuration. If an error occurs on startup,
1159 updates will be disabled. When you reenable them with the
1163 does not automatically save the configuration to disk. Use this command to save
1170 .\".Ar volume | plex | subdisk | disk
1173 .\"sets the state of the specified object to one of the valid states (see
1174 .\".Sx OBJECT STATES
1177 .\"performs a large amount of consistency checking before making the change. The
1181 .\"to omit this checking and perform the change anyway. Use this option with great
1182 .\"care: it can result in total loss of data on a volume.
1184 .It Ic setdaemon Op Ar value
1186 sets a variable bitmask for the
1188 daemon. This command is temporary and will be replaced. Currently, the bit mask
1189 may contain the bits 1 (log every action to syslog) and 4 (don't update
1190 configuration). Option bit 4 can be useful for error recovery.
1193 .Ic setstate Ar state
1194 .Op Ar volume | plex | subdisk | drive
1197 sets the state of the specified objects to the specified state. This bypasses
1198 the usual consistency mechanism of
1200 and should be used only for recovery purposes. It is possible to crash the
1201 system by incorrect use of this command.
1205 .Op Fl i Ar interval
1208 .Op Ar plex | subdisk
1211 starts (brings into to the
1217 If no object names are specified,
1219 scans the disks known to the system for
1221 drives and then reads in the configuration as described under the
1225 drive contains a header with all information about the data stored on the drive,
1226 including the names of the other drives which are required in order to represent
1231 encounters any errors during this command, it will turn off automatic
1232 configuration update to avoid corrupting the copies on disk. This will also
1233 happen if the configuration on disk indicates a configuration error (for
1234 example, subdisks which do not have a valid space specification). You can turn
1235 the updates on again with the
1239 command. Reset bit 4 of the daemon options mask to re-enable configuration
1242 If object names are specified,
1244 starts them. Normally this operation is only of use with subdisks. The action
1245 depends on the current state of the object:
1248 If the object is already in the
1254 If the object is a subdisk in the
1264 If the object is a subdisk in the
1266 state, the change depends on the subdisk. If it is part of a plex which is part
1267 of a volume which contains other plexes,
1269 places the subdisk in the
1271 state and attempts to copy the data from the volume. When the operation
1272 completes, the subdisk is set into the
1274 state. If it is part of a plex which is part of a volume which contains no
1275 other plexes, or if it is not part of a plex,
1281 If the object is a subdisk in the
1285 continues the revive
1286 operation offline. When the operation completes, the subdisk is set into the
1291 When a subdisk comes into the
1295 automatically checks the state of any plex and volume to which it may belong and
1296 changes their state where appropriate.
1298 If the object is a plex,
1300 checks the state of the subordinate subdisks (and plexes in the case of a
1301 volume) and starts any subdisks which can be started.
1303 To start a plex in a multi-plex volume, the data must be copied from another
1304 plex in the volume. Since this frequently takes a long time, it is normally
1305 done in the background. If you want to wait for this operation to complete (for
1306 example, if you are performing this operation in a script), use the
1310 Copying data doesn't just take a long time, it can also place a significant load
1311 on the system. You can specify the transfer size in bytes or sectors with the
1313 option, and an interval (in milliseconds) to wait between copying each block with
1316 option. Both of these options lessen the load on the system.
1321 .Op Ar volume | plex | subdisk
1323 If no parameters are specified,
1329 This can only be done if no objects are active. In particular, the
1331 option does not override this requirement. Normally, the
1333 command writes the current configuration back to the drives before terminating.
1334 This will not be possible if configuration updates are disabled, so
1336 will not stop if configuration updates are disabled. You can override this by
1343 command can only work if
1345 has been loaded as a KLD, since it is not possible to unload a statically
1350 is statically configured.
1352 If object names are specified,
1354 disables access to the objects. If the objects have subordinate objects, they
1355 subordinate objects must either already be inactive (stopped or in error), or
1360 options must be specified. This command does not remove the objects from the
1361 configuration. They can be accessed again after a
1367 does not stop active objects. For example, you cannot stop a plex which is
1368 attached to an active volume, and you cannot stop a volume which is open. The
1372 to omit this checking and remove the object anyway. Use this option with great
1373 care and understanding: used incorrectly, it can result in serious data
1385 command provides a simplified alternative to the
1387 command for creating volumes with a single striped plex. The size of the
1388 subdisks is the size of the largest contiguous space available on all the
1389 specified drives. The stripe size is fixed at 256 kB.
1393 command creates an arbitrary name for the volume and its components. The name
1394 is composed of the text
1396 and a small integer, for example
1398 You can override this with the
1400 option, which assigns the name specified to the volume. The plexes and subdisks
1401 are named after the volume in the default manner.
1403 There is no choice of name for the drives. If the drives have already been
1406 drives, the name remains. Otherwise the drives are given names starting with
1409 and a small integer, for example
1410 .Dq Li vinumdrive7 .
1415 option can be used to specify that a previous name should be overwritten. The
1417 is used to specify verbose output.
1420 .Sx SIMPLIFIED CONFIGURATION
1421 below for some examples of this
1424 .Sh SIMPLIFIED CONFIGURATION
1425 This section describes a simplified interface to
1427 configuration using the
1432 commands. These commands create convenient configurations for some more normal
1433 situations, but they are not as flexible as the
1437 See above for the description of the commands. Here are some examples, all
1438 performed with the same collection of disks. Note that the first drive,
1440 is smaller than the others. This has an effect on the sizes chosen for each
1443 The following examples all use the
1445 option to show the commands passed to the system, and also to list the structure
1446 of the volume. Without the
1448 option, these commands produce no output.
1449 .Ss Volume with a single concatenated plex
1450 Use a volume with a single concatenated plex for the largest possible storage
1451 without resilience to drive failures:
1453 vinum -> concat -v /dev/da1h /dev/da2h /dev/da3h /dev/da4h
1455 plex name vinum0.p0 org concat
1456 drive vinumdrive0 device /dev/da1h
1457 sd name vinum0.p0.s0 drive vinumdrive0 size 0
1458 drive vinumdrive1 device /dev/da2h
1459 sd name vinum0.p0.s1 drive vinumdrive1 size 0
1460 drive vinumdrive2 device /dev/da3h
1461 sd name vinum0.p0.s2 drive vinumdrive2 size 0
1462 drive vinumdrive3 device /dev/da4h
1463 sd name vinum0.p0.s3 drive vinumdrive3 size 0
1464 V vinum0 State: up Plexes: 1 Size: 2134 MB
1465 P vinum0.p0 C State: up Subdisks: 4 Size: 2134 MB
1466 S vinum0.p0.s0 State: up PO: 0 B Size: 414 MB
1467 S vinum0.p0.s1 State: up PO: 414 MB Size: 573 MB
1468 S vinum0.p0.s2 State: up PO: 988 MB Size: 573 MB
1469 S vinum0.p0.s3 State: up PO: 1561 MB Size: 573 MB
1472 In this case, the complete space on all four disks was used, giving a volume
1474 .Ss Volume with a single striped plex
1475 A volume with a single striped plex may give better performance than a
1476 concatenated plex, but restrictions on striped plexes can mean that the volume
1477 is smaller. It will also not be resilient to a drive failure:
1479 vinum -> stripe -v /dev/da1h /dev/da2h /dev/da3h /dev/da4h
1480 drive vinumdrive0 device /dev/da1h
1481 drive vinumdrive1 device /dev/da2h
1482 drive vinumdrive2 device /dev/da3h
1483 drive vinumdrive3 device /dev/da4h
1485 plex name vinum0.p0 org striped 256k
1486 sd name vinum0.p0.s0 drive vinumdrive0 size 849825b
1487 sd name vinum0.p0.s1 drive vinumdrive1 size 849825b
1488 sd name vinum0.p0.s2 drive vinumdrive2 size 849825b
1489 sd name vinum0.p0.s3 drive vinumdrive3 size 849825b
1490 V vinum0 State: up Plexes: 1 Size: 1659 MB
1491 P vinum0.p0 S State: up Subdisks: 4 Size: 1659 MB
1492 S vinum0.p0.s0 State: up PO: 0 B Size: 414 MB
1493 S vinum0.p0.s1 State: up PO: 256 kB Size: 414 MB
1494 S vinum0.p0.s2 State: up PO: 512 kB Size: 414 MB
1495 S vinum0.p0.s3 State: up PO: 768 kB Size: 414 MB
1498 In this case, the size of the subdisks has been limited to the smallest
1499 available disk, so the resulting volume is only 1659 MB in size.
1500 .Ss Mirrored volume with two concatenated plexes
1501 For more reliability, use a mirrored, concatenated volume:
1503 vinum -> mirror -v -n mirror /dev/da1h /dev/da2h /dev/da3h /dev/da4h
1504 drive vinumdrive0 device /dev/da1h
1505 drive vinumdrive1 device /dev/da2h
1506 drive vinumdrive2 device /dev/da3h
1507 drive vinumdrive3 device /dev/da4h
1508 volume mirror setupstate
1509 plex name mirror.p0 org concat
1510 sd name mirror.p0.s0 drive vinumdrive0 size 0b
1511 sd name mirror.p0.s1 drive vinumdrive2 size 0b
1512 plex name mirror.p1 org concat
1513 sd name mirror.p1.s0 drive vinumdrive1 size 0b
1514 sd name mirror.p1.s1 drive vinumdrive3 size 0b
1515 V mirror State: up Plexes: 2 Size: 1146 MB
1516 P mirror.p0 C State: up Subdisks: 2 Size: 988 MB
1517 P mirror.p1 C State: up Subdisks: 2 Size: 1146 MB
1518 S mirror.p0.s0 State: up PO: 0 B Size: 414 MB
1519 S mirror.p0.s1 State: up PO: 414 MB Size: 573 MB
1520 S mirror.p1.s0 State: up PO: 0 B Size: 573 MB
1521 S mirror.p1.s1 State: up PO: 573 MB Size: 573 MB
1524 This example specifies the name of the volume,
1526 Since one drive is smaller than the others, the two plexes are of different
1527 size, and the last 158 MB of the volume is non-resilient. To ensure complete
1528 reliability in such a situation, use the
1530 command to create a volume with 988 MB.
1531 .Ss Mirrored volume with two striped plexes
1532 Alternatively, use the
1534 option to create a mirrored volume with two striped plexes:
1536 vinum -> mirror -v -n raid10 -s /dev/da1h /dev/da2h /dev/da3h /dev/da4h
1537 drive vinumdrive0 device /dev/da1h
1538 drive vinumdrive1 device /dev/da2h
1539 drive vinumdrive2 device /dev/da3h
1540 drive vinumdrive3 device /dev/da4h
1541 volume raid10 setupstate
1542 plex name raid10.p0 org striped 256k
1543 sd name raid10.p0.s0 drive vinumdrive0 size 849825b
1544 sd name raid10.p0.s1 drive vinumdrive2 size 849825b
1545 plex name raid10.p1 org striped 256k
1546 sd name raid10.p1.s0 drive vinumdrive1 size 1173665b
1547 sd name raid10.p1.s1 drive vinumdrive3 size 1173665b
1548 V raid10 State: up Plexes: 2 Size: 1146 MB
1549 P raid10.p0 S State: up Subdisks: 2 Size: 829 MB
1550 P raid10.p1 S State: up Subdisks: 2 Size: 1146 MB
1551 S raid10.p0.s0 State: up PO: 0 B Size: 414 MB
1552 S raid10.p0.s1 State: up PO: 256 kB Size: 414 MB
1553 S raid10.p1.s0 State: up PO: 0 B Size: 573 MB
1554 S raid10.p1.s1 State: up PO: 256 kB Size: 573 MB
1557 In this case, the usable part of the volume is even smaller, since the first
1558 plex has shrunken to match the smallest drive.
1559 .Sh CONFIGURATION FILE
1561 requires that all parameters to the
1563 commands must be in a configuration file. Entries in the configuration file
1564 define volumes, plexes and subdisks, and may be in free format, except that each
1565 entry must be on a single line.
1567 Some configuration file parameters specify a size (lengths, stripe sizes).
1568 These values can be specified as bytes, or one of the following scale factors
1570 .Bl -tag -width indent
1572 specifies that the value is a number of sectors of 512 bytes.
1574 specifies that the value is a number of kilobytes (1024 bytes).
1576 specifies that the value is a number of megabytes (1048576 bytes).
1578 specifies that the value is a number of gigabytes (1073741824 bytes).
1580 is used for compatibility with
1582 It stands for blocks of 512 bytes.
1583 This abbreviation is confusing, since the word
1585 is used in different
1586 meanings, and its use is deprecated.
1589 For example, the value 16777216 bytes can also be written as
1595 The configuration file can contain the following entries:
1597 .It Ic drive Ar name devicename Op Ar options
1598 Define a drive. The options are:
1600 .It Cm device Ar devicename
1601 Specify the device on which the drive resides.
1603 must be the name of a disk partition, for example
1607 and it must be of type
1611 partition, which is reserved for the complete disk.
1613 Define the drive to be a
1615 drive, which is maintained to automatically replace a failed drive.
1617 does not allow this drive to be used for any other purpose. In particular, it
1618 is not possible to create subdisks on it. This functionality has not been
1619 completely implemented.
1621 .It Ic volume Ar name Op Ar options
1622 Define a volume with name
1626 .It Cm plex Ar plexname
1627 Add the specified plex to the volume. If
1632 will look for the definition of the plex as the next possible entry in the
1633 configuration file after the definition of the volume.
1634 .It Cm readpol Ar policy
1642 .Cm prefer Ar plexname .
1644 satisfies a read request from only one of the plexes. A
1646 read policy specifies that each read should be performed from a different plex
1651 read policy reads from the specified plex every time.
1653 When creating a multi-plex volume, assume that the contents of all the plexes
1654 are consistent. This is normally not the case, so by default
1656 sets all plexes except the first one to the
1660 command to first bring them to a consistent state. In the case of striped and
1661 concatenated plexes, however, it does not normally cause problems to leave them
1662 inconsistent: when using a volume for a file system or a swap partition, the
1663 previous contents of the disks are not of interest, so they may be ignored.
1664 If you want to take this risk, use the
1666 keyword. It will only apply to the plexes defined immediately after the volume
1667 in the configuration file. If you add plexes to a volume at a later time, you
1668 must integrate them manually with the
1676 command with RAID-5 plexes: otherwise extreme data corruption will result if one
1679 .It Ic plex Op Ar options
1680 Define a plex. Unlike a volume, a plex does not need a name. The options may
1683 .It Cm name Ar plexname
1684 Specify the name of the plex. Note that you must use the keyword
1686 when naming a plex or subdisk.
1687 .It Cm org Ar organization Op Ar stripesize
1688 Specify the organization of the plex.
1691 .Cm concat , striped
1698 plexes, the parameter
1700 must be specified, while for
1702 it must be omitted. For type
1704 it specifies the width of each stripe. For type
1706 it specifies the size of a group. A group is a portion of a plex which
1707 stores the parity bits all in the same subdisk. It must be a factor of the plex size (in
1708 other words, the result of dividing the plex size by the stripe size must be an
1709 integer), and it must be a multiple of a disk sector (512 bytes).
1711 For optimum performance, stripes should be at least 128 kB in size: anything
1712 smaller will result in a significant increase in I/O activity due to mapping of
1713 individual requests over multiple disks. The performance improvement due to the
1714 increased number of concurrent transfers caused by this mapping will not make up
1715 for the performance drop due to the increase in latency. A good guideline for
1716 stripe size is between 256 kB and 512 kB. Avoid powers of 2, however: they tend
1717 to cause all superblocks to be placed on the first subdisk.
1719 A striped plex must have at least two subdisks (otherwise it is a concatenated
1720 plex), and each must be the same size. A RAID-5 plex must have at least three
1721 subdisks, and each must be the same size. In practice, a RAID-5 plex should
1722 have at least 5 subdisks.
1723 .It Cm volume Ar volname
1724 Add the plex to the specified volume. If no
1726 keyword is specified, the plex will be added to the last volume mentioned in the
1728 .It Cm sd Ar sdname offset
1729 Add the specified subdisk to the plex at offset
1732 .It Ic subdisk Op Ar options
1733 Define a subdisk. Options may be:
1734 .Bl -hang -width 18n
1736 Specify the name of a subdisk. It is not necessary to specify a name for a
1739 above. Note that you must specify the keyword
1741 if you wish to name a subdisk.
1742 .It Cm plexoffset Ar offset
1743 Specify the starting offset of the subdisk in the plex. If not specified,
1745 allocates the space immediately after the previous subdisk, if any, or otherwise
1746 at the beginning of the plex.
1747 .It Cm driveoffset Ar offset
1748 Specify the starting offset of the subdisk in the drive. If not specified,
1750 allocates the first contiguous
1752 bytes of free space on the drive.
1753 .It Cm length Ar length
1754 Specify the length of the subdisk. This keyword must be specified. There is no
1755 default, but the value 0 may be specified to mean
1756 .Dq "use the largest available contiguous free area on the drive" .
1757 If the drive is empty, this means that the entire drive will be used for the
1763 Specify the plex to which the subdisk belongs. By default, the subdisk belongs
1764 to the last plex specified.
1765 .It Cm drive Ar drive
1766 Specify the drive on which the subdisk resides. By default, the subdisk resides
1767 on the last drive specified.
1770 .Sh EXAMPLE CONFIGURATION FILE
1772 # Sample vinum configuration file
1775 drive drive1 device /dev/da1h
1776 drive drive2 device /dev/da2h
1777 drive drive3 device /dev/da3h
1778 drive drive4 device /dev/da4h
1779 drive drive5 device /dev/da5h
1780 drive drive6 device /dev/da6h
1781 # A volume with one striped plex
1783 plex org striped 512b
1784 sd length 64m drive drive2
1785 sd length 64m drive drive4
1787 plex org striped 512b
1788 sd length 512m drive drive2
1789 sd length 512m drive drive4
1793 sd length 100m drive drive2
1794 sd length 50m drive drive4
1796 sd length 150m drive drive4
1797 # A volume with one striped plex and one concatenated plex
1799 plex org striped 512b
1800 sd length 100m drive drive2
1801 sd length 100m drive drive4
1803 sd length 150m drive drive2
1804 sd length 50m drive drive4
1805 # a volume with a RAID-5 and a striped plex
1806 # note that the RAID-5 volume is longer by
1807 # the length of one subdisk
1809 plex org striped 64k
1810 sd length 1000m drive drive2
1811 sd length 1000m drive drive4
1813 sd length 500m drive drive1
1814 sd length 500m drive drive2
1815 sd length 500m drive drive3
1816 sd length 500m drive drive4
1817 sd length 500m drive drive5
1819 .Sh DRIVE LAYOUT CONSIDERATIONS
1821 drives are currently
1823 disk partitions. They must be of type
1825 in order to avoid overwriting data used for other purposes. Use
1827 to edit a partition type definition. The following display shows a typical
1828 partition layout as shown by
1832 # size offset fstype [fsize bsize bps/cpg]
1833 a: 81920 344064 4.2BSD 0 0 0 # (Cyl. 240*- 297*)
1834 b: 262144 81920 swap # (Cyl. 57*- 240*)
1835 c: 4226725 0 unused 0 0 # (Cyl. 0 - 2955*)
1836 e: 81920 0 4.2BSD 0 0 0 # (Cyl. 0 - 57*)
1837 f: 1900000 425984 4.2BSD 0 0 0 # (Cyl. 297*- 1626*)
1838 g: 1900741 2325984 vinum 0 0 0 # (Cyl. 1626*- 2955*)
1841 In this example, partition
1845 partition. Partitions
1854 partitions. Partition
1856 is a swap partition, and partition
1858 represents the whole disk and should not be used for any other purpose.
1861 uses the first 265 sectors on each partition for configuration information, so
1862 the maximum size of a subdisk is 265 sectors smaller than the drive.
1865 maintains a log file, by default
1866 .Pa /var/tmp/vinum_history ,
1867 in which it keeps track of the commands issued to
1869 You can override the name of this file by setting the environment variable
1871 to the name of the file.
1873 Each message in the log file is preceded by a date. The default format is
1874 .Qq Li %e %b %Y %H:%M:%S .
1877 for further details of the format string. It can be overridden by the
1878 environment variable
1879 .Ev VINUM_DATEFORMAT .
1880 .Sh HOW TO SET UP VINUM
1881 This section gives practical advice about how to implement a
1884 .Ss Where to put the data
1885 The first choice you need to make is where to put the data. You need dedicated
1888 They should be partitions, not devices, and they should not be partition
1890 For example, good names are
1898 both of which represent a device, not a partition, and
1900 which represents a complete disk and should be of type
1902 See the example under
1903 .Sx DRIVE LAYOUT CONSIDERATIONS
1905 .Ss Designing volumes
1908 volumes depends on your intentions. There are a number of possibilities:
1911 You may want to join up a number of small disks to make a reasonable sized file
1912 system. For example, if you had five small drives and wanted to use all the
1913 space for a single volume, you might write a configuration file like:
1914 .Bd -literal -offset indent
1915 drive d1 device /dev/da2e
1916 drive d2 device /dev/da3e
1917 drive d3 device /dev/da4e
1918 drive d4 device /dev/da5e
1919 drive d5 device /dev/da6e
1922 sd length 0 drive d1
1923 sd length 0 drive d2
1924 sd length 0 drive d3
1925 sd length 0 drive d4
1926 sd length 0 drive d5
1929 In this case, you specify the length of the subdisks as 0, which means
1930 .Dq "use the largest area of free space that you can find on the drive" .
1931 If the subdisk is the only subdisk on the drive, it will use all available
1936 to obtain additional resilience against disk failures. You have the choice of
1939 or RAID-5, also called
1942 To set up mirroring, create multiple plexes in a volume. For example, to create
1943 a mirrored volume of 2 GB, you might create the following configuration file:
1944 .Bd -literal -offset indent
1945 drive d1 device /dev/da2e
1946 drive d2 device /dev/da3e
1949 sd length 2g drive d1
1951 sd length 2g drive d2
1954 When creating mirrored drives, it is important to ensure that the data from each
1955 plex is on a different physical disk so that
1957 can access the complete address space of the volume even if a drive fails.
1958 Note that each plex requires as much data as the complete volume: in this
1959 example, the volume has a size of 2 GB, but each plex (and each subdisk)
1960 requires 2 GB, so the total disk storage requirement is 4 GB.
1962 To set up RAID-5, create a single plex of type
1964 For example, to create an equivalent resilient volume of 2 GB, you might use the
1965 following configuration file:
1966 .Bd -literal -offset indent
1967 drive d1 device /dev/da2e
1968 drive d2 device /dev/da3e
1969 drive d3 device /dev/da4e
1970 drive d4 device /dev/da5e
1971 drive d5 device /dev/da6e
1974 sd length 512m drive d1
1975 sd length 512m drive d2
1976 sd length 512m drive d3
1977 sd length 512m drive d4
1978 sd length 512m drive d5
1981 RAID-5 plexes require at least three subdisks, one of which is used for storing
1982 parity information and is lost for data storage. The more disks you use, the
1983 greater the proportion of the disk storage can be used for data storage. In
1984 this example, the total storage usage is 2.5 GB, compared to 4 GB for a mirrored
1985 configuration. If you were to use the minimum of only three disks, you would
1986 require 3 GB to store the information, for example:
1987 .Bd -literal -offset indent
1988 drive d1 device /dev/da2e
1989 drive d2 device /dev/da3e
1990 drive d3 device /dev/da4e
1993 sd length 1g drive d1
1994 sd length 1g drive d2
1995 sd length 1g drive d3
1998 As with creating mirrored drives, it is important to ensure that the data from
1999 each subdisk is on a different physical disk so that
2001 can access the complete address space of the volume even if a drive fails.
2005 to allow more concurrent access to a file system. In many cases, access to a
2006 file system is limited by the speed of the disk. By spreading the volume across
2007 multiple disks, you can increase the throughput in multi-access environments.
2008 This technique shows little or no performance improvement in single-access
2011 uses a technique called
2013 or sometimes RAID-0, to increase this concurrency of access. The name RAID-0 is
2014 misleading: striping does not provide any redundancy or additional reliability.
2015 In fact, it decreases the reliability, since the failure of a single disk will
2016 render the volume useless, and the more disks you have, the more likely it is
2017 that one of them will fail.
2019 To implement striping, use a
2022 .Bd -literal -offset indent
2023 drive d1 device /dev/da2e
2024 drive d2 device /dev/da3e
2025 drive d3 device /dev/da4e
2026 drive d4 device /dev/da5e
2028 plex org striped 512k
2029 sd length 512m drive d1
2030 sd length 512m drive d2
2031 sd length 512m drive d3
2032 sd length 512m drive d4
2035 A striped plex must have at least two subdisks, but the increase in performance
2036 is greater if you have a larger number of disks.
2038 You may want to have the best of both worlds and have both resilience and
2039 performance. This is sometimes called RAID-10 (a combination of RAID-1 and
2040 RAID-0), though again this name is misleading. With
2042 you can do this with the following configuration file:
2043 .Bd -literal -offset indent
2044 drive d1 device /dev/da2e
2045 drive d2 device /dev/da3e
2046 drive d3 device /dev/da4e
2047 drive d4 device /dev/da5e
2048 volume raid setupstate
2049 plex org striped 512k
2050 sd length 512m drive d1
2051 sd length 512m drive d2
2052 sd length 512m drive d3
2053 sd length 512m drive d4
2054 plex org striped 512k
2055 sd length 512m drive d4
2056 sd length 512m drive d3
2057 sd length 512m drive d2
2058 sd length 512m drive d1
2061 Here the plexes are striped, increasing performance, and there are two of them,
2062 increasing reliability. Note that this example shows the subdisks of the second
2063 plex in reverse order from the first plex. This is for performance reasons and
2064 will be discussed below. In addition, the volume specification includes the
2067 which ensures that all plexes are
2071 .Ss Creating the volumes
2072 Once you have created your configuration files, start
2074 and create the volumes. In this example, the configuration is in the file
2076 .Bd -literal -offset 2n
2077 # vinum create -v configfile
2078 1: drive d1 device /dev/da2e
2079 2: drive d2 device /dev/da3e
2082 5: sd length 2g drive d1
2084 7: sd length 2g drive d2
2085 Configuration summary
2087 Drives: 2 (4 configured)
2088 Volumes: 1 (4 configured)
2089 Plexes: 2 (8 configured)
2090 Subdisks: 2 (16 configured)
2092 Drive d1: Device /dev/da2e
2093 Created on vinum.lemis.com at Tue Mar 23 12:30:31 1999
2094 Config last updated Tue Mar 23 14:30:32 1999
2095 Size: 60105216000 bytes (57320 MB)
2096 Used: 2147619328 bytes (2048 MB)
2097 Available: 57957596672 bytes (55272 MB)
2100 Drive d2: Device /dev/da3e
2101 Created on vinum.lemis.com at Tue Mar 23 12:30:32 1999
2102 Config last updated Tue Mar 23 14:30:33 1999
2103 Size: 60105216000 bytes (57320 MB)
2104 Used: 2147619328 bytes (2048 MB)
2105 Available: 57957596672 bytes (55272 MB)
2109 Volume mirror: Size: 2147483648 bytes (2048 MB)
2113 Read policy: round robin
2115 Plex mirror.p0: Size: 2147483648 bytes (2048 MB)
2118 Organization: concat
2119 Part of volume mirror
2120 Plex mirror.p1: Size: 2147483648 bytes (2048 MB)
2123 Organization: concat
2124 Part of volume mirror
2126 Subdisk mirror.p0.s0:
2127 Size: 2147483648 bytes (2048 MB)
2129 Plex mirror.p0 at offset 0
2131 Subdisk mirror.p1.s0:
2132 Size: 2147483648 bytes (2048 MB)
2134 Plex mirror.p1 at offset 0
2141 to list the file as it configures. Subsequently it lists the current
2142 configuration in the same format as the
2145 .Ss Creating more volumes
2146 Once you have created the
2150 keeps track of them in its internal configuration files. You do not need to
2151 create them again. In particular, if you run the
2153 command again, you will create additional objects:
2155 # vinum create sampleconfig
2156 Configuration summary
2158 Drives: 2 (4 configured)
2159 Volumes: 1 (4 configured)
2160 Plexes: 4 (8 configured)
2161 Subdisks: 4 (16 configured)
2163 D d1 State: up Device /dev/da2e Avail: 53224/57320 MB (92%)
2164 D d2 State: up Device /dev/da3e Avail: 53224/57320 MB (92%)
2166 V mirror State: up Plexes: 4 Size: 2048 MB
2168 P mirror.p0 C State: up Subdisks: 1 Size: 2048 MB
2169 P mirror.p1 C State: up Subdisks: 1 Size: 2048 MB
2170 P mirror.p2 C State: up Subdisks: 1 Size: 2048 MB
2171 P mirror.p3 C State: up Subdisks: 1 Size: 2048 MB
2173 S mirror.p0.s0 State: up PO: 0 B Size: 2048 MB
2174 S mirror.p1.s0 State: up PO: 0 B Size: 2048 MB
2175 S mirror.p2.s0 State: up PO: 0 B Size: 2048 MB
2176 S mirror.p3.s0 State: up PO: 0 B Size: 2048 MB
2179 As this example (this time with the
2181 option) shows, re-running the
2183 has created four new plexes, each with a new subdisk. If you want to add other
2184 volumes, create new configuration files for them. They do not need to reference
2187 already knows about. For example, to create a volume
2190 .Pa /dev/da1e , /dev/da2e , /dev/da3e
2193 you only need to mention the other two:
2194 .Bd -literal -offset indent
2195 drive d3 device /dev/da1e
2196 drive d4 device /dev/da4e
2205 With this configuration file, we get:
2207 # vinum create newconfig
2208 Configuration summary
2210 Drives: 4 (4 configured)
2211 Volumes: 2 (4 configured)
2212 Plexes: 5 (8 configured)
2213 Subdisks: 8 (16 configured)
2215 D d1 State: up Device /dev/da2e Avail: 51176/57320 MB (89%)
2216 D d2 State: up Device /dev/da3e Avail: 53220/57320 MB (89%)
2217 D d3 State: up Device /dev/da1e Avail: 53224/57320 MB (92%)
2218 D d4 State: up Device /dev/da4e Avail: 53224/57320 MB (92%)
2220 V mirror State: down Plexes: 4 Size: 2048 MB
2221 V raid State: down Plexes: 1 Size: 6144 MB
2223 P mirror.p0 C State: init Subdisks: 1 Size: 2048 MB
2224 P mirror.p1 C State: init Subdisks: 1 Size: 2048 MB
2225 P mirror.p2 C State: init Subdisks: 1 Size: 2048 MB
2226 P mirror.p3 C State: init Subdisks: 1 Size: 2048 MB
2227 P raid.p0 R5 State: init Subdisks: 4 Size: 6144 MB
2229 S mirror.p0.s0 State: up PO: 0 B Size: 2048 MB
2230 S mirror.p1.s0 State: up PO: 0 B Size: 2048 MB
2231 S mirror.p2.s0 State: up PO: 0 B Size: 2048 MB
2232 S mirror.p3.s0 State: up PO: 0 B Size: 2048 MB
2233 S raid.p0.s0 State: empty PO: 0 B Size: 2048 MB
2234 S raid.p0.s1 State: empty PO: 512 kB Size: 2048 MB
2235 S raid.p0.s2 State: empty PO: 1024 kB Size: 2048 MB
2236 S raid.p0.s3 State: empty PO: 1536 kB Size: 2048 MB
2239 Note the size of the RAID-5 plex: it is only 6 GB, although together its
2240 components use 8 GB of disk space. This is because the equivalent of one
2241 subdisk is used for storing parity data.
2242 .Ss Restarting Vinum
2243 On rebooting the system, start
2251 This will start all the
2253 drives in the system. If for some reason you wish to start only some of them,
2257 .Ss Performance considerations
2258 A number of misconceptions exist about how to set up a RAID array for best
2259 performance. In particular, most systems use far too small a stripe size. The
2260 following discussion applies to all RAID systems, not just to
2265 block I/O system issues requests of between .5kB and 128 kB; a
2266 typical mix is somewhere round 8 kB. You can't stop any striping system from
2267 breaking a request into two physical requests, and if you make the stripe small
2268 enough, it can be broken into several. This will result in a significant drop
2269 in performance: the decrease in transfer time per disk is offset by the order of
2270 magnitude greater increase in latency.
2272 With modern disk sizes and the
2274 I/O system, you can expect to have a
2275 reasonably small number of fragmented requests with a stripe size between 256 kB
2276 and 512 kB; with correct RAID implementations there is no obvious reason not to
2277 increase the size to 2 or 4 MB on a large disk.
2279 When choosing a stripe size, consider that most current UFS file systems have
2280 cylinder groups 32 MB in size. If you have a stripe size and number of disks
2281 both of which are a power of two, it is probable that all superblocks and inodes
2282 will be placed on the same subdisk, which will impact performance significantly.
2283 Choose an odd number instead, for example 479 kB.
2285 The easiest way to consider the impact of any transfer in a multi-access system
2286 is to look at it from the point of view of the potential bottleneck, the disk
2287 subsystem: how much total disk time does the transfer use?
2289 everything is cached, the time relationship between the request and its
2290 completion is not so important: the important parameter is the total time that
2291 the request keeps the disks active, the time when the disks are not available to
2292 perform other transfers. As a result, it doesn't really matter if the transfers
2293 are happening at the same time or different times. In practical terms, the time
2294 we're looking at is the sum of the total latency (positioning time and
2295 rotational latency, or the time it takes for the data to arrive under the disk
2296 heads) and the total transfer time. For a given transfer to disks of the same
2297 speed, the transfer time depends only on the total size of the transfer.
2299 Consider a typical news article or web page of 24 kB, which will probably be
2300 read in a single I/O. Take disks with a transfer rate of 6 MB/s and an average
2301 positioning time of 8 ms, and a file system with 4 kB blocks. Since it's 24 kB,
2302 we don't have to worry about fragments, so the file will start on a 4 kB
2303 boundary. The number of transfers required depends on where the block starts:
2304 it's (S + F - 1) / S, where S is the stripe size in file system blocks, and F is
2305 the file size in file system blocks.
2308 Stripe size of 4 kB. You'll have 6 transfers. Total subsystem load: 48 ms
2309 latency, 2 ms transfer, 50 ms total.
2311 Stripe size of 8 kB. On average, you'll have 3.5 transfers. Total subsystem
2312 load: 28 ms latency, 2 ms transfer, 30 ms total.
2314 Stripe size of 16 kB. On average, you'll have 2.25 transfers. Total subsystem
2315 load: 18 ms latency, 2 ms transfer, 20 ms total.
2317 Stripe size of 256 kB. On average, you'll have 1.08 transfers. Total subsystem
2318 load: 8.6 ms latency, 2 ms transfer, 10.6 ms total.
2320 Stripe size of 4 MB. On average, you'll have 1.0009 transfers. Total subsystem
2321 load: 8.01 ms latency, 2 ms transfer, 10.01 ms total.
2324 It appears that some hardware RAID systems have problems with large stripes:
2325 they appear to always transfer a complete stripe to or from disk, so that a
2326 large stripe size will have an adverse effect on performance.
2328 does not suffer from this problem: it optimizes all disk transfers and does not
2329 transfer unneeded data.
2331 Note that no well-known benchmark program tests true multi-access conditions
2332 (more than 100 concurrent users), so it is difficult to demonstrate the validity
2333 of these statements.
2335 Given these considerations, the following factors affect the performance of a
2340 Striping improves performance for multiple access only, since it increases the
2341 chance of individual requests being on different drives.
2343 Concatenating UFS file systems across multiple drives can also improve
2344 performance for multiple file access, since UFS divides a file system into
2345 cylinder groups and attempts to keep files in a single cylinder group. In
2346 general, it is not as effective as striping.
2348 Mirroring can improve multi-access performance for reads, since by default
2350 issues consecutive reads to consecutive plexes.
2352 Mirroring decreases performance for all writes, whether multi-access or single
2353 access, since the data must be written to both plexes. This explains the
2354 subdisk layout in the example of a mirroring configuration above: if the
2355 corresponding subdisk in each plex is on a different physical disk, the write
2356 commands can be issued in parallel, whereas if they are on the same physical
2357 disk, they will be performed sequentially.
2359 RAID-5 reads have essentially the same considerations as striped reads, unless
2360 the striped plex is part of a mirrored volume, in which case the performance of
2361 the mirrored volume will be better.
2363 RAID-5 writes are approximately 25% of the speed of striped writes: to perform
2366 must first read the data block and the corresponding parity block, perform some
2367 calculations and write back the parity block and the data block, four times as
2368 many transfers as for writing a striped plex. On the other hand, this is offset
2369 by the cost of mirroring, so writes to a volume with a single RAID-5 plex are
2370 approximately half the speed of writes to a correctly configured volume with two
2375 configuration changes (for example, adding or removing objects, or the change of
2376 state of one of the objects),
2378 writes up to 128 kB of updated configuration to each drive. The larger the
2379 number of drives, the longer this takes.
2381 .Ss Creating file systems on Vinum volumes
2382 You do not need to run
2384 before creating a file system on a
2390 option to state that the device is not divided into partitions. For example, to
2391 create a file system on volume
2393 enter the following command:
2395 .Dl "# newfs -v /dev/vinum/mirror"
2397 A number of other considerations apply to
2402 There is no advantage in creating multiple drives on a single disk. Each drive
2403 uses 131.5 kB of data for label and configuration information, and performance
2404 will suffer when the configuration changes. Use appropriately sized subdisks instead.
2406 It is possible to increase the size of a concatenated
2408 plex, but currently the size of striped and RAID-5 plexes cannot be increased.
2409 Currently the size of an existing UFS file system also cannot be increased, but
2410 it is planned to make both plexes and file systems extensible.
2412 .Sh STATE MANAGEMENT
2413 Vinum objects have the concept of
2417 for more details. They are only completely accessible if their state is
2419 To change an object state to
2423 command. To change an object state to
2427 command. Normally other states are created automatically by the relationship
2428 between objects. For example, if you add a plex to a volume, the subdisks of
2429 the plex will be set in the
2431 state, indicating that, though the hardware is accessible, the data on the
2432 subdisk is invalid. As a result of this state, the plex will be set in the
2435 .Ss The `reviving' state
2436 In many cases, when you start a subdisk the system must copy data to the
2437 subdisk. Depending on the size of the subdisk, this can take a long time.
2438 During this time, the subdisk is set in the
2440 state. On successful completion of the copy operation, it is automatically set
2443 state. It is possible for the process performing the revive to be stopped and
2444 restarted. The system keeps track of how far the subdisk has been revived, and
2447 command is reissued, the copying continues from this point.
2449 In order to maintain the consistency of a volume while one or more of its plexes
2452 writes to subdisks which have been revived up to the point of the write. It may
2453 also read from the plex if the area being read has already been revived.
2455 The following points are not bugs, and they have good reasons for existing, but
2456 they have shown to cause confusion. Each is discussed in the appropriate
2463 disk partitions and must have the partition type
2465 This is different from
2467 which expects partitions of type
2471 is an invitation to shoot yourself in the foot: with
2473 you can easily overwrite a file system.
2475 will not permit this.
2477 For similar reasons, the
2479 command will not accept a drive on partition
2483 is used by the system to represent the whole disk, and must be of type
2485 Clearly there is a conflict here, which
2487 resolves by not using the
2491 When you create a volume with multiple plexes,
2493 does not automatically initialize the plexes. This means that the contents are
2494 not known, but they are certainly not consistent. As a result, by default
2496 sets the state of all newly-created plexes except the first to
2498 In order to synchronize them with the first plex, you must
2502 to copy the data from a plex which is in the
2504 state. Depending on the size of the subdisks involved, this can take a long
2507 In practice, people aren't too interested in what was in the plex when it was
2508 created, and other volume managers cheat by setting them
2512 provides two ways to ensure that newly created plexes are
2516 Create the plexes and then synchronize them with
2519 Create the volume (not the plex) with the keyword
2523 to ignore any possible inconsistency and set the plexes to be
2527 Some of the commands currently supported by
2529 are not really needed. For reasons which I don't understand, however, I find
2530 that users frequently try the
2534 commands, though especially
2536 outputs all sort of dire warnings. Don't use these commands unless you have a
2537 good reason to do so.
2539 Some state transitions are not very intuitive. In fact, it's not clear whether
2540 this is a bug or a feature. If you find that you can't start an object in some
2541 strange state, such as a
2543 subdisk, try first to get it into
2549 commands. If that works, you should then be able to start it. If you find
2550 that this is the only way to get out of a position where easier methods fail,
2551 please report the situation.
2553 If you build the kernel module with the
2554 .Fl D Ns Dv VINUMDEBUG
2555 option, you must also build
2558 .Fl D Ns Dv VINUMDEBUG
2559 option, since the size of some data objects used by both components depends on
2560 this option. If you don't do so, commands will fail with the message
2561 .Sy Invalid argument ,
2562 and a console message will be logged such as
2564 .It "vinumioctl: invalid ioctl from process 247 (vinum): c0e44642"
2567 This error may also occur if you use old versions of KLD or userland program.
2571 command has a particularly emetic syntax. Once it was the only way to start
2573 but now the preferred method is with
2576 should be used for maintenance purposes only. Note that its syntax has changed,
2577 and the arguments must be disk slices, such as
2579 not partitions such as
2583 .Bl -tag -width VINUM_DATEFORMAT
2584 .It Ev VINUM_HISTORY
2585 The name of the log file, by default
2586 .Pa /var/log/vinum_history .
2587 .It Ev VINUM_DATEFORMAT
2588 The format of dates in the log file, by default
2589 .Qq Li %e %b %Y %H:%M:%S .
2591 The name of the editor to use for editing configuration files, by default
2595 .Bl -tag -width /dev/vinum/control -compact
2597 directory with device nodes for
2600 .It Pa /dev/vinum/control
2603 .It Pa /dev/vinum/plex
2604 directory containing device nodes for
2607 .It Pa /dev/vinum/sd
2608 directory containing device nodes for
2618 .Pa http://www.vinumvm.org/vinum/ ,
2619 .Pa http://www.vinumvm.org/vinum/how-to-debug.html .
2623 command first appeared in
2625 The RAID-5 component of
2627 was developed for Cybernet Inc.\&
2628 .Pq Pa www.cybernet.com
2629 for its NetMAX product.
2631 .An Greg Lehey Aq grog@lemis.com