1 .\" Hey, Emacs, edit this file in -*- nroff-fill -*- mode
3 .\" Copyright (c) 1997, 1998, 2003
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.
44 .Nd Logical Volume Manager
49 is a logical volume manager inspired by, but not derived from, the Veritas
51 It provides the following features:
54 It provides device-independent logical disks, called
57 not restricted to the size of any disk on the system.
59 The volumes consist of one or more
61 each of which contain the
62 entire address space of a volume.
63 This represents an implementation of RAID-1
65 Multiple plexes can also be used for:
66 .\" XXX What about sparse plexes? Do we want them?
69 Increased read throughput.
71 will read data from the least active disk, so if a volume has plexes on multiple
72 disks, more data can be read in parallel.
74 reads data from only one plex, but it writes data to all plexes.
76 Increased reliability.
77 By storing plexes on different disks, data will remain
78 available even if one of the plexes becomes unavailable.
80 RAID-5 plex (see below), using multiple plexes requires more storage space, but
81 gives better performance, particularly in the case of a drive failure.
83 Additional plexes can be used for on-line data reorganization.
85 additional plex and subsequently detaching one of the older plexes, data can be
86 moved on-line without compromising access.
88 An additional plex can be used to obtain a consistent dump of a file system.
90 attaching an additional plex and detaching at a specific time, the detached plex
91 becomes an accurate snapshot of the file system at the time of detachment.
92 .\" Make sure to flush!
95 Each plex consists of one or more logical disk slices, called
97 Subdisks are defined as a contiguous block of physical disk storage.
99 consist of any reasonable number of subdisks (in other words, the real limit is
100 not the number, but other factors, such as memory and performance, associated
101 with maintaining a large number of subdisks).
103 A number of mappings between subdisks and plexes are available:
106 .Em "Concatenated plexes"
107 consist of one or more subdisks, each of which
108 is mapped to a contiguous part of the plex address space.
111 consist of two or more subdisks of equal size.
113 address space is mapped in
115 integral fractions of the subdisk
117 Consecutive plex address space is mapped to stripes in each subdisk in
131 "plex 0" at SD0.n+(0,.2)
132 "subdisk 0" rjust at SD0.w-(.2,0)
133 "subdisk 1" rjust at SD1.w-(.2,0)
134 "subdisk 2" rjust at SD2.w-(.2,0)
138 The subdisks of a striped plex must all be the same size.
141 require at least three equal-sized subdisks.
143 resemble striped plexes, except that in each stripe, one subdisk stores parity
145 This subdisk changes in each stripe: in the first stripe, it is the
146 first subdisk, in the second it is the second subdisk, etc.
150 will recover the data based on the information stored on the remaining subdisks.
151 This mapping is particularly suited to read-intensive access.
153 RAID-5 plex must all be the same size.
154 .\" Make sure to flush!
158 are the lowest level of the storage hierarchy.
159 They represent disk special
163 offers automatic startup.
168 volumes contain all the configuration information needed to ensure that they are
169 started correctly when the subsystem is enabled.
170 This is also a significant
171 advantage over the Veritas\(tm File System.
172 This feature regards the presence
174 It does not mean that the volumes will be mounted
175 automatically, since the standard startup procedures with
177 perform this function.
179 .Sh KERNEL CONFIGURATION
181 is currently supplied as a KLD module, and does not require
183 As with other KLDs, it is absolutely necessary to match the KLD
184 to the version of the operating system.
185 Failure to do so will cause
187 to issue an error message and terminate.
189 It is possible to configure
191 in the kernel, but this is not recommended.
192 To do so, add this line to the
193 kernel configuration file:
195 .D1 Cd "device vinum"
197 The current version of
199 both the kernel module and the user program
201 include significant debugging support.
202 It is not recommended to remove
203 this support at the moment, but if you do you must remove it from both the
204 kernel and the user components.
205 To do this, edit the files
206 .Pa /usr/src/sbin/vinum/Makefile
208 .Pa /usr/src/sys/modules/vinum/Makefile
211 variable to remove the
217 into the kernel, either specify the line
219 .D1 Cd "options VINUMDEBUG"
221 in the kernel configuration file or remove the
224 .Pa /usr/src/sbin/vinum/Makefile
229 variables do not match,
231 will fail with a message
232 explaining the problem and what to do to correct it.
234 .Cd "options VINUM_AUTOSTART"
238 automatically scan all available disks at attach time.
239 This is a deprecated way that is primarily intended for environments
240 that do not want to rely on kernel environment variables set by
244 was previously available in two versions: a freely available version which did
245 not contain RAID-5 functionality, and a full version including RAID-5
246 functionality, which was available only from Cybernet Systems Inc.
250 includes the RAID-5 functionality.
256 It does not require installation.
257 To start it, start the
259 program, which will load the KLD if it is not already present.
262 it must be configured.
265 for information on how to create a
269 Normally, you start a configured version of
287 is loaded as a KLD (the recommended way), the
289 command will unload it
292 You can also do this with the
296 The KLD can only be unloaded when idle, in other words when no volumes are
297 mounted and no other instances of the
300 Unloading the KLD does not harm the data in the volumes.
301 .Ss Configuring and Starting Objects
304 utility to configure and start
307 .Sh AUTOMATIC STARTUP
310 subsystem can be automatically started at attach time.
311 There are two kernel environment variables that can be set in
314 .Bl -tag -width ".Va vinum.autostart" -offset indent
315 .It Va vinum.autostart
316 If this variable is set (to any value), the attach function will attempt
317 to scan all available disks for valid
319 configuration records.
320 This is the preferred way if automatic startup is desired.
323 .Dl vinum.autostart="YES"
325 Alternatively, this variable can enumerate a list of disk devices
326 to scan for configuration records.
329 device names need to be given, since
331 will automatically scan all possible slices and partitions.
334 .Dl vinum.drives="da0 da1"
337 If automatic startup is used, it is not necessary to set the
343 is to supply to the volume for the root file system, it is necessary
344 to start the subsystem early.
345 This can be achieved by specifying
353 calls are intended for the use of the
355 configuration program only.
356 They are described in the header file
357 .Pa /sys/dev/vinum/vinumio.h .
359 Conventional disk special devices have a
361 in the second sector of the device.
365 This disk label describes the layout of the partitions within
368 does not subdivide volumes, so volumes do not contain a physical disk label.
371 implements the ioctl calls
375 (get partition information),
377 (write partition information) and
379 (set partition information).
384 representation of the disk label which is not present on the volume.
396 serves no useful purpose on a
399 If you run it, it will show you
405 all the same except for the
410 # size offset fstype [fsize bsize bps/cpg]
411 a: 2048 0 4.2BSD 1024 8192 0 # (Cyl. 0 - 0)
412 b: 2048 0 swap # (Cyl. 0 - 0)
413 c: 2048 0 unused 0 0 # (Cyl. 0 - 0)
421 ioctls, since there is nothing to change.
422 As a result, any attempt to modify the disk label will be silently ignored.
423 .Sh MAKING FILE SYSTEMS
426 volumes do not contain partitions, the names do not need to conform to the
427 standard rules for naming disk partitions.
428 For a physical disk partition, the
429 last letter of the device name specifies the partition identifier (a to h).
431 volumes need not conform to this convention, but if they do not,
433 will complain that it cannot determine the partition.
434 To solve this problem,
439 For example, if you have a volume
441 use the following command to create a UFS file system on it:
443 .Dl "newfs -v /dev/vinum/concat"
446 assigns default names to plexes and subdisks, although they may be overridden.
447 We do not recommend overriding the default names.
450 volume manager, which allows arbitrary naming of objects, has shown that this
451 flexibility does not bring a significant advantage, and it can cause confusion.
453 Names may contain any non-blank character, but it is recommended to restrict
454 them to letters, digits and the underscore characters.
455 The names of volumes,
456 plexes and subdisks may be up to 64 characters long, and the names of drives may
457 up to 32 characters long.
458 When choosing volume and plex names, bear in mind
459 that automatically generated plex and subdisk names are longer than the name
460 from which they are derived.
465 creates or deletes objects, it creates a directory
467 in which it makes device entries for each volume it finds.
473 in which it stores device entries for plexes and subdisks.
474 In addition, it creates two more directories,
477 .Pa /dev/vinum/drive ,
478 in which it stores hierarchical information for volumes and drives.
482 creates three super-devices,
483 .Pa /dev/vinum/control ,
484 .Pa /dev/vinum/Control
486 .Pa /dev/vinum/controld .
487 .Pa /dev/vinum/control
490 when it has been compiled without the
493 .Pa /dev/vinum/Control
496 when it has been compiled with the
499 .Pa /dev/vinum/controld
503 The two control devices for
505 are used to synchronize the debug status of kernel and user modules.
511 volumes are not subdivided into partitions, and thus do not contain a disk
513 Unfortunately, this confuses a number of utilities, notably
515 which normally tries to interpret the last letter of a
517 volume name as a partition identifier.
518 If you use a volume name which does not
527 in order to tell it to ignore this convention.
530 Plexes do not need to be assigned explicit names.
531 By default, a plex name is
532 the name of the volume followed by the letters
534 and the number of the
536 For example, the plexes of volume
539 .Pa vol3.p0 , vol3.p1
541 These names can be overridden, but it is not recommended.
543 Like plexes, subdisks are assigned names automatically, and explicit naming is
545 A subdisk name is the name of the plex followed by the letters
547 and a number identifying the subdisk.
548 For example, the subdisks of
552 .Pa vol3.p0.s0 , vol3.p0.s1
558 This makes it possible to move a drive to a different location
559 and still recognize it automatically.
560 Drive names may be up to 32 characters
566 objects described in the section
567 .Sx "CONFIGURATION FILE"
573 .Bd -literal -offset indent
576 brwxr-xr-- 1 root wheel 25, 2 Mar 30 16:08 concat
577 brwx------ 1 root wheel 25, 0x40000000 Mar 30 16:08 control
578 brwx------ 1 root wheel 25, 0x40000001 Mar 30 16:08 controld
579 drwxrwxrwx 2 root wheel 512 Mar 30 16:08 drive
580 drwxrwxrwx 2 root wheel 512 Mar 30 16:08 plex
581 drwxrwxrwx 2 root wheel 512 Mar 30 16:08 rvol
582 drwxrwxrwx 2 root wheel 512 Mar 30 16:08 sd
583 brwxr-xr-- 1 root wheel 25, 3 Mar 30 16:08 strcon
584 brwxr-xr-- 1 root wheel 25, 1 Mar 30 16:08 stripe
585 brwxr-xr-- 1 root wheel 25, 0 Mar 30 16:08 tinyvol
586 drwxrwxrwx 7 root wheel 512 Mar 30 16:08 vol
587 brwxr-xr-- 1 root wheel 25, 4 Mar 30 16:08 vol5
591 brw-r----- 1 root operator 4, 15 Oct 21 16:51 drive2
592 brw-r----- 1 root operator 4, 31 Oct 21 16:51 drive4
596 brwxr-xr-- 1 root wheel 25, 0x10000002 Mar 30 16:08 concat.p0
597 brwxr-xr-- 1 root wheel 25, 0x10010002 Mar 30 16:08 concat.p1
598 brwxr-xr-- 1 root wheel 25, 0x10000003 Mar 30 16:08 strcon.p0
599 brwxr-xr-- 1 root wheel 25, 0x10010003 Mar 30 16:08 strcon.p1
600 brwxr-xr-- 1 root wheel 25, 0x10000001 Mar 30 16:08 stripe.p0
601 brwxr-xr-- 1 root wheel 25, 0x10000000 Mar 30 16:08 tinyvol.p0
602 brwxr-xr-- 1 root wheel 25, 0x10000004 Mar 30 16:08 vol5.p0
603 brwxr-xr-- 1 root wheel 25, 0x10010004 Mar 30 16:08 vol5.p1
607 brwxr-xr-- 1 root wheel 25, 0x20000002 Mar 30 16:08 concat.p0.s0
608 brwxr-xr-- 1 root wheel 25, 0x20100002 Mar 30 16:08 concat.p0.s1
609 brwxr-xr-- 1 root wheel 25, 0x20010002 Mar 30 16:08 concat.p1.s0
610 brwxr-xr-- 1 root wheel 25, 0x20000003 Mar 30 16:08 strcon.p0.s0
611 brwxr-xr-- 1 root wheel 25, 0x20100003 Mar 30 16:08 strcon.p0.s1
612 brwxr-xr-- 1 root wheel 25, 0x20010003 Mar 30 16:08 strcon.p1.s0
613 brwxr-xr-- 1 root wheel 25, 0x20110003 Mar 30 16:08 strcon.p1.s1
614 brwxr-xr-- 1 root wheel 25, 0x20000001 Mar 30 16:08 stripe.p0.s0
615 brwxr-xr-- 1 root wheel 25, 0x20100001 Mar 30 16:08 stripe.p0.s1
616 brwxr-xr-- 1 root wheel 25, 0x20000000 Mar 30 16:08 tinyvol.p0.s0
617 brwxr-xr-- 1 root wheel 25, 0x20100000 Mar 30 16:08 tinyvol.p0.s1
618 brwxr-xr-- 1 root wheel 25, 0x20000004 Mar 30 16:08 vol5.p0.s0
619 brwxr-xr-- 1 root wheel 25, 0x20100004 Mar 30 16:08 vol5.p0.s1
620 brwxr-xr-- 1 root wheel 25, 0x20010004 Mar 30 16:08 vol5.p1.s0
621 brwxr-xr-- 1 root wheel 25, 0x20110004 Mar 30 16:08 vol5.p1.s1
625 brwxr-xr-- 1 root wheel 25, 2 Mar 30 16:08 concat
626 drwxr-xr-x 4 root wheel 512 Mar 30 16:08 concat.plex
627 brwxr-xr-- 1 root wheel 25, 3 Mar 30 16:08 strcon
628 drwxr-xr-x 4 root wheel 512 Mar 30 16:08 strcon.plex
629 brwxr-xr-- 1 root wheel 25, 1 Mar 30 16:08 stripe
630 drwxr-xr-x 3 root wheel 512 Mar 30 16:08 stripe.plex
631 brwxr-xr-- 1 root wheel 25, 0 Mar 30 16:08 tinyvol
632 drwxr-xr-x 3 root wheel 512 Mar 30 16:08 tinyvol.plex
633 brwxr-xr-- 1 root wheel 25, 4 Mar 30 16:08 vol5
634 drwxr-xr-x 4 root wheel 512 Mar 30 16:08 vol5.plex
636 /dev/vinum/vol/concat.plex:
638 brwxr-xr-- 1 root wheel 25, 0x10000002 Mar 30 16:08 concat.p0
639 drwxr-xr-x 2 root wheel 512 Mar 30 16:08 concat.p0.sd
640 brwxr-xr-- 1 root wheel 25, 0x10010002 Mar 30 16:08 concat.p1
641 drwxr-xr-x 2 root wheel 512 Mar 30 16:08 concat.p1.sd
643 /dev/vinum/vol/concat.plex/concat.p0.sd:
645 brwxr-xr-- 1 root wheel 25, 0x20000002 Mar 30 16:08 concat.p0.s0
646 brwxr-xr-- 1 root wheel 25, 0x20100002 Mar 30 16:08 concat.p0.s1
648 /dev/vinum/vol/concat.plex/concat.p1.sd:
650 brwxr-xr-- 1 root wheel 25, 0x20010002 Mar 30 16:08 concat.p1.s0
652 /dev/vinum/vol/strcon.plex:
654 brwxr-xr-- 1 root wheel 25, 0x10000003 Mar 30 16:08 strcon.p0
655 drwxr-xr-x 2 root wheel 512 Mar 30 16:08 strcon.p0.sd
656 brwxr-xr-- 1 root wheel 25, 0x10010003 Mar 30 16:08 strcon.p1
657 drwxr-xr-x 2 root wheel 512 Mar 30 16:08 strcon.p1.sd
659 /dev/vinum/vol/strcon.plex/strcon.p0.sd:
661 brwxr-xr-- 1 root wheel 25, 0x20000003 Mar 30 16:08 strcon.p0.s0
662 brwxr-xr-- 1 root wheel 25, 0x20100003 Mar 30 16:08 strcon.p0.s1
664 /dev/vinum/vol/strcon.plex/strcon.p1.sd:
666 brwxr-xr-- 1 root wheel 25, 0x20010003 Mar 30 16:08 strcon.p1.s0
667 brwxr-xr-- 1 root wheel 25, 0x20110003 Mar 30 16:08 strcon.p1.s1
669 /dev/vinum/vol/stripe.plex:
671 brwxr-xr-- 1 root wheel 25, 0x10000001 Mar 30 16:08 stripe.p0
672 drwxr-xr-x 2 root wheel 512 Mar 30 16:08 stripe.p0.sd
674 /dev/vinum/vol/stripe.plex/stripe.p0.sd:
676 brwxr-xr-- 1 root wheel 25, 0x20000001 Mar 30 16:08 stripe.p0.s0
677 brwxr-xr-- 1 root wheel 25, 0x20100001 Mar 30 16:08 stripe.p0.s1
679 /dev/vinum/vol/tinyvol.plex:
681 brwxr-xr-- 1 root wheel 25, 0x10000000 Mar 30 16:08 tinyvol.p0
682 drwxr-xr-x 2 root wheel 512 Mar 30 16:08 tinyvol.p0.sd
684 /dev/vinum/vol/tinyvol.plex/tinyvol.p0.sd:
686 brwxr-xr-- 1 root wheel 25, 0x20000000 Mar 30 16:08 tinyvol.p0.s0
687 brwxr-xr-- 1 root wheel 25, 0x20100000 Mar 30 16:08 tinyvol.p0.s1
689 /dev/vinum/vol/vol5.plex:
691 brwxr-xr-- 1 root wheel 25, 0x10000004 Mar 30 16:08 vol5.p0
692 drwxr-xr-x 2 root wheel 512 Mar 30 16:08 vol5.p0.sd
693 brwxr-xr-- 1 root wheel 25, 0x10010004 Mar 30 16:08 vol5.p1
694 drwxr-xr-x 2 root wheel 512 Mar 30 16:08 vol5.p1.sd
696 /dev/vinum/vol/vol5.plex/vol5.p0.sd:
698 brwxr-xr-- 1 root wheel 25, 0x20000004 Mar 30 16:08 vol5.p0.s0
699 brwxr-xr-- 1 root wheel 25, 0x20100004 Mar 30 16:08 vol5.p0.s1
701 /dev/vinum/vol/vol5.plex/vol5.p1.sd:
703 brwxr-xr-- 1 root wheel 25, 0x20010004 Mar 30 16:08 vol5.p1.s0
704 brwxr-xr-- 1 root wheel 25, 0x20110004 Mar 30 16:08 vol5.p1.s1
707 In the case of unattached plexes and subdisks, the naming is reversed.
709 are named after the disk on which they are located, and plexes are named after
713 This mapping is still to be determined.
722 uses this state to determine the handling of the object.
724 Volumes may have the following states:
727 The volume is completely inaccessible.
729 The volume is up and at least partially functional.
730 Not all plexes may be
734 Plexes may have the following states:
737 A plex entry which has been referenced as part of a volume, but which is
740 A plex which has gone completely down because of I/O errors.
742 A plex which has been taken down by the administrator.
744 A plex which is being initialized.
747 The remaining states represent plexes which are at least partially up.
750 A plex entry which is at least partially up.
751 Not all subdisks are available,
752 and an inconsistency has occurred.
753 If no other plex is uncorrupted, the volume
754 is no longer consistent.
756 A RAID-5 plex entry which is accessible, but one subdisk is down, requiring
757 recovery for many I/O requests.
759 A plex which is really up, but which has a reborn subdisk which we do not
760 completely trust, and which we do not want to read if we can avoid it.
762 A plex entry which is completely up.
766 Subdisks can have the following states:
769 A subdisk entry which has been created completely.
770 All fields are correct, and
771 the disk has been updated, but the on the disk is not valid.
773 A subdisk entry which has been referenced as part of a plex, but which is
776 A subdisk entry which has been created completely and which is currently being
780 The following states represent invalid data.
783 A subdisk entry which has been created completely.
784 All fields are correct, the
785 config on disk has been updated, and the data was valid, but since then the
786 drive has been taken down, and as a result updates have been missed.
788 A subdisk entry which has been created completely.
789 All fields are correct, the
790 disk has been updated, and the data was valid, but since then the drive has been
791 crashed and updates have been lost.
794 The following states represent valid, inaccessible data.
797 A subdisk entry which has been created completely.
798 All fields are correct, the
799 disk has been updated, and the data was valid, but since then the drive has gone
801 No attempt has been made to write to the subdisk since the crash, so the
804 A subdisk entry which was up, which contained valid data, and which was taken
805 down by the administrator.
808 The subdisk is currently in the process of being revived.
813 The following states represent accessible subdisks with valid data.
816 A subdisk entry which has been created completely.
817 All fields are correct, the
818 disk has been updated, and the data was valid, but since then the drive has gone
820 No updates were lost, but it is possible that the subdisk
822 We will not read from this subdisk if we have a choice.
824 is the only subdisk which covers this address space in the plex, we set its
825 state to up under these circumstances, so this status implies that there is
826 another subdisk to fulfill the request.
828 A subdisk entry which has been created completely.
829 All fields are correct, the
830 disk has been updated, and the data is valid.
833 Drives can have the following states:
836 At least one subdisk refers to the drive, but it is not currently accessible to
838 No device name is known.
840 The drive is not accessible.
842 The drive is up and running.
855 The RAID-5 component of
857 was developed by Cybernet Inc.\&
858 .Pq Pa http://www.cybernet.com/ ,
859 for its NetMAX product.
861 .An Greg Lehey Aq grog@lemis.com .
865 Bugs can be expected.
866 The configuration mechanism is not yet
868 If you have difficulties, please look at the section
869 .Sx "DEBUGGING PROBLEMS WITH VINUM"
870 before reporting problems.
874 device appear to work, but are not supported.
875 If you have trouble with
876 this configuration, please first replace the kernel with a
878 kernel and test with the KLD module.
880 Detection of differences between the version of the kernel and the KLD is not
883 The RAID-5 functionality is new in
885 Some problems have been
888 in combination with soft updates, but these are not reproducible on all
890 If you are planning to use
892 in a production environment, please test carefully.
893 .Sh DEBUGGING PROBLEMS WITH VINUM
894 Solving problems with
896 can be a difficult affair.
897 This section suggests some approaches.
898 .Ss Configuration problems
899 It is relatively easy (too easy) to run into problems with the
902 If you do, the first thing you should do is stop configuration
905 .Dl "vinum setdaemon 4"
907 This will stop updates and any further corruption of the on-disk configuration.
909 Next, look at the on-disk configuration, using a Bourne-style shell:
912 for i in /dev/da0s1h /dev/da1s1h /dev/da2s1h /dev/da3s1h; do
913 (dd if=$i skip=8 count=6|tr -d '\e000-\e011\e200-\e377'; echo) >> log
917 The names of the devices are the names of all
922 should then contain something like this:
926 IN VINOpanic.lemis.comdrive1}6E7~^K6T^Yfoovolume obj state up
928 volume raid state down
931 plex name obj.p0 state corrupt org concat vol obj
932 plex name obj.p1 state corrupt org striped 128b vol obj
933 plex name src.p0 state corrupt org striped 128b vol src
934 plex name src.p1 state up org concat vol src
935 plex name raid.p0 state faulty org disorg vol raid
936 plex name r.p0 state faulty org disorg vol r
937 plex name foo.p0 state up org concat vol foo
938 plex name foo.p1 state faulty org concat vol foo
939 sd name obj.p0.s0 drive drive2 plex obj.p0 state reborn len 409600b driveoffset 265b plexoffset 0b
940 sd name obj.p0.s1 drive drive4 plex obj.p0 state up len 409600b driveoffset 265b plexoffset 409600b
941 sd name obj.p1.s0 drive drive1 plex obj.p1 state up len 204800b driveoffset 265b plexoffset 0b
942 sd name obj.p1.s1 drive drive2 plex obj.p1 state reborn len 204800b driveoffset 409865b plexoffset 128b
943 sd name obj.p1.s2 drive drive3 plex obj.p1 state up len 204800b driveoffset 265b plexoffset 256b
944 sd name obj.p1.s3 drive drive4 plex obj.p1 state up len 204800b driveoffset 409865b plexoffset 384b
949 The first line contains the
951 label and must start with the text
953 It also contains the name of the system.
954 The exact definition is contained in
955 .Pa /usr/src/sys/dev/vinum/vinumvar.h .
956 The saved configuration starts in the middle of the line with the text
957 .Dq Li "volume obj state up"
958 and starts in sector 9 of the disk.
959 The rest of the output shows the remainder of the on-disk configuration.
961 may be necessary to increase the
965 in order to see the complete configuration.
967 The configuration on all disks should be the same.
968 If this is not the case,
969 please report the problem with the exact contents of the file
971 There is probably little that can be done to recover the on-disk configuration,
972 but if you keep a copy of the files used to create the objects, you should be
973 able to re-create them.
976 command does not change the subdisk data, so this will not cause data
978 You may need to use the
980 command if you have this kind of trouble.
982 In order to analyse a panic which you suspect comes from
984 you will need to build a debug kernel.
985 See the online handbook at
986 .Pa /usr/share/doc/en/books/developers-handbook/kerneldebug.html
988 .Pa http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/developers-\%handbook/kerneldebug.html
989 for more details of how to do this.
991 Perform the following steps to analyse a
996 Copy the following files to the directory in which you will be
997 performing the analysis, typically
1000 .Bl -bullet -compact
1002 .Pa /usr/src/sys/modules/vinum/.gdbinit.crash ,
1004 .Pa /usr/src/sys/modules/vinum/.gdbinit.kernel ,
1006 .Pa /usr/src/sys/modules/vinum/.gdbinit.serial ,
1008 .Pa /usr/src/sys/modules/vinum/.gdbinit.vinum
1011 .Pa /usr/src/sys/modules/vinum/.gdbinit.vinum.paths
1014 Make sure that you build the
1016 module with debugging information.
1019 builds a module with debugging symbols by default.
1024 does not contain symbols, you will not get an error message, but the stack trace
1025 will not show the symbols.
1026 Check the module before starting
1029 $ file /boot/kernel/vinum.ko
1030 /boot/kernel/vinum.ko: ELF 32-bit LSB shared object, Intel 80386,
1031 version 1 (FreeBSD), not stripped
1034 If the output shows that
1035 .Pa /boot/kernel/vinum.ko
1036 is stripped, you will have to find a version which is not.
1037 Usually this will be
1039 .Pa /usr/obj/sys/modules/vinum/vinum.ko
1043 .Dq Li "make world" )
1045 .Pa /usr/src/sys/modules/vinum/vinum.ko
1050 .Pa .gdbinit.vinum.paths
1053 Either take a dump or use remote serial
1055 to analyse the problem.
1056 To analyse a dump, say
1057 .Pa /var/crash/vmcore.5 ,
1059 .Pa /var/crash/.gdbinit.crash
1061 .Pa /var/crash/.gdbinit
1063 .Bd -literal -offset indent
1065 gdb -k kernel.debug vmcore.5
1068 This example assumes that you have installed the correct debug kernel at
1069 .Pa /var/crash/kernel.debug .
1070 If not, substitute the correct name of the debug kernel.
1072 To perform remote serial debugging,
1074 .Pa /var/crash/.gdbinit.serial
1076 .Pa /var/crash/.gdbinit
1078 .Bd -literal -offset indent
1085 file performs the functions necessary to establish connection.
1087 machine must already be in debug mode: enter the kernel debugger and select
1094 file expects the serial connection to run at 38400 bits per second; if you run
1095 at a different speed, edit the file accordingly (look for the
1099 The following example shows a remote debugging session using the
1106 GDB 4.16 (i386-unknown-freebsd), Copyright 1996 Free Software Foundation, Inc.
1107 Debugger (msg=0xf1093174 "vinum debug") at ../../i386/i386/db_interface.c:318
1108 318 in_Debugger = 0;
1109 #1 0xf108d9bc in vinumioctl (dev=0x40001900, cmd=0xc008464b, data=0xf6dedee0 "",
1110 flag=0x3, p=0xf68b7940) at
1111 /usr/src/sys/modules/Vinum/../../dev/Vinum/vinumioctl.c:102
1112 102 Debugger ("vinum debug");
1114 #0 Debugger (msg=0xf0f661ac "vinum debug") at ../../i386/i386/db_interface.c:318
1115 #1 0xf0f60a7c in vinumioctl (dev=0x40001900, cmd=0xc008464b, data=0xf6923ed0 "",
1116 flag=0x3, p=0xf688e6c0) at
1117 /usr/src/sys/modules/vinum/../../dev/vinum/vinumioctl.c:109
1118 #2 0xf01833b7 in spec_ioctl (ap=0xf6923e0c) at ../../miscfs/specfs/spec_vnops.c:424
1119 #3 0xf0182cc9 in spec_vnoperate (ap=0xf6923e0c) at ../../miscfs/specfs/spec_vnops.c:129
1120 #4 0xf01eb3c1 in ufs_vnoperatespec (ap=0xf6923e0c) at ../../ufs/ufs/ufs_vnops.c:2312
1121 #5 0xf017dbb1 in vn_ioctl (fp=0xf1007ec0, com=0xc008464b, data=0xf6923ed0 "",
1122 p=0xf688e6c0) at vnode_if.h:395
1123 #6 0xf015dce0 in ioctl (p=0xf688e6c0, uap=0xf6923f84) at ../../kern/sys_generic.c:473
1124 #7 0xf0214c0b in syscall (frame={tf_es = 0x27, tf_ds = 0x27, tf_edi = 0xefbfcff8,
1125 tf_esi = 0x1, tf_ebp = 0xefbfcf90, tf_isp = 0xf6923fd4, tf_ebx = 0x2,
1126 tf_edx = 0x804b614, tf_ecx = 0x8085d10, tf_eax = 0x36, tf_trapno = 0x7,
1127 tf_err = 0x2, tf_eip = 0x8060a34, tf_cs = 0x1f, tf_eflags = 0x286,
1128 tf_esp = 0xefbfcf78, tf_ss = 0x27}) at ../../i386/i386/trap.c:1100
1129 #8 0xf020a1fc in Xint0x80_syscall ()
1130 #9 0x804832d in ?? ()
1131 #10 0x80482ad in ?? ()
1132 #11 0x80480e9 in ?? ()
1137 When entering from the debugger, it is important that the source of frame 1
1140 file at the top of the example) contains the text
1141 .Dq Li "Debugger (\*[q]vinum debug\*[q]);" .
1143 This is an indication that the address specifications are correct.
1145 some other output, your symbols and the kernel module are out of sync, and the
1146 trace will be meaningless.
1149 For an initial investigation, the most important information is the output of
1152 (backtrace) command above.
1153 .Ss Reporting Problems with Vinum
1154 If you find any bugs in
1156 please report them to
1157 .An Greg Lehey Aq grog@lemis.com .
1158 Supply the following
1168 Any messages printed in
1169 .Pa /var/log/messages .
1170 All such messages will be identified by the text
1174 If you have a panic, a stack trace as described above.