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.15 2001/05/14 01:10:37 grog Exp grog $
45 .Nd Logical Volume Manager control program
51 .Bl -tag -width indent
52 .It Ic attach Ar plex volume Op Cm rename
54 .Ic attach Ar subdisk plex
58 Attach a plex to a volume, or a subdisk to a plex.
60 .Ic checkparity Ar plex
64 Check the parity blocks of a RAID-4 or RAID-5 plex.
72 Create a concatenated volume from the specified drives.
78 Create a volume as described in
79 .Ar description-file .
81 Cause the volume manager to enter the kernel debugger.
89 Detach a plex or subdisk from the volume or plex to which it is attached.
90 .It Ic dumpconfig Op Ar drive ...
91 List the configuration information stored on the specified drives, or all drives
92 in the system if no drive names are specified.
98 List information about volume manager state.
106 Initialize the contents of a subdisk or all the subdisks of a plex to all zeros.
107 .It Ic label Ar volume
108 Create a volume label.
115 .Op Ar volume | plex | subdisk
117 List information about specified objects.
126 List information about drives.
135 List information about subdisks.
144 List information about plexes.
153 List information about volumes.
155 Remake the device nodes in
165 Create a mirrored volume from the specified drives.
171 Move the object(s) to the specified drive.
172 .It Ic printconfig Op Ar file
173 Write a copy of the current configuration to
178 program when running in interactive mode. Normally this would be done by
182 .It Ic read Ar disk ...
185 configuration from the specified disks.
188 .Op Ar drive | subdisk | plex | volume
191 Change the name of the specified object.
193 .\".It Ic replace Ar drive newdrive
194 .\"Move all the subdisks from the specified drive onto the new drive.
196 .Ic rebuildparity Ar plex Op Fl f
200 Rebuild the parity blocks of a RAID-4 or RAID-5 plex.
208 .Op Ar volume | plex | subdisk
210 Reset statistisc counters for the specified objects, or for all objects if none
216 .Ar volume | plex | subdisk
222 configuration to disk after configuration failures.
228 .\".Ar volume | plex | subdisk | disk
230 .\"Set the state of the object to
232 .It Ic setdaemon Op Ar value
233 Set daemon configuration.
237 .Op Ar volume | plex | subdisk | drive
239 Set state without influencing other objects, for diagnostic purposes only.
241 Read configuration from all vinum drives.
247 .Ar volume | plex | subdisk
249 Allow the system to access the objects.
253 .Op Ar volume | plex | subdisk
255 Terminate access to the objects, or stop
257 if no parameters are specified.
265 Create a striped volume from the specified drives.
269 is a utility program to communicate with the kernel component of the Vinum
270 logical volume manager.
272 is designed either for interactive use, when started without command line
273 arguments, or to execute a single command if the command is supplied on the
274 command line. In interactive mode,
276 maintains a command line history.
279 commands may optionally be followed by an option. Any of the following options
280 may be specified with any command, but in some cases the options are ignored.
288 .Bl -tag -width indent
293 option overrides safety checks. Use with extreme care. This option is for
294 emergency use only. For example, the command
300 even if it is open. Any subsequent access to the volume will almost certainly
302 .It Fl i Ar millisecs
309 milliseconds between copying each block. This lowers the load on the system.
313 option to specify a volume name to the simplified configuration commands
321 option is used by the list commands to display information not
322 only about the specified objects, but also about subordinate objects. For
323 example, in conjunction with the
327 option will also show information about the plexes and subdisks belonging to the
333 option is used by the list commands to display statistical information. The
335 command also uses this option to specify that it should create striped plexes.
339 option specifies the transfer size for the
348 option can be used to request more detailed information.
353 option can be used to request more detailed information than the
362 to wait for completion of commands which normally run in the background, such as
365 .Sh COMMANDS IN DETAIL
367 commands perform the following functions:
369 .Bl -tag -width indent -compact
370 .It Ic attach Ar plex volume Op Cm rename
372 .Ic attach Ar subdisk plex
377 inserts the specified plex or subdisk in a volume or plex. In the case of a
378 subdisk, an offset in the plex may be specified. If it is not, the subdisk will
379 be attached at the first possible location. After attaching a plex to a
382 reintegrates the plex.
388 renames the object (and in the case of a plex, any subordinate subdisks) to fit
391 naming convention. To rename the object to any other name, use the
395 A number of considerations apply to attaching subdisks:
398 Subdisks can normally only be attached to concatenated plexes.
400 If a striped or RAID-5 plex is missing a subdisk (for example after drive
401 failure), it should be replaced by a subdisk of the same size only.
403 In order to add further subdisks to a striped or RAID-5 plex, use the
405 (force) option. This will corrupt the data in the plex.
406 .\"No other attachment of
407 .\"subdisks is currently allowed for striped and RAID-5 plexes.
409 For concatenated plexes, the
411 parameter specifies the offset in blocks from the beginning of the plex. For
412 striped and RAID-5 plexes, it specifies the offset of the first block of the
413 subdisk: in other words, the offset is the numerical position of the subdisk
414 multiplied by the stripe size. For example, in a plex with stripe size 271k,
415 the first subdisk will have offset 0, the second offset 271k, the third 542k,
416 etc. This calculation ignores parity blocks in RAID-5 plexes.
425 Check the parity blocks on the specified RAID-4 or RAID-5 plex. This operation
426 maintains a pointer in the plex, so it can be stopped and later restarted from
427 the same position if desired. In addition, this pointer is used by the
429 command, so rebuilding the parity blocks need only start at the location where
430 the first parity problem has been detected.
436 starts checking at the beginning of the plex. If the
440 prints a running progress report.
451 command provides a simplified alternative to the
453 command for creating volumes with a single concatenated plex. The largest
454 contiguous space available on each drive is used to create the subdisks for the
459 command creates an arbitrary name for the volume and its components. The name
460 is composed of the text
462 and a small integer, for example
464 You can override this with the
466 option, which assigns the name specified to the volume. The plexes and subdisks
467 are named after the volume in the default manner.
469 There is no choice of name for the drives. If the drives have already been
472 drives, the name remains. Otherwise the drives are given names starting with
475 and a small integer, for example
481 option can be used to specify that a previous name should be overwritten. The
483 is used to specify verbose output.
486 .Sx SIMPLIFIED CONFIGURATION
487 below for some examples of this
496 is used to create any object. In view of the relatively complicated
497 relationship and the potential dangers involved in creating a
499 object, there is no interactive interface to this function. If you do not
502 starts an editor on a temporary file. If the environment variable
506 starts this editor. If not, it defaults to
509 .Sx CONFIGURATION FILE
510 below for more information on the format of
515 function is additive: if you run it multiple times, you will create multiple
516 copies of all unnamed objects.
520 command will not change the names of existing
522 drives, in order to avoid accidentally erasing them. The correct way to dispose
525 drives is to reset the configuration with the
527 command. In some cases, however, it may be necessary to create new data on
529 drives which can no longer be started. In this case, use the
535 without any arguments, is used to enter the remote kernel debugger. It is only
540 option. This option will stop the execution of the operating system until the
541 kernel debugger is exited. If remote debugging is set and there is no remote
542 connection for a kernel debugger, it will be necessary to reset the system and
543 reboot in order to leave the debugger.
545 .It Ic debug Ar flags
546 Set a bit mask of internal debugging flags. These will change without warning
547 as the product matures; to be certain, read the header file
548 .Aq Pa sys/dev/vinumvar.h .
549 The bit mask is composed of the following values:
550 .Bl -tag -width indent
551 .It Dv DEBUG_ADDRESSES Pq No 1
552 Show buffer information during requests
553 .\".It Dv DEBUG_NUMOUTPUT Pq No 2
555 .\".Va vp->v_numoutput .
556 .It Dv DEBUG_RESID Pq No 4
559 .It Dv DEBUG_LASTREQS Pq No 8
560 Keep a circular buffer of last requests.
561 .It Dv DEBUG_REVIVECONFLICT Pq No 16
562 Print info about revive conflicts.
563 .It Dv DEBUG_EOFINFO Pq No 32
564 Print information about internal state when returning an
567 .It Dv DEBUG_MEMFREE Pq No 64
568 Maintain a circular list of the last memory areas freed by the memory allocator.
569 .It Dv DEBUG_REMOTEGDB Pq No 256
575 .It Dv DEBUG_WARNINGS Pq No 512
576 Print some warnings about minor problems in the implementation.
579 .It Ic detach Oo Fl f Oc Ar plex
580 .It Ic detach Oo Fl f Oc Ar subdisk
582 removes the specified plex or subdisk from the volume or plex to which it is
583 attached. If removing the object would impair the data integrity of the volume,
584 the operation will fail unless the
586 option is specified. If the object is named after the object above it (for
591 the name will be changed
592 by prepending the text
595 .Li ex-vol1.p7.s0 ) .
596 If necessary, the name will be truncated in the
600 does not reduce the number of subdisks in a striped or RAID-5 plex. Instead,
601 the subdisk is marked absent, and can later be replaced with the
605 .It Ic dumpconfig Op Ar drive ...
608 shows the configuration information stored on the specified drives. If no drive
611 searches all drives on the system for Vinum partitions and dumps the
612 information. If configuration updates are disabled, it is possible that this
613 information is not the same as the information returned by the
615 command. This command is used primarily for maintenance and debugging.
619 displays information about
621 memory usage. This is intended primarily for debugging. With the
623 option, it will give detailed information about the memory areas in use.
629 displays information about the last up to 64 I/O requests handled by the
631 driver. This information is only collected if debug flag 8 is set. The format
636 Total of 38 blocks malloced, total memory: 16460
637 Maximum allocs: 56, malloc table at 0xf0f72dbc
639 Time Event Buf Dev Offset Bytes SD SDoff Doffset Goffset
641 14:40:00.637758 1VS Write 0xf2361f40 91.3 0x10 16384
642 14:40:00.639280 2LR Write 0xf2361f40 91.3 0x10 16384
643 14:40:00.639294 3RQ Read 0xf2361f40 4.39 0x104109 8192 19 0 0 0
644 14:40:00.639455 3RQ Read 0xf2361f40 4.23 0xd2109 8192 17 0 0 0
645 14:40:00.639529 3RQ Read 0xf2361f40 4.15 0x6e109 8192 16 0 0 0
646 14:40:00.652978 4DN Read 0xf2361f40 4.39 0x104109 8192 19 0 0 0
647 14:40:00.667040 4DN Read 0xf2361f40 4.15 0x6e109 8192 16 0 0 0
648 14:40:00.668556 4DN Read 0xf2361f40 4.23 0xd2109 8192 17 0 0 0
649 14:40:00.669777 6RP Write 0xf2361f40 4.39 0x104109 8192 19 0 0 0
650 14:40:00.685547 4DN Write 0xf2361f40 4.39 0x104109 8192 19 0 0 0
651 11:11:14.975184 Lock 0xc2374210 2 0x1f8001
652 11:11:15.018400 7VS Write 0xc2374210 0x7c0 32768 10
653 11:11:15.018456 8LR Write 0xc2374210 13.39 0xcc0c9 32768
654 11:11:15.046229 Unlock 0xc2374210 2 0x1f8001
659 field always contains the address of the user buffer header. This can be used
660 to identify the requests associated with a user request, though this is not 100%
661 reliable: theoretically two requests in sequence could use the same buffer
662 header, though this is not common. The beginning of a request can be identified
667 The first example above shows the requests involved in a user request. The
668 second is a subdisk I/O request with locking.
672 field contains information related to the sequence of events in the request
677 indicates the approximate sequence of events, and the two-letter abbreviation is
678 a mnemonic for the location:
679 .Bl -tag -width Lockwait
681 (vinumstrategy) shows information about the user request on entry to
683 The device number is the
685 device, and offset and length are the user parameters. This is always the
686 beginning of a request sequence.
688 (launch_requests) shows the user request just prior to launching the low-level
690 requests in the function
691 .Fn launch_requests .
692 The parameters should be the same as in the
697 In the following requests,
699 is the device number of the associated disk partition,
701 is the offset from the beginning of the partition,
703 is the subdisk index in
706 is the offset from the beginning of the subdisk,
708 is the offset of the associated data request, and
710 is the offset of the associated group request, where applicable.
711 .Bl -tag -width Lockwait
713 (request) shows one of possibly several low-level
715 requests which are launched to satisfy the high-level request. This information
717 .Fn launch_requests .
719 (done) is called from
721 showing the completion of a request. This completion should match a request
722 launched either at stage
725 .Fn launch_requests ,
727 .Fn complete_raid5_write
733 (RAID-5 data) is called from
734 .Fn complete_raid5_write
735 and represents the data written to a RAID-5 data stripe after calculating
738 (RAID-5 parity) is called from
739 .Fn complete_raid5_write
740 and represents the data written to a RAID-5 parity stripe after calculating
743 shows a subdisk I/O request. These requests are usually internal to
745 for operations like initialization or rebuilding plexes.
747 shows the low-level operation generated for a subdisk I/O request.
749 specifies that the process is waiting for a range lock. The parameters are the
750 buffer header associated with the request, the plex number and the block number.
751 For internal reasons the block number is one higher than the address of the
752 beginning of the stripe.
754 specifies that a range lock has been obtained. The parameters are the same as
757 specifies that a range lock has been released. The parameters are the same as
769 initializes a subdisk by writing zeroes to it. You can initialize all subdisks
770 in a plex by specifying the plex name. This is the only way to ensure
771 consistent data in a plex. You must perform this initialization before using a
772 RAID-5 plex. It is also recommended for other new plexes.
774 initializes all subdisks of a plex in parallel. Since this operation can take a
775 long time, it is normally performed in the background. If you want to wait for
776 completion of the command, use the
782 option if you want to write blocks of a different size from the default value of
785 prints a console message when the initialization is complete.
787 .It Ic label Ar volume
792 style volume label on a volume. It is a simple alternative to an appropriate
795 This is needed because some
797 commands still read the disk to find the label instead of using the correct
801 maintains a volume label separately from the volume data, so this command is not
804 This command is deprecated.
810 .Op Ar volume | plex | subdisk
816 .Op Ar volume | plex | subdisk
851 is used to show information about the specified object. If the argument is
852 omitted, information is shown about all objects known to
856 command is a synonym for
861 option relates to volumes and plexes: if specified, it recursively lists
862 information for the subdisks and (for a volume) plexes subordinate to the
863 objects. The commands
867 list only volumes, plexes, subdisks and drives respectively. This is
868 particularly useful when used without parameters.
874 to output device statistics, the
876 (verbose) option causes some additional information to be output, and the
878 causes considerable additional information to be output.
883 command removes the directory
885 and recreates it with device nodes
886 which reflect the current configuration. This command is not intended for
887 general use, and is provided for emergency use only.
899 command provides a simplified alternative to the
901 command for creating mirrored volumes. Without any options, it creates a RAID-1
902 (mirrored) volume with two concatenated plexes. The largest contiguous space
903 available on each drive is used to create the subdisks for the plexes. The
904 first plex is built from the odd-numbered drives in the list, and the second
905 plex is built from the even-numbered drives. If the drives are of different
906 sizes, the plexes will be of different sizes.
912 builds striped plexes with a stripe size of 279 kB. The size of the subdisks in
913 each plex is the size of the smallest contiguous storage available on any of the
914 drives which form the plex. Again, the plexes may differ in size.
918 command creates an arbitrary name for the volume and its components. The name
919 is composed of the text
921 and a small integer, for example
923 You can override this with the
925 option, which assigns the name specified to the volume. The plexes and subdisks
926 are named after the volume in the default manner.
928 There is no choice of name for the drives. If the drives have already been
931 drives, the name remains. Otherwise the drives are given names starting with
934 and a small integer, for example
940 option can be used to specify that a previous name should be overwritten. The
942 is used to specify verbose output.
945 .Sx SIMPLIFIED CONFIGURATION
946 below for some examples of this
949 .It Ic mv Fl f Ar drive object ...
950 .It Ic move Fl f Ar drive object ...
951 Move all the subdisks from the specified objects onto the new drive. The
952 objects may be subdisks, drives or plexes. When drives or plexes are specified,
953 all subdisks associated with the object are moved.
957 option is required for this function, since it currently does not preserve the
958 data in the subdisk. This functionality will be added at a later date. In this
959 form, however, it is suited to recovering a failed disk drive.
961 .It Ic printconfig Op Ar file
962 Write a copy of the current configuration to
964 in a format that can be used to recreate the
966 configuration. Unlike the configuration saved on disk, it includes definitions
967 of the drives. If you omit
976 program when running in interactive mode. Normally this would be done by
981 .It Ic read Ar disk ...
984 command scans the specified disks for
986 partitions containing previously created configuration information. It reads
987 the configuration in order from the most recently updated to least recently
988 updated configuration.
990 maintains an up-to-date copy of all configuration information on each disk
991 partition. You must specify all of the slices in a configuration as the
992 parameter to this command.
996 command is intended to selectively load a
998 configuration on a system which has other
1000 partitions. If you want to start all partitions on the system, it is easier to
1007 encounters any errors during this command, it will turn off automatic
1008 configuration update to avoid corrupting the copies on disk. This will also
1009 happen if the configuration on disk indicates a configuration error (for
1010 example, subdisks which do not have a valid space specification). You can turn
1011 the updates on again with the
1015 commands. Reset bit 2 (numerical value 4) of the daemon options mask to
1016 re-enable configuration saves.
1025 Rebuild the parity blocks on the specified RAID-4 or RAID-5 plex. This
1026 operation maintains a pointer in the plex, so it can be stopped and later
1027 restarted from the same position if desired. In addition, this pointer is used
1030 command, so rebuilding the parity blocks need only start at the location where
1031 the first parity problem has been detected.
1037 starts rebuilding at the beginning of the plex. If the
1041 first checks the existing parity blocks prints information about those found to
1042 be incorrect before rebuilding. If the
1046 prints a running progress report.
1051 .Op Ar drive | subdisk | plex | volume
1054 Change the name of the specified object. If the
1056 option is specified, subordinate objects will be named by the default rules:
1057 plex names will be formed by appending
1059 to the volume name, and
1060 subdisk names will be formed by appending
1066 .\".Ar drive newdrive
1067 .\"Move all the subdisks from the specified drive onto the new drive. This will
1068 .\"attempt to recover those subdisks that can be recovered, and create the others
1069 .\"from scratch. If the new drive lacks the space for this operation, as many
1070 .\"subdisks as possible will be fitted onto the drive, and the rest will be left on
1071 .\"the original drive.
1076 command completely obliterates the
1078 configuration on a system. Use this command only when you want to completely
1079 delete the configuration.
1081 will ask for confirmation; you must type in the words
1084 .Bd -unfilled -offset indent
1085 .No # Nm Ic resetconfig
1087 WARNING! This command will completely wipe out your vinum
1088 configuration. All data will be lost. If you really want
1089 to do this, enter the text
1092 .No "Enter text ->" Sy "NO FUTURE"
1093 Vinum configuration obliterated
1096 As the message suggests, this is a last-ditch command. Don't use it unless you
1097 have an existing configuration which you never want to see again.
1102 .Op Ar volume | plex | subdisk
1105 maintains a number of statistical counters for each object. See the header file
1106 .Aq Pa sys/dev/vinumvar.h
1107 for more information.
1108 .\" XXX put it in here when it's finalized
1111 command to reset these counters. In conjunction with the
1115 also resets the counters of subordinate objects.
1121 .Ar volume | plex | subdisk
1124 removes an object from the
1126 configuration. Once an object has been removed, there is no way to recover it.
1129 performs a large amount of consistency checking before removing an object. The
1133 to omit this checking and remove the object anyway. Use this option with great
1134 care: it can result in total loss of data on a volume.
1138 refuses to remove a volume or plex if it has subordinate plexes or subdisks
1139 respectively. You can tell
1141 to remove the object anyway by using the
1143 option, or you can cause
1145 to remove the subordinate objects as well by using the
1147 (recursive) option. If you remove a volume with the
1149 option, it will remove both the plexes and the subdisks which belong to the
1153 Save the current configuration to disk. Normally this is not necessary, since
1155 automatically saves any change in configuration. If an error occurs on startup,
1156 updates will be disabled. When you reenable them with the
1160 does not automatically save the configuration to disk. Use this command to save
1167 .\".Ar volume | plex | subdisk | disk
1170 .\"sets the state of the specified object to one of the valid states (see
1171 .\".Sx OBJECT STATES
1174 .\"performs a large amount of consistency checking before making the change. The
1178 .\"to omit this checking and perform the change anyway. Use this option with great
1179 .\"care: it can result in total loss of data on a volume.
1181 .It Ic setdaemon Op Ar value
1183 sets a variable bitmask for the
1185 daemon. This command is temporary and will be replaced. Currently, the bit mask
1186 may contain the bits 1 (log every action to syslog) and 4 (don't update
1187 configuration). Option bit 4 can be useful for error recovery.
1190 .Ic setstate Ar state
1191 .Op Ar volume | plex | subdisk | drive
1194 sets the state of the specified objects to the specified state. This bypasses
1195 the usual consistency mechanism of
1197 and should be used only for recovery purposes. It is possible to crash the
1198 system by incorrect use of this command.
1202 .Op Fl i Ar interval
1205 .Op Ar plex | subdisk
1208 starts (brings into to the
1214 If no object names are specified,
1216 scans the disks known to the system for
1218 drives and then reads in the configuration as described under the
1222 drive contains a header with all information about the data stored on the drive,
1223 including the names of the other drives which are required in order to represent
1228 encounters any errors during this command, it will turn off automatic
1229 configuration update to avoid corrupting the copies on disk. This will also
1230 happen if the configuration on disk indicates a configuration error (for
1231 example, subdisks which do not have a valid space specification). You can turn
1232 the updates on again with the
1236 command. Reset bit 4 of the daemon options mask to re-enable configuration
1239 If object names are specified,
1241 starts them. Normally this operation is only of use with subdisks. The action
1242 depends on the current state of the object:
1245 If the object is already in the
1251 If the object is a subdisk in the
1261 If the object is a subdisk in the
1263 state, the change depends on the subdisk. If it is part of a plex which is part
1264 of a volume which contains other plexes,
1266 places the subdisk in the
1268 state and attempts to copy the data from the volume. When the operation
1269 completes, the subdisk is set into the
1271 state. If it is part of a plex which is part of a volume which contains no
1272 other plexes, or if it is not part of a plex,
1278 If the object is a subdisk in the
1282 continues the revive
1283 operation offline. When the operation completes, the subdisk is set into the
1288 When a subdisk comes into the
1292 automatically checks the state of any plex and volume to which it may belong and
1293 changes their state where appropriate.
1295 If the object is a plex,
1297 checks the state of the subordinate subdisks (and plexes in the case of a
1298 volume) and starts any subdisks which can be started.
1300 To start a plex in a multi-plex volume, the data must be copied from another
1301 plex in the volume. Since this frequently takes a long time, it is normally
1302 done in the background. If you want to wait for this operation to complete (for
1303 example, if you are performing this operation in a script), use the
1307 Copying data doesn't just take a long time, it can also place a significant load
1308 on the system. You can specify the transfer size in bytes or sectors with the
1310 option, and an interval (in milliseconds) to wait between copying each block with
1313 option. Both of these options lessen the load on the system.
1318 .Op Ar volume | plex | subdisk
1320 If no parameters are specified,
1326 This can only be done if no objects are active. In particular, the
1328 option does not override this requirement. Normally, the
1330 command writes the current configuration back to the drives before terminating.
1331 This will not be possible if configuration updates are disabled, so
1333 will not stop if configuration updates are disabled. You can override this by
1340 command can only work if
1342 has been loaded as a kld, since it is not possible to unload a statically
1347 is statically configured.
1349 If object names are specified,
1351 disables access to the objects. If the objects have subordinate objects, the
1352 subordinate objects must either already be inactive (stopped or in error), or
1357 options must be specified. This command does not remove the objects from the
1358 configuration. They can be accessed again after a
1364 does not stop active objects. For example, you cannot stop a plex which is
1365 attached to an active volume, and you cannot stop a volume which is open. The
1369 to omit this checking and remove the object anyway. Use this option with great
1370 care and understanding: used incorrectly, it can result in serious data
1382 command provides a simplified alternative to the
1384 command for creating volumes with a single striped plex. The size of the
1385 subdisks is the size of the largest contiguous space available on all the
1386 specified drives. The stripe size is fixed at 279 kB.
1390 command creates an arbitrary name for the volume and its components. The name
1391 is composed of the text
1393 and a small integer, for example
1395 You can override this with the
1397 option, which assigns the name specified to the volume. The plexes and subdisks
1398 are named after the volume in the default manner.
1400 There is no choice of name for the drives. If the drives have already been
1403 drives, the name remains. Otherwise the drives are given names starting with
1406 and a small integer, for example
1407 .Dq Li vinumdrive7 .
1412 option can be used to specify that a previous name should be overwritten. The
1414 is used to specify verbose output.
1417 .Sx SIMPLIFIED CONFIGURATION
1418 below for some examples of this
1421 .Sh SIMPLIFIED CONFIGURATION
1422 This section describes a simplified interface to
1424 configuration using the
1429 commands. These commands create convenient configurations for some more normal
1430 situations, but they are not as flexible as the
1434 See above for the description of the commands. Here are some examples, all
1435 performed with the same collection of disks. Note that the first drive,
1437 is smaller than the others. This has an effect on the sizes chosen for each
1440 The following examples all use the
1442 option to show the commands passed to the system, and also to list the structure
1443 of the volume. Without the
1445 option, these commands produce no output.
1446 .Ss Volume with a single concatenated plex
1447 Use a volume with a single concatenated plex for the largest possible storage
1448 without resilience to drive failures:
1450 vinum -> concat -v /dev/da1h /dev/da2h /dev/da3h /dev/da4h
1452 plex name vinum0.p0 org concat
1453 drive vinumdrive0 device /dev/da1h
1454 sd name vinum0.p0.s0 drive vinumdrive0 size 0
1455 drive vinumdrive1 device /dev/da2h
1456 sd name vinum0.p0.s1 drive vinumdrive1 size 0
1457 drive vinumdrive2 device /dev/da3h
1458 sd name vinum0.p0.s2 drive vinumdrive2 size 0
1459 drive vinumdrive3 device /dev/da4h
1460 sd name vinum0.p0.s3 drive vinumdrive3 size 0
1461 V vinum0 State: up Plexes: 1 Size: 2134 MB
1462 P vinum0.p0 C State: up Subdisks: 4 Size: 2134 MB
1463 S vinum0.p0.s0 State: up D: vinumdrive0 Size: 414 MB
1464 S vinum0.p0.s1 State: up D: vinumdrive1 Size: 573 MB
1465 S vinum0.p0.s2 State: up D: vinumdrive2 Size: 573 MB
1466 S vinum0.p0.s3 State: up D: vinumdrive3 Size: 573 MB
1469 In this case, the complete space on all four disks was used, giving a volume
1471 .Ss Volume with a single striped plex
1472 A volume with a single striped plex may give better performance than a
1473 concatenated plex, but restrictions on striped plexes can mean that the volume
1474 is smaller. It will also not be resilient to a drive failure:
1476 vinum -> stripe -v /dev/da1h /dev/da2h /dev/da3h /dev/da4h
1477 drive vinumdrive0 device /dev/da1h
1478 drive vinumdrive1 device /dev/da2h
1479 drive vinumdrive2 device /dev/da3h
1480 drive vinumdrive3 device /dev/da4h
1482 plex name vinum0.p0 org striped 279k
1483 sd name vinum0.p0.s0 drive vinumdrive0 size 849825b
1484 sd name vinum0.p0.s1 drive vinumdrive1 size 849825b
1485 sd name vinum0.p0.s2 drive vinumdrive2 size 849825b
1486 sd name vinum0.p0.s3 drive vinumdrive3 size 849825b
1487 V vinum0 State: up Plexes: 1 Size: 1659 MB
1488 P vinum0.p0 S State: up Subdisks: 4 Size: 1659 MB
1489 S vinum0.p0.s0 State: up D: vinumdrive0 Size: 414 MB
1490 S vinum0.p0.s1 State: up D: vinumdrive1 Size: 414 MB
1491 S vinum0.p0.s2 State: up D: vinumdrive2 Size: 414 MB
1492 S vinum0.p0.s3 State: up D: vinumdrive3 Size: 414 MB
1495 In this case, the size of the subdisks has been limited to the smallest
1496 available disk, so the resulting volume is only 1659 MB in size.
1497 .Ss Mirrored volume with two concatenated plexes
1498 For more reliability, use a mirrored, concatenated volume:
1500 vinum -> mirror -v -n mirror /dev/da1h /dev/da2h /dev/da3h /dev/da4h
1501 drive vinumdrive0 device /dev/da1h
1502 drive vinumdrive1 device /dev/da2h
1503 drive vinumdrive2 device /dev/da3h
1504 drive vinumdrive3 device /dev/da4h
1505 volume mirror setupstate
1506 plex name mirror.p0 org concat
1507 sd name mirror.p0.s0 drive vinumdrive0 size 0b
1508 sd name mirror.p0.s1 drive vinumdrive2 size 0b
1509 plex name mirror.p1 org concat
1510 sd name mirror.p1.s0 drive vinumdrive1 size 0b
1511 sd name mirror.p1.s1 drive vinumdrive3 size 0b
1512 V mirror State: up Plexes: 2 Size: 1146 MB
1513 P mirror.p0 C State: up Subdisks: 2 Size: 988 MB
1514 P mirror.p1 C State: up Subdisks: 2 Size: 1146 MB
1515 S vinum0.p0.s0 State: up D: vinumdrive0 Size: 414 MB
1516 S vinum0.p0.s2 State: up D: vinumdrive2 Size: 414 MB
1517 S vinum0.p0.s1 State: up D: vinumdrive1 Size: 414 MB
1518 S vinum0.p0.s3 State: up D: vinumdrive3 Size: 414 MB
1521 This example specifies the name of the volume,
1523 Since one drive is smaller than the others, the two plexes are of different
1524 size, and the last 158 MB of the volume is non-resilient. To ensure complete
1525 reliability in such a situation, use the
1527 command to create a volume with 988 MB.
1528 .Ss Mirrored volume with two striped plexes
1529 Alternatively, use the
1531 option to create a mirrored volume with two striped plexes:
1533 vinum -> mirror -v -n raid10 -s /dev/da1h /dev/da2h /dev/da3h /dev/da4h
1534 drive vinumdrive0 device /dev/da1h
1535 drive vinumdrive1 device /dev/da2h
1536 drive vinumdrive2 device /dev/da3h
1537 drive vinumdrive3 device /dev/da4h
1538 volume raid10 setupstate
1539 plex name raid10.p0 org striped 279k
1540 sd name raid10.p0.s0 drive vinumdrive0 size 849825b
1541 sd name raid10.p0.s1 drive vinumdrive2 size 849825b
1542 plex name raid10.p1 org striped 279k
1543 sd name raid10.p1.s0 drive vinumdrive1 size 1173665b
1544 sd name raid10.p1.s1 drive vinumdrive3 size 1173665b
1545 V raid10 State: up Plexes: 2 Size: 1146 MB
1546 P raid10.p0 S State: up Subdisks: 2 Size: 829 MB
1547 P raid10.p1 S State: up Subdisks: 2 Size: 1146 MB
1548 S raid10.p0.s0 State: up PO: 0 B Size: 414 MB
1549 S raid10.p0.s1 State: up PO: 279 kB Size: 414 MB
1550 S raid10.p1.s0 State: up PO: 0 B Size: 573 MB
1551 S raid10.p1.s1 State: up PO: 279 kB Size: 573 MB
1554 In this case, the usable part of the volume is even smaller, since the first
1555 plex has shrunken to match the smallest drive.
1556 .Sh CONFIGURATION FILE
1558 requires that all parameters to the
1560 commands must be in a configuration file. Entries in the configuration file
1561 define volumes, plexes and subdisks, and may be in free format, except that each
1562 entry must be on a single line.
1564 Some configuration file parameters specify a size (lengths, stripe sizes).
1565 These values can be specified as bytes, or one of the following scale factors
1567 .Bl -tag -width indent
1569 specifies that the value is a number of sectors of 512 bytes.
1571 specifies that the value is a number of kilobytes (1024 bytes).
1573 specifies that the value is a number of megabytes (1048576 bytes).
1575 specifies that the value is a number of gigabytes (1073741824 bytes).
1577 is used for compatibility with
1579 It stands for blocks of 512 bytes.
1580 This abbreviation is confusing, since the word
1582 is used in different meanings, and its use is deprecated. Use the keyword 's'
1586 For example, the value 16777216 bytes can also be written as
1592 The configuration file can contain the following entries:
1594 .It Ic drive Ar name devicename Op Ar options
1595 Define a drive. The options are:
1597 .It Cm device Ar devicename
1598 Specify the device on which the drive resides.
1600 must be the name of a disk partition, for example
1604 and it must be of type
1608 partition, which is reserved for the complete disk.
1610 Define the drive to be a
1612 drive, which is maintained to automatically replace a failed drive.
1614 does not allow this drive to be used for any other purpose. In particular, it
1615 is not possible to create subdisks on it. This functionality has not been
1616 completely implemented.
1618 .It Ic volume Ar name Op Ar options
1619 Define a volume with name
1623 .It Cm plex Ar plexname
1624 Add the specified plex to the volume. If
1629 will look for the definition of the plex as the next possible entry in the
1630 configuration file after the definition of the volume.
1631 .It Cm readpol Ar policy
1639 .Cm prefer Ar plexname .
1641 satisfies a read request from only one of the plexes. A
1643 read policy specifies that each read should be performed from a different plex
1648 read policy reads from the specified plex every time.
1650 When creating a multi-plex volume, assume that the contents of all the plexes
1651 are consistent. This is normally not the case, so by default
1653 sets all plexes except the first one to the
1657 command to first bring them to a consistent state. In the case of striped and
1658 concatenated plexes, however, it does not normally cause problems to leave them
1659 inconsistent: when using a volume for a file system or a swap partition, the
1660 previous contents of the disks are not of interest, so they may be ignored.
1661 If you want to take this risk, use the
1663 keyword. It will only apply to the plexes defined immediately after the volume
1664 in the configuration file. If you add plexes to a volume at a later time, you
1665 must integrate them manually with the
1673 command with RAID-5 plexes: otherwise extreme data corruption will result if one
1676 .It Ic plex Op Ar options
1677 Define a plex. Unlike a volume, you do not need to specify a name for a plex.
1680 .It Cm name Ar plexname
1681 Specify the name of the plex. Note that you must use the keyword
1683 when naming a plex or subdisk.
1684 .It Cm org Ar organization Op Ar stripesize
1685 Specify the organization of the plex.
1688 .Cm concat , striped
1695 plexes, the parameter
1697 must be specified, while for
1699 it must be omitted. For type
1701 it specifies the width of each stripe. For type
1703 it specifies the size of a group. A group is a portion of a plex which
1704 stores the parity bits all in the same subdisk. It must be a factor of the plex size (in
1705 other words, the result of dividing the plex size by the stripe size must be an
1706 integer), and it must be a multiple of a disk sector (512 bytes).
1708 For optimum performance, stripes should be at least 128 kB in size: anything
1709 smaller will result in a significant increase in I/O activity due to mapping of
1710 individual requests over multiple disks. The performance improvement due to the
1711 increased number of concurrent transfers caused by this mapping will not make up
1712 for the performance drop due to the increase in latency. A good guideline for
1713 stripe size is between 256 kB and 512 kB. Avoid powers of 2, however: they tend
1714 to cause all superblocks to be placed on the first subdisk. The simplified
1715 commands use a stripe size of 279 kB, which shows a reasonable distribution of
1718 A striped plex must have at least two subdisks (otherwise it is a concatenated
1719 plex), and each must be the same size. A RAID-5 plex must have at least three
1720 subdisks, and each must be the same size. In practice, a RAID-5 plex should
1721 have at least 5 subdisks.
1722 .It Cm volume Ar volname
1723 Add the plex to the specified volume. If no
1725 keyword is specified, the plex will be added to the last volume mentioned in the
1727 .It Cm sd Ar sdname offset
1728 Add the specified subdisk to the plex at offset
1731 .It Ic subdisk Op Ar options
1732 Define a subdisk. Options may be:
1733 .Bl -hang -width 18n
1735 Specify the name of a subdisk. It is not necessary to specify a name for a
1738 above. Note that you must specify the keyword
1740 if you wish to name a subdisk.
1741 .It Cm plexoffset Ar offset
1742 Specify the starting offset of the subdisk in the plex. If not specified,
1744 allocates the space immediately after the previous subdisk, if any, or otherwise
1745 at the beginning of the plex.
1746 .It Cm driveoffset Ar offset
1747 Specify the starting offset of the subdisk in the drive. If not specified,
1749 allocates the first contiguous
1751 bytes of free space on the drive.
1752 .It Cm length Ar length
1753 Specify the length of the subdisk. This keyword must be specified. There is no
1754 default, but the value 0 may be specified to mean
1755 .Dq "use the largest available contiguous free area on the drive" .
1756 If the drive is empty, this means that the entire drive will be used for the
1762 Specify the plex to which the subdisk belongs. By default, the subdisk belongs
1763 to the last plex specified.
1764 .It Cm drive Ar drive
1765 Specify the drive on which the subdisk resides. By default, the subdisk resides
1766 on the last drive specified.
1768 Specify that the subdisk should not be taken down if an unrecoverable error
1771 responds to an unrecoverable error by making the entire subdisk inaccessible.
1774 .Sh EXAMPLE CONFIGURATION FILE
1776 # Sample vinum configuration file
1779 drive drive1 device /dev/da1h
1780 drive drive2 device /dev/da2h
1781 drive drive3 device /dev/da3h
1782 drive drive4 device /dev/da4h
1783 drive drive5 device /dev/da5h
1784 drive drive6 device /dev/da6h
1785 # A volume with one striped plex
1787 plex org striped 279k
1788 sd length 64m drive drive2
1789 sd length 64m drive drive4
1791 plex org striped 279k
1792 sd length 512m drive drive2
1793 sd length 512m drive drive4
1797 sd length 100m drive drive2
1798 sd length 50m drive drive4
1800 sd length 150m drive drive4
1801 # A volume with one striped plex and one concatenated plex
1803 plex org striped 279k
1804 sd length 100m drive drive2
1805 sd length 100m drive drive4
1807 sd length 150m drive drive2
1808 sd length 50m drive drive4
1809 # a volume with a RAID-5 and a striped plex
1810 # note that the RAID-5 volume is longer by
1811 # the length of one subdisk
1813 plex org striped 64k
1814 sd length 1000m drive drive2
1815 sd length 1000m drive drive4
1817 sd length 500m drive drive1
1818 sd length 500m drive drive2
1819 sd length 500m drive drive3
1820 sd length 500m drive drive4
1821 sd length 500m drive drive5
1823 .Sh DRIVE LAYOUT CONSIDERATIONS
1825 drives are currently
1827 disk partitions. They must be of type
1829 in order to avoid overwriting data used for other purposes. Use
1831 to edit a partition type definition. The following display shows a typical
1832 partition layout as shown by
1836 # size offset fstype [fsize bsize bps/cpg]
1837 a: 81920 344064 4.2BSD 0 0 0 # (Cyl. 240*- 297*)
1838 b: 262144 81920 swap # (Cyl. 57*- 240*)
1839 c: 4226725 0 unused 0 0 # (Cyl. 0 - 2955*)
1840 e: 81920 0 4.2BSD 0 0 0 # (Cyl. 0 - 57*)
1841 f: 1900000 425984 4.2BSD 0 0 0 # (Cyl. 297*- 1626*)
1842 g: 1900741 2325984 vinum 0 0 0 # (Cyl. 1626*- 2955*)
1845 In this example, partition
1849 partition. Partitions
1858 partitions. Partition
1860 is a swap partition, and partition
1862 represents the whole disk and should not be used for any other purpose.
1865 uses the first 265 sectors on each partition for configuration information, so
1866 the maximum size of a subdisk is 265 sectors smaller than the drive.
1869 maintains a log file, by default
1870 .Pa /var/tmp/vinum_history ,
1871 in which it keeps track of the commands issued to
1873 You can override the name of this file by setting the environment variable
1875 to the name of the file.
1877 Each message in the log file is preceded by a date. The default format is
1878 .Qq Li %e %b %Y %H:%M:%S .
1881 for further details of the format string. It can be overridden by the
1882 environment variable
1883 .Ev VINUM_DATEFORMAT .
1884 .Sh HOW TO SET UP VINUM
1885 This section gives practical advice about how to implement a
1888 .Ss Where to put the data
1889 The first choice you need to make is where to put the data. You need dedicated
1892 They should be partitions, not devices, and they should not be partition
1894 For example, good names are
1902 both of which represent a device, not a partition, and
1904 which represents a complete disk and should be of type
1906 See the example under
1907 .Sx DRIVE LAYOUT CONSIDERATIONS
1909 .Ss Designing volumes
1912 volumes depends on your intentions. There are a number of possibilities:
1915 You may want to join up a number of small disks to make a reasonable sized file
1916 system. For example, if you had five small drives and wanted to use all the
1917 space for a single volume, you might write a configuration file like:
1918 .Bd -literal -offset indent
1919 drive d1 device /dev/da2e
1920 drive d2 device /dev/da3e
1921 drive d3 device /dev/da4e
1922 drive d4 device /dev/da5e
1923 drive d5 device /dev/da6e
1926 sd length 0 drive d1
1927 sd length 0 drive d2
1928 sd length 0 drive d3
1929 sd length 0 drive d4
1930 sd length 0 drive d5
1933 In this case, you specify the length of the subdisks as 0, which means
1934 .Dq "use the largest area of free space that you can find on the drive" .
1935 If the subdisk is the only subdisk on the drive, it will use all available
1940 to obtain additional resilience against disk failures. You have the choice of
1943 or RAID-5, also called
1946 To set up mirroring, create multiple plexes in a volume. For example, to create
1947 a mirrored volume of 2 GB, you might create the following configuration file:
1948 .Bd -literal -offset indent
1949 drive d1 device /dev/da2e
1950 drive d2 device /dev/da3e
1953 sd length 2g drive d1
1955 sd length 2g drive d2
1958 When creating mirrored drives, it is important to ensure that the data from each
1959 plex is on a different physical disk so that
1961 can access the complete address space of the volume even if a drive fails.
1962 Note that each plex requires as much data as the complete volume: in this
1963 example, the volume has a size of 2 GB, but each plex (and each subdisk)
1964 requires 2 GB, so the total disk storage requirement is 4 GB.
1966 To set up RAID-5, create a single plex of type
1968 For example, to create an equivalent resilient volume of 2 GB, you might use the
1969 following configuration file:
1970 .Bd -literal -offset indent
1971 drive d1 device /dev/da2e
1972 drive d2 device /dev/da3e
1973 drive d3 device /dev/da4e
1974 drive d4 device /dev/da5e
1975 drive d5 device /dev/da6e
1978 sd length 512m drive d1
1979 sd length 512m drive d2
1980 sd length 512m drive d3
1981 sd length 512m drive d4
1982 sd length 512m drive d5
1985 RAID-5 plexes require at least three subdisks, one of which is used for storing
1986 parity information and is lost for data storage. The more disks you use, the
1987 greater the proportion of the disk storage can be used for data storage. In
1988 this example, the total storage usage is 2.5 GB, compared to 4 GB for a mirrored
1989 configuration. If you were to use the minimum of only three disks, you would
1990 require 3 GB to store the information, for example:
1991 .Bd -literal -offset indent
1992 drive d1 device /dev/da2e
1993 drive d2 device /dev/da3e
1994 drive d3 device /dev/da4e
1997 sd length 1g drive d1
1998 sd length 1g drive d2
1999 sd length 1g drive d3
2002 As with creating mirrored drives, it is important to ensure that the data from
2003 each subdisk is on a different physical disk so that
2005 can access the complete address space of the volume even if a drive fails.
2009 to allow more concurrent access to a file system. In many cases, access to a
2010 file system is limited by the speed of the disk. By spreading the volume across
2011 multiple disks, you can increase the throughput in multi-access environments.
2012 This technique shows little or no performance improvement in single-access
2015 uses a technique called
2017 or sometimes RAID-0, to increase this concurrency of access. The name RAID-0 is
2018 misleading: striping does not provide any redundancy or additional reliability.
2019 In fact, it decreases the reliability, since the failure of a single disk will
2020 render the volume useless, and the more disks you have, the more likely it is
2021 that one of them will fail.
2023 To implement striping, use a
2026 .Bd -literal -offset indent
2027 drive d1 device /dev/da2e
2028 drive d2 device /dev/da3e
2029 drive d3 device /dev/da4e
2030 drive d4 device /dev/da5e
2032 plex org striped 512k
2033 sd length 512m drive d1
2034 sd length 512m drive d2
2035 sd length 512m drive d3
2036 sd length 512m drive d4
2039 A striped plex must have at least two subdisks, but the increase in performance
2040 is greater if you have a larger number of disks.
2042 You may want to have the best of both worlds and have both resilience and
2043 performance. This is sometimes called RAID-10 (a combination of RAID-1 and
2044 RAID-0), though again this name is misleading. With
2046 you can do this with the following configuration file:
2047 .Bd -literal -offset indent
2048 drive d1 device /dev/da2e
2049 drive d2 device /dev/da3e
2050 drive d3 device /dev/da4e
2051 drive d4 device /dev/da5e
2052 volume raid setupstate
2053 plex org striped 512k
2054 sd length 512m drive d1
2055 sd length 512m drive d2
2056 sd length 512m drive d3
2057 sd length 512m drive d4
2058 plex org striped 512k
2059 sd length 512m drive d4
2060 sd length 512m drive d3
2061 sd length 512m drive d2
2062 sd length 512m drive d1
2065 Here the plexes are striped, increasing performance, and there are two of them,
2066 increasing reliablity. Note that this example shows the subdisks of the second
2067 plex in reverse order from the first plex. This is for performance reasons and
2068 will be discussed below. In addition, the volume specification includes the
2071 which ensures that all plexes are
2075 .Ss Creating the volumes
2076 Once you have created your configuration files, start
2078 and create the volumes. In this example, the configuration is in the file
2080 .Bd -literal -offset 2n
2081 # vinum create -v configfile
2082 1: drive d1 device /dev/da2e
2083 2: drive d2 device /dev/da3e
2086 5: sd length 2g drive d1
2088 7: sd length 2g drive d2
2089 Configuration summary
2091 Drives: 2 (4 configured)
2092 Volumes: 1 (4 configured)
2093 Plexes: 2 (8 configured)
2094 Subdisks: 2 (16 configured)
2096 Drive d1: Device /dev/da2e
2097 Created on vinum.lemis.com at Tue Mar 23 12:30:31 1999
2098 Config last updated Tue Mar 23 14:30:32 1999
2099 Size: 60105216000 bytes (57320 MB)
2100 Used: 2147619328 bytes (2048 MB)
2101 Available: 57957596672 bytes (55272 MB)
2104 Drive d2: Device /dev/da3e
2105 Created on vinum.lemis.com at Tue Mar 23 12:30:32 1999
2106 Config last updated Tue Mar 23 14:30:33 1999
2107 Size: 60105216000 bytes (57320 MB)
2108 Used: 2147619328 bytes (2048 MB)
2109 Available: 57957596672 bytes (55272 MB)
2113 Volume mirror: Size: 2147483648 bytes (2048 MB)
2117 Read policy: round robin
2119 Plex mirror.p0: Size: 2147483648 bytes (2048 MB)
2122 Organization: concat
2123 Part of volume mirror
2124 Plex mirror.p1: Size: 2147483648 bytes (2048 MB)
2127 Organization: concat
2128 Part of volume mirror
2130 Subdisk mirror.p0.s0:
2131 Size: 2147483648 bytes (2048 MB)
2133 Plex mirror.p0 at offset 0
2135 Subdisk mirror.p1.s0:
2136 Size: 2147483648 bytes (2048 MB)
2138 Plex mirror.p1 at offset 0
2145 to list the file as it configures. Subsequently it lists the current
2146 configuration in the same format as the
2149 .Ss Creating more volumes
2150 Once you have created the
2154 keeps track of them in its internal configuration files. You do not need to
2155 create them again. In particular, if you run the
2157 command again, you will create additional objects:
2159 # vinum create sampleconfig
2160 Configuration summary
2162 Drives: 2 (4 configured)
2163 Volumes: 1 (4 configured)
2164 Plexes: 4 (8 configured)
2165 Subdisks: 4 (16 configured)
2167 D d1 State: up Device /dev/da2e Avail: 53224/57320 MB (92%)
2168 D d2 State: up Device /dev/da3e Avail: 53224/57320 MB (92%)
2170 V mirror State: up Plexes: 4 Size: 2048 MB
2172 P mirror.p0 C State: up Subdisks: 1 Size: 2048 MB
2173 P mirror.p1 C State: up Subdisks: 1 Size: 2048 MB
2174 P mirror.p2 C State: up Subdisks: 1 Size: 2048 MB
2175 P mirror.p3 C State: up Subdisks: 1 Size: 2048 MB
2177 S mirror.p0.s0 State: up PO: 0 B Size: 2048 MB
2178 S mirror.p1.s0 State: up PO: 0 B Size: 2048 MB
2179 S mirror.p2.s0 State: up PO: 0 B Size: 2048 MB
2180 S mirror.p3.s0 State: up PO: 0 B Size: 2048 MB
2183 As this example (this time with the
2185 option) shows, re-running the
2187 has created four new plexes, each with a new subdisk. If you want to add other
2188 volumes, create new configuration files for them. They do not need to reference
2191 already knows about. For example, to create a volume
2194 .Pa /dev/da1e , /dev/da2e , /dev/da3e
2197 you only need to mention the other two:
2198 .Bd -literal -offset indent
2199 drive d3 device /dev/da1e
2200 drive d4 device /dev/da4e
2209 With this configuration file, we get:
2211 # vinum create newconfig
2212 Configuration summary
2214 Drives: 4 (4 configured)
2215 Volumes: 2 (4 configured)
2216 Plexes: 5 (8 configured)
2217 Subdisks: 8 (16 configured)
2219 D d1 State: up Device /dev/da2e Avail: 51176/57320 MB (89%)
2220 D d2 State: up Device /dev/da3e Avail: 53220/57320 MB (89%)
2221 D d3 State: up Device /dev/da1e Avail: 53224/57320 MB (92%)
2222 D d4 State: up Device /dev/da4e Avail: 53224/57320 MB (92%)
2224 V mirror State: down Plexes: 4 Size: 2048 MB
2225 V raid State: down Plexes: 1 Size: 6144 MB
2227 P mirror.p0 C State: init Subdisks: 1 Size: 2048 MB
2228 P mirror.p1 C State: init Subdisks: 1 Size: 2048 MB
2229 P mirror.p2 C State: init Subdisks: 1 Size: 2048 MB
2230 P mirror.p3 C State: init Subdisks: 1 Size: 2048 MB
2231 P raid.p0 R5 State: init Subdisks: 4 Size: 6144 MB
2233 S mirror.p0.s0 State: up PO: 0 B Size: 2048 MB
2234 S mirror.p1.s0 State: up PO: 0 B Size: 2048 MB
2235 S mirror.p2.s0 State: up PO: 0 B Size: 2048 MB
2236 S mirror.p3.s0 State: up PO: 0 B Size: 2048 MB
2237 S raid.p0.s0 State: empty PO: 0 B Size: 2048 MB
2238 S raid.p0.s1 State: empty PO: 512 kB Size: 2048 MB
2239 S raid.p0.s2 State: empty PO: 1024 kB Size: 2048 MB
2240 S raid.p0.s3 State: empty PO: 1536 kB Size: 2048 MB
2243 Note the size of the RAID-5 plex: it is only 6 GB, although together its
2244 components use 8 GB of disk space. This is because the equivalent of one
2245 subdisk is used for storing parity data.
2246 .Ss Restarting Vinum
2247 On rebooting the system, start
2255 This will start all the
2257 drives in the system. If for some reason you wish to start only some of them,
2261 .Ss Performance considerations
2262 A number of misconceptions exist about how to set up a RAID array for best
2263 performance. In particular, most systems use far too small a stripe size. The
2264 following discussion applies to all RAID systems, not just to
2269 block I/O system issues requests of between .5kB and 128 kB; a
2270 typical mix is somewhere round 8 kB. You can't stop any striping system from
2271 breaking a request into two physical requests, and if you make the stripe small
2272 enough, it can be broken into several. This will result in a significant drop
2273 in performance: the decrease in transfer time per disk is offset by the order of
2274 magnitude greater increase in latency.
2276 With modern disk sizes and the
2278 I/O system, you can expect to have a
2279 reasonably small number of fragmented requests with a stripe size between 256 kB
2280 and 512 kB; with correct RAID implementations there is no obvious reason not to
2281 increase the size to 2 or 4 MB on a large disk.
2283 When choosing a stripe size, consider that most current UFS file systems have
2284 cylinder groups 32 MB in size. If you have a stripe size and number of disks
2285 both of which are a power of two, it is probable that all superblocks and inodes
2286 will be placed on the same subdisk, which will impact performance significantly.
2287 Choose an odd number instead, for example 479 kB.
2289 The easiest way to consider the impact of any transfer in a multi-access system
2290 is to look at it from the point of view of the potential bottleneck, the disk
2291 subsystem: how much total disk time does the transfer use?
2293 everything is cached, the time relationship between the request and its
2294 completion is not so important: the important parameter is the total time that
2295 the request keeps the disks active, the time when the disks are not available to
2296 perform other transfers. As a result, it doesn't really matter if the transfers
2297 are happening at the same time or different times. In practical terms, the time
2298 we're looking at is the sum of the total latency (positioning time and
2299 rotational latency, or the time it takes for the data to arrive under the disk
2300 heads) and the total transfer time. For a given transfer to disks of the same
2301 speed, the transfer time depends only on the total size of the transfer.
2303 Consider a typical news article or web page of 24 kB, which will probably be
2304 read in a single I/O. Take disks with a transfer rate of 6 MB/s and an average
2305 positioning time of 8 ms, and a file system with 4 kB blocks. Since it's 24 kB,
2306 we don't have to worry about fragments, so the file will start on a 4 kB
2307 boundary. The number of transfers required depends on where the block starts:
2308 it's (S + F - 1) / S, where S is the stripe size in file system blocks, and F is
2309 the file size in file system blocks.
2312 Stripe size of 4 kB. You'll have 6 transfers. Total subsystem load: 48 ms
2313 latency, 2 ms transfer, 50 ms total.
2315 Stripe size of 8 kB. On average, you'll have 3.5 transfers. Total subsystem
2316 load: 28 ms latency, 2 ms transfer, 30 ms total.
2318 Stripe size of 16 kB. On average, you'll have 2.25 transfers. Total subsystem
2319 load: 18 ms latency, 2 ms transfer, 20 ms total.
2321 Stripe size of 256 kB. On average, you'll have 1.08 transfers. Total subsystem
2322 load: 8.6 ms latency, 2 ms transfer, 10.6 ms total.
2324 Stripe size of 4 MB. On average, you'll have 1.0009 transfers. Total subsystem
2325 load: 8.01 ms latency, 2 ms transfer, 10.01 ms total.
2328 It appears that some hardware RAID systems have problems with large stripes:
2329 they appear to always transfer a complete stripe to or from disk, so that a
2330 large stripe size will have an adverse effect on performance.
2332 does not suffer from this problem: it optimizes all disk transfers and does not
2333 transfer unneeded data.
2335 Note that no well-known benchmark program tests true multi-access conditions
2336 (more than 100 concurrent users), so it is difficult to demonstrate the validity
2337 of these statements.
2339 Given these considerations, the following factors affect the performance of a
2344 Striping improves performance for multiple access only, since it increases the
2345 chance of individual requests being on different drives.
2347 Concatenating UFS file systems across multiple drives can also improve
2348 performance for multiple file access, since UFS divides a file system into
2349 cylinder groups and attempts to keep files in a single cylinder group. In
2350 general, it is not as effective as striping.
2352 Mirroring can improve multi-access performance for reads, since by default
2354 issues consecutive reads to consecutive plexes.
2356 Mirroring decreases performance for all writes, whether multi-access or single
2357 access, since the data must be written to both plexes. This explains the
2358 subdisk layout in the example of a mirroring configuration above: if the
2359 corresponding subdisk in each plex is on a different physical disk, the write
2360 commands can be issued in parallel, whereas if they are on the same physical
2361 disk, they will be performed sequentially.
2363 RAID-5 reads have essentially the same considerations as striped reads, unless
2364 the striped plex is part of a mirrored volume, in which case the performance of
2365 the mirrored volume will be better.
2367 RAID-5 writes are approximately 25% of the speed of striped writes: to perform
2370 must first read the data block and the corresponding parity block, perform some
2371 calculations and write back the parity block and the data block, four times as
2372 many transfers as for writing a striped plex. On the other hand, this is offset
2373 by the cost of mirroring, so writes to a volume with a single RAID-5 plex are
2374 approximately half the speed of writes to a correctly configured volume with two
2379 configuration changes (for example, adding or removing objects, or the change of
2380 state of one of the objects),
2382 writes up to 128 kB of updated configuration to each drive. The larger the
2383 number of drives, the longer this takes.
2385 .Ss Creating file systems on Vinum volumes
2386 You do not need to run
2388 before creating a file system on a
2394 option to state that the device is not divided into partitions. For example, to
2395 create a file system on volume
2397 enter the following command:
2399 .Dl "# newfs -v /dev/vinum/mirror"
2401 A number of other considerations apply to
2406 There is no advantage in creating multiple drives on a single disk. Each drive
2407 uses 131.5 kB of data for label and configuration information, and performance
2408 will suffer when the configuration changes. Use appropriately sized subdisks instead.
2410 It is possible to increase the size of a concatenated
2412 plex, but currently the size of striped and RAID-5 plexes cannot be increased.
2413 Currently the size of an existing UFS file system also cannot be increased, but
2414 it is planned to make both plexes and file systems extensible.
2416 .Sh STATE MANAGEMENT
2417 Vinum objects have the concept of
2421 for more details. They are only completely accessible if their state is
2423 To change an object state to
2427 command. To change an object state to
2431 command. Normally other states are created automatically by the relationship
2432 between objects. For example, if you add a plex to a volume, the subdisks of
2433 the plex will be set in the
2435 state, indicating that, though the hardware is accessible, the data on the
2436 subdisk is invalid. As a result of this state, the plex will be set in the
2439 .Ss The `reviving' state
2440 In many cases, when you start a subdisk the system must copy data to the
2441 subdisk. Depending on the size of the subdisk, this can take a long time.
2442 During this time, the subdisk is set in the
2444 state. On successful completion of the copy operation, it is automatically set
2447 state. It is possible for the process performing the revive to be stopped and
2448 restarted. The system keeps track of how far the subdisk has been revived, and
2451 command is reissued, the copying continues from this point.
2453 In order to maintain the consistency of a volume while one or more of its plexes
2456 writes to subdisks which have been revived up to the point of the write. It may
2457 also read from the plex if the area being read has already been revived.
2459 The following points are not bugs, and they have good reasons for existing, but
2460 they have shown to cause confusion. Each is discussed in the appropriate
2467 disk partitions and must have the partition type
2469 This is different from ccd, which expects partitions of type
2473 is an invitation to shoot yourself in the foot: with
2475 you can easily overwrite a file system.
2477 will not permit this.
2479 For similar reasons, the
2481 command will not accept a drive on partition
2485 is used by the system to represent the whole disk, and must be of type
2487 Clearly there is a conflict here, which
2489 resolves by not using the
2493 When you create a volume with multiple plexes,
2495 does not automatically initialize the plexes. This means that the contents are
2496 not known, but they are certainly not consistent. As a result, by default
2498 sets the state of all newly-created plexes except the first to
2500 In order to synchronize them with the first plex, you must
2504 to copy the data from a plex which is in the
2506 state. Depending on the size of the subdisks involved, this can take a long
2509 In practice, people aren't too interested in what was in the plex when it was
2510 created, and other volume managers cheat by setting them
2514 provides two ways to ensure that newly created plexes are
2518 Create the plexes and then synchronize them with
2521 Create the volume (not the plex) with the keyword
2525 to ignore any possible inconsistency and set the plexes to be
2529 Some of the commands currently supported by
2531 are not really needed. For reasons which I don't understand, however, I find
2532 that users frequently try the
2536 commands, though especially
2538 outputs all sort of dire warnings. Don't use these commands unless you have a
2539 good reason to do so.
2541 Some state transitions are not very intuitive. In fact, it's not clear whether
2542 this is a bug or a feature. If you find that you can't start an object in some
2543 strange state, such as a
2545 subdisk, try first to get it into
2551 commands. If that works, you should then be able to start it. If you find
2552 that this is the only way to get out of a position where easier methods fail,
2553 please report the situation.
2555 If you build the kernel module with the
2556 .Fl D Ns Dv VINUMDEBUG
2557 option, you must also build
2560 .Fl D Ns Dv VINUMDEBUG
2561 option, since the size of some data objects used by both components depends on
2562 this option. If you don't do so, commands will fail with a corresponding error
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
2580 .Bl -tag -width /dev/vinum/control -compact
2582 directory with device nodes for
2585 .It Pa /dev/vinum/control
2588 .It Pa /dev/vinum/plex
2589 directory containing device nodes for
2592 .It Pa /dev/vinum/sd
2593 directory containing device nodes for
2598 .Bl -tag -width VINUM_DATEFORMAT
2599 .It Ev VINUM_HISTORY
2600 The name of the log file, by default
2601 .Pa /var/log/vinum_history .
2602 .It Ev VINUM_DATEFORMAT
2603 The format of dates in the log file, by default
2604 .Qq Li %e %b %Y %H:%M:%S .
2606 The name of the editor to use for editing configuration files, by default
2615 .Pa http://www.vinumvm.org/vinum.html ,
2616 .Pa http://www.vinumvm.org/vinum-debugging.html .
2618 .An Greg Lehey Aq grog@lemis.com
2622 command first appeared in
2624 The RAID-5 component of
2626 was developed for Cybernet Inc.\&
2627 .Pq Pa www.cybernet.com
2628 for its NetMAX product.