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 .\" $FreeBSD: src/share/man/man4/vinum.4,v 1.22.2.9 2002/04/22 08:19:35 kuriyama Exp $
38 .\" $DragonFly: src/share/man/man4/vinum.4,v 1.9 2006/03/01 15:00:10 swildner Exp $
45 .Nd Logical Volume Manager
47 .Cd "pseudo-device vinum"
50 is a logical volume manager inspired by, but not derived from, the Veritas
52 It provides the following features:
55 It provides device-independent logical disks, called
58 not restricted to the size of any disk on the system.
60 The volumes consist of one or more
62 each of which contain the
63 entire address space of a volume.
64 This represents an implementation of RAID-1
66 Multiple plexes can also be used for
67 .\" XXX What about sparse plexes? Do we want them?
70 Increased read throughput.
72 will read data from the least active disk, so if a volume has plexes on multiple
73 disks, more data can be read in parallel.
75 reads data from only one plex, but it writes data to all plexes.
77 Increased reliability.
78 By storing plexes on different disks, data will remain
79 available even if one of the plexes becomes unavailable.
81 RAID-5 plex (see below), using multiple plexes requires more storage space, but
82 gives better performance, particularly in the case of a drive failure.
84 Additional plexes can be used for on-line data reorganization.
86 additional plex and subsequently detaching one of the older plexes, data can be
87 moved on-line without compromising access.
89 An additional plex can be used to obtain a consistent dump of a file system.
91 attaching an additional plex and detaching at a specific time, the detached plex
92 becomes an accurate snapshot of the file system at the time of detachment.
93 .\" Make sure to flush!
96 Each plex consists of one or more logical disk slices, called
98 Subdisks are defined as a contiguous block of physical disk storage.
100 consist of any reasonable number of subdisks (in other words, the real limit is
101 not the number, but other factors, such as memory and performance, associated
102 with maintaining a large number of subdisks).
104 A number of mappings between subdisks and plexes are available:
107 .Em "Concatenated plexes"
108 consist of one or more subdisks, each of which
109 is mapped to a contiguous part of the plex address space.
112 consist of two or more subdisks of equal size.
114 address space is mapped in
116 integral fractions of the subdisk
118 Consecutive plex address space is mapped to stripes in each subdisk in
132 "plex 0" at SD0.n+(0,.2)
133 "subdisk 0" rjust at SD0.w-(.2,0)
134 "subdisk 1" rjust at SD1.w-(.2,0)
135 "subdisk 2" rjust at SD2.w-(.2,0)
139 The subdisks of a striped plex must all be the same size.
142 require at least three equal-sized subdisks.
144 resemble striped plexes, except that in each stripe, one subdisk stores parity
146 This subdisk changes in each stripe: in the first stripe, it is the
147 first subdisk, in the second it is the second subdisk, etc.
151 will recover the data based on the information stored on the remaining subdisks.
152 This mapping is particularly suited to read-intensive access.
154 RAID-5 plex must all be the same size.
155 .\" Make sure to flush!
159 are the lowest level of the storage hierarchy.
160 They represent disk special
164 offers automatic startup.
169 volumes contain all the configuration information needed to ensure that they are
170 started correctly when the subsystem is enabled.
171 This is also a significant
172 advantage over the Veritas\(tm File System.
173 This feature regards the presence
175 It does not mean that the volumes will be mounted
176 automatically, since the standard startup procedures with
178 perform this function.
180 .Sh KERNEL CONFIGURATION
182 is currently supplied as a KLD module, and does not require
184 As with other klds, it is absolutely necessary to match the kld
185 to the version of the operating system.
186 Failure to do so will cause
188 to issue an error message and terminate.
190 It is possible to configure
192 in the kernel, but this is not recommended.
193 To do so, add this line to the
194 kernel configuration file:
196 .D1 Cd "pseudo-device vinum"
198 The current version of
200 both the kernel module and the user program
202 include significant debugging support.
203 It is not recommended to remove
204 this support at the moment, but if you do you must remove it from both the
205 kernel and the user components.
206 To do this, edit the files
207 .Pa /usr/src/sbin/vinum/Makefile
209 .Pa /sys/dev/raid/vinum/Makefile
212 variable to remove the
218 into the kernel, either specify the line
220 .D1 Cd "options VINUMDEBUG"
222 in the kernel configuration file or remove the
225 .Pa /usr/src/sbin/vinum/Makefile
230 variables do not match,
232 will fail with a message
233 explaining the problem and what to do to correct it.
236 was previously available in two versions: a freely available version which did
237 not contain RAID-5 functionality, and a full version including RAID-5
238 functionality, which was available only from Cybernet Systems Inc.
242 includes the RAID-5 functionality.
248 It does not require installation.
249 To start it, start the
251 program, which will load the kld if it is not already present.
254 it must be configured.
257 for information on how to create a
261 Normally, you start a configured version of
279 is loaded as a kld (the recommended way), the
281 command will unload it
284 You can also do this with the
288 The kld can only be unloaded when idle, in other words when no volumes are
289 mounted and no other instances of the
292 Unloading the kld does not harm the data in the volumes.
293 .Ss Configuring and Starting Objects
296 utility to configure and start
301 calls are intended for the use of the
303 configuration program only.
304 They are described in the header file
305 .Pa /sys/dev/raid/vinum/vinumio.h .
307 Conventional disk special devices have a
309 in the second sector of the device.
313 This disk label describes the layout of the partitions within
316 does not subdivide volumes, so volumes do not contain a physical disk label.
319 implements the ioctl calls
323 (get partition information),
325 (write partition information) and
327 (set partition information).
332 representation of the disk label which is not present on the volume.
344 serves no useful purpose on a
347 If you run it, it will show you
353 all the same except for the
358 # size offset fstype [fsize bsize bps/cpg]
359 a: 2048 0 4.2BSD 1024 8192 0 # (Cyl. 0 - 0)
360 b: 2048 0 swap # (Cyl. 0 - 0)
361 c: 2048 0 unused 0 0 # (Cyl. 0 - 0)
368 .Dv DIOCSDINFO ioctls, since there is nothing to change.
369 As a result, any attempt to modify the disk label will be silently ignored.
370 .Sh MAKING FILE SYSTEMS
373 volumes do not contain partitions, the names do not need to conform to the
374 standard rules for naming disk partitions.
375 For a physical disk partition, the
376 last letter of the device name specifies the partition identifier (a to h).
378 volumes need not conform to this convention, but if they do not,
380 will complain that it cannot determine the partition.
381 To solve this problem,
386 For example, if you have a volume
388 use the following command to create a UFS file system on it:
390 .Dl "newfs -v /dev/vinum/concat"
393 assigns default names to plexes and subdisks, although they may be overridden.
394 We do not recommend overriding the default names.
397 volume manager, which allows arbitary naming of objects, has shown that this
398 flexibility does not bring a significant advantage, and it can cause confusion.
400 Names may contain any non-blank character, but it is recommended to restrict
401 them to letters, digits and the underscore characters.
402 The names of volumes,
403 plexes and subdisks may be up to 64 characters long, and the names of drives may
404 up to 32 characters long.
405 When choosing volume and plex names, bear in mind
406 that automatically generated plex and subdisk names are longer than the name
407 from which they are derived.
412 creates or deletes objects, it creates a directory
414 in which it makes device entries for each volume.
420 in which it stores device entries for the plexes and subdisks. In addition, it
421 creates two more directories,
424 .Pa /dev/vinum/drive ,
425 in which it stores hierarchical information for volumes and drives.
429 creates three super-devices,
430 .Pa /dev/vinum/control ,
431 .Pa /dev/vinum/Control
433 .Pa /dev/vinum/controld .
434 .Pa /dev/vinum/control
437 when it has been compiled without the
440 .Pa /dev/vinum/Control
443 when it has been compiled with the
446 .Pa /dev/vinum/controld
450 The two control devices for
452 are used to synchronize the debug status of kernel and user modules.
458 volumes are not subdivided into partitions, and thus do not contain a disk
460 Unfortunately, this confuses a number of utilities, notably
462 which normally tries to interpret the last letter of a
464 volume name as a partition identifier.
465 If you use a volume name which does not
474 in order to tell it to ignore this convention.
477 Plexes do not need to be assigned explicit names.
478 By default, a plex name is
479 the name of the volume followed by the letters
481 and the number of the
483 For example, the plexes of volume
486 .Pa vol3.p0 , vol3.p1
488 These names can be overridden, but it is not recommended.
490 Like plexes, subdisks are assigned names automatically, and explicit naming is
492 A subdisk name is the name of the plex followed by the letters
494 and a number identifying the subdisk.
495 For example, the subdisks of
499 .Pa vol3.p0.s0 , vol3.p0.s1
505 This makes it possible to move a drive to a different location
506 and still recognize it automatically.
507 Drive names may be up to 32 characters
513 objects described in the section
514 .Sx "CONFIGURATION FILE"
520 .Bd -literal -offset indent
523 crwxr-xr-- 1 root wheel 91, 2 Mar 30 16:08 concat
524 crwx------ 1 root wheel 91, 0x40000000 Mar 30 16:08 control
525 crwx------ 1 root wheel 91, 0x40000001 Mar 30 16:08 controld
526 drwxrwxrwx 2 root wheel 512 Mar 30 16:08 drive
527 drwxrwxrwx 2 root wheel 512 Mar 30 16:08 plex
528 drwxrwxrwx 2 root wheel 512 Mar 30 16:08 rvol
529 drwxrwxrwx 2 root wheel 512 Mar 30 16:08 sd
530 crwxr-xr-- 1 root wheel 91, 3 Mar 30 16:08 strcon
531 crwxr-xr-- 1 root wheel 91, 1 Mar 30 16:08 stripe
532 crwxr-xr-- 1 root wheel 91, 0 Mar 30 16:08 tinyvol
533 drwxrwxrwx 7 root wheel 512 Mar 30 16:08 vol
534 crwxr-xr-- 1 root wheel 91, 4 Mar 30 16:08 vol5
538 crw-r----- 1 root operator 4, 15 Oct 21 16:51 drive2
539 crw-r----- 1 root operator 4, 31 Oct 21 16:51 drive4
543 crwxr-xr-- 1 root wheel 91, 0x10000002 Mar 30 16:08 concat.p0
544 crwxr-xr-- 1 root wheel 91, 0x10010002 Mar 30 16:08 concat.p1
545 crwxr-xr-- 1 root wheel 91, 0x10000003 Mar 30 16:08 strcon.p0
546 crwxr-xr-- 1 root wheel 91, 0x10010003 Mar 30 16:08 strcon.p1
547 crwxr-xr-- 1 root wheel 91, 0x10000001 Mar 30 16:08 stripe.p0
548 crwxr-xr-- 1 root wheel 91, 0x10000000 Mar 30 16:08 tinyvol.p0
549 crwxr-xr-- 1 root wheel 91, 0x10000004 Mar 30 16:08 vol5.p0
550 crwxr-xr-- 1 root wheel 91, 0x10010004 Mar 30 16:08 vol5.p1
554 crwxr-xr-- 1 root wheel 91, 0x20000002 Mar 30 16:08 concat.p0.s0
555 crwxr-xr-- 1 root wheel 91, 0x20100002 Mar 30 16:08 concat.p0.s1
556 crwxr-xr-- 1 root wheel 91, 0x20010002 Mar 30 16:08 concat.p1.s0
557 crwxr-xr-- 1 root wheel 91, 0x20000003 Mar 30 16:08 strcon.p0.s0
558 crwxr-xr-- 1 root wheel 91, 0x20100003 Mar 30 16:08 strcon.p0.s1
559 crwxr-xr-- 1 root wheel 91, 0x20010003 Mar 30 16:08 strcon.p1.s0
560 crwxr-xr-- 1 root wheel 91, 0x20110003 Mar 30 16:08 strcon.p1.s1
561 crwxr-xr-- 1 root wheel 91, 0x20000001 Mar 30 16:08 stripe.p0.s0
562 crwxr-xr-- 1 root wheel 91, 0x20100001 Mar 30 16:08 stripe.p0.s1
563 crwxr-xr-- 1 root wheel 91, 0x20000000 Mar 30 16:08 tinyvol.p0.s0
564 crwxr-xr-- 1 root wheel 91, 0x20100000 Mar 30 16:08 tinyvol.p0.s1
565 crwxr-xr-- 1 root wheel 91, 0x20000004 Mar 30 16:08 vol5.p0.s0
566 crwxr-xr-- 1 root wheel 91, 0x20100004 Mar 30 16:08 vol5.p0.s1
567 crwxr-xr-- 1 root wheel 91, 0x20010004 Mar 30 16:08 vol5.p1.s0
568 crwxr-xr-- 1 root wheel 91, 0x20110004 Mar 30 16:08 vol5.p1.s1
572 crwxr-xr-- 1 root wheel 91, 2 Mar 30 16:08 concat
573 drwxr-xr-x 4 root wheel 512 Mar 30 16:08 concat.plex
574 crwxr-xr-- 1 root wheel 91, 3 Mar 30 16:08 strcon
575 drwxr-xr-x 4 root wheel 512 Mar 30 16:08 strcon.plex
576 crwxr-xr-- 1 root wheel 91, 1 Mar 30 16:08 stripe
577 drwxr-xr-x 3 root wheel 512 Mar 30 16:08 stripe.plex
578 crwxr-xr-- 1 root wheel 91, 0 Mar 30 16:08 tinyvol
579 drwxr-xr-x 3 root wheel 512 Mar 30 16:08 tinyvol.plex
580 crwxr-xr-- 1 root wheel 91, 4 Mar 30 16:08 vol5
581 drwxr-xr-x 4 root wheel 512 Mar 30 16:08 vol5.plex
583 /dev/vinum/vol/concat.plex:
585 crwxr-xr-- 1 root wheel 91, 0x10000002 Mar 30 16:08 concat.p0
586 drwxr-xr-x 2 root wheel 512 Mar 30 16:08 concat.p0.sd
587 crwxr-xr-- 1 root wheel 91, 0x10010002 Mar 30 16:08 concat.p1
588 drwxr-xr-x 2 root wheel 512 Mar 30 16:08 concat.p1.sd
590 /dev/vinum/vol/concat.plex/concat.p0.sd:
592 crwxr-xr-- 1 root wheel 91, 0x20000002 Mar 30 16:08 concat.p0.s0
593 crwxr-xr-- 1 root wheel 91, 0x20100002 Mar 30 16:08 concat.p0.s1
595 /dev/vinum/vol/concat.plex/concat.p1.sd:
597 crwxr-xr-- 1 root wheel 91, 0x20010002 Mar 30 16:08 concat.p1.s0
599 /dev/vinum/vol/strcon.plex:
601 crwxr-xr-- 1 root wheel 91, 0x10000003 Mar 30 16:08 strcon.p0
602 drwxr-xr-x 2 root wheel 512 Mar 30 16:08 strcon.p0.sd
603 crwxr-xr-- 1 root wheel 91, 0x10010003 Mar 30 16:08 strcon.p1
604 drwxr-xr-x 2 root wheel 512 Mar 30 16:08 strcon.p1.sd
606 /dev/vinum/vol/strcon.plex/strcon.p0.sd:
608 crwxr-xr-- 1 root wheel 91, 0x20000003 Mar 30 16:08 strcon.p0.s0
609 crwxr-xr-- 1 root wheel 91, 0x20100003 Mar 30 16:08 strcon.p0.s1
611 /dev/vinum/vol/strcon.plex/strcon.p1.sd:
613 crwxr-xr-- 1 root wheel 91, 0x20010003 Mar 30 16:08 strcon.p1.s0
614 crwxr-xr-- 1 root wheel 91, 0x20110003 Mar 30 16:08 strcon.p1.s1
616 /dev/vinum/vol/stripe.plex:
618 crwxr-xr-- 1 root wheel 91, 0x10000001 Mar 30 16:08 stripe.p0
619 drwxr-xr-x 2 root wheel 512 Mar 30 16:08 stripe.p0.sd
621 /dev/vinum/vol/stripe.plex/stripe.p0.sd:
623 crwxr-xr-- 1 root wheel 91, 0x20000001 Mar 30 16:08 stripe.p0.s0
624 crwxr-xr-- 1 root wheel 91, 0x20100001 Mar 30 16:08 stripe.p0.s1
626 /dev/vinum/vol/tinyvol.plex:
628 crwxr-xr-- 1 root wheel 91, 0x10000000 Mar 30 16:08 tinyvol.p0
629 drwxr-xr-x 2 root wheel 512 Mar 30 16:08 tinyvol.p0.sd
631 /dev/vinum/vol/tinyvol.plex/tinyvol.p0.sd:
633 crwxr-xr-- 1 root wheel 91, 0x20000000 Mar 30 16:08 tinyvol.p0.s0
634 crwxr-xr-- 1 root wheel 91, 0x20100000 Mar 30 16:08 tinyvol.p0.s1
636 /dev/vinum/vol/vol5.plex:
638 crwxr-xr-- 1 root wheel 91, 0x10000004 Mar 30 16:08 vol5.p0
639 drwxr-xr-x 2 root wheel 512 Mar 30 16:08 vol5.p0.sd
640 crwxr-xr-- 1 root wheel 91, 0x10010004 Mar 30 16:08 vol5.p1
641 drwxr-xr-x 2 root wheel 512 Mar 30 16:08 vol5.p1.sd
643 /dev/vinum/vol/vol5.plex/vol5.p0.sd:
645 crwxr-xr-- 1 root wheel 91, 0x20000004 Mar 30 16:08 vol5.p0.s0
646 crwxr-xr-- 1 root wheel 91, 0x20100004 Mar 30 16:08 vol5.p0.s1
648 /dev/vinum/vol/vol5.plex/vol5.p1.sd:
650 crwxr-xr-- 1 root wheel 91, 0x20010004 Mar 30 16:08 vol5.p1.s0
651 crwxr-xr-- 1 root wheel 91, 0x20110004 Mar 30 16:08 vol5.p1.s1
654 In the case of unattached plexes and subdisks, the naming is reversed.
656 are named after the disk on which they are located, and plexes are named after
660 This mapping is still to be determined.
669 uses this state to determine the handling of the object.
671 Volumes may have the following states:
674 The volume is completely inaccessible.
676 The volume is up and at least partially functional.
677 Not all plexes may be
681 Plexes may have the following states:
684 A plex entry which has been referenced as part of a volume, but which is
687 A plex which has gone completely down because of I/O errors.
689 A plex which has been taken down by the administrator.
691 A plex which is being initialized.
694 The remaining states represent plexes which are at least partially up.
697 A plex entry which is at least partially up.
698 Not all subdisks are available,
699 and an inconsistency has occurred.
700 If no other plex is uncorrupted, the volume
701 is no longer consistent.
703 A RAID-5 plex entry which is accessible, but one subdisk is down, requiring
704 recovery for many I/O requests.
706 A plex which is really up, but which has a reborn subdisk which we do not
707 completely trust, and which we do not want to read if we can avoid it.
709 A plex entry which is completely up.
713 Subdisks can have the following states:
716 A subdisk entry which has been created completely.
717 All fields are correct, and
718 the disk has been updated, but the on the disk is not valid.
720 A subdisk entry which has been referenced as part of a plex, but which is
723 A subdisk entry which has been created completely and which is currently being
727 The following states represent invalid data.
730 A subdisk entry which has been created completely.
731 All fields are correct, the
732 config on disk has been updated, and the data was valid, but since then the
733 drive has been taken down, and as a result updates have been missed.
735 A subdisk entry which has been created completely.
736 All fields are correct, the
737 disk has been updated, and the data was valid, but since then the drive has been
738 crashed and updates have been lost.
741 The following states represent valid, inaccessible data.
744 A subdisk entry which has been created completely.
745 All fields are correct, the
746 disk has been updated, and the data was valid, but since then the drive has gone
748 No attempt has been made to write to the subdisk since the crash, so the
751 A subdisk entry which was up, which contained valid data, and which was taken
752 down by the administrator.
755 The subdisk is currently in the process of being revived.
760 The following states represent accessible subdisks with valid data.
763 A subdisk entry which has been created completely.
764 All fields are correct, the
765 disk has been updated, and the data was valid, but since then the drive has gone
767 No updates were lost, but it is possible that the subdisk
769 We won't read from this subdisk if we have a choice.
771 is the only subdisk which covers this address space in the plex, we set its
772 state to up under these circumstances, so this status implies that there is
773 another subdisk to fulfil the request.
775 A subdisk entry which has been created completely.
776 All fields are correct, the
777 disk has been updated, and the data is valid.
780 Drives can have the following states:
783 At least one subdisk refers to the drive, but it is not currently accessible to
785 No device name is known.
787 The drive is not accessible.
789 The drive is up and running.
791 .Sh DEBUGGING PROBLEMS WITH VINUM
792 Solving problems with
794 can be a difficult affair.
795 This section suggests some approaches.
796 .Ss Configuration problems
797 It is relatively easy (too easy) to run into problems with the
800 If you do, the first thing you should do is stop configuration
803 .Dl "vinum setdaemon 4"
805 This will stop updates and any further corruption of the on-disk configuration.
807 Next, look at the on-disk configuration with the
809 command, for example:
813 # \fBvinum dumpconfig\fP
814 Drive 4: Device /dev/da3h
815 Created on crash.lemis.com at Sat May 20 16:32:44 2000
816 Config last updated Sat May 20 16:32:56 2000
817 Size: 601052160 bytes (573 MB)
820 volume raid state down
823 plex name obj.p0 state corrupt org concat vol obj
824 plex name obj.p1 state corrupt org striped 128b vol obj
825 plex name src.p0 state corrupt org striped 128b vol src
826 plex name src.p1 state up org concat vol src
827 plex name raid.p0 state faulty org disorg vol raid
828 plex name r.p0 state faulty org disorg vol r
829 plex name foo.p0 state up org concat vol foo
830 plex name foo.p1 state faulty org concat vol foo
831 sd name obj.p0.s0 drive drive2 plex obj.p0 state reborn len 409600b driveoffset 265b plexoffset 0b
832 sd name obj.p0.s1 drive drive4 plex obj.p0 state up len 409600b driveoffset 265b plexoffset 409600b
833 sd name obj.p1.s0 drive drive1 plex obj.p1 state up len 204800b driveoffset 265b plexoffset 0b
834 sd name obj.p1.s1 drive drive2 plex obj.p1 state reborn len 204800b driveoffset 409865b plexoffset 128b
835 sd name obj.p1.s2 drive drive3 plex obj.p1 state up len 204800b driveoffset 265b plexoffset 256b
836 sd name obj.p1.s3 drive drive4 plex obj.p1 state up len 204800b driveoffset 409865b plexoffset 384b
841 The configuration on all disks should be the same.
842 If this is not the case,
843 please save the output to a file and report the problem.
845 little that can be done to recover the on-disk configuration, but if you keep a
846 copy of the files used to create the objects, you should be able to re-create
850 command does not change the subdisk data, so this will not cause data
852 You may need to use the
854 command if you have this kind of trouble.
856 In order to analyse a panic which you suspect comes from
858 you will need to build a debug kernel.
859 See the online handbook at
860 .Pa /usr/share/doc/en/books/developers-handbook/kerneldebug.html
862 .Pa http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/developers-\%handbook/kerneldebug.html
863 for more details of how to do this.
865 Perform the following steps to analyse a
870 Copy the following files to the directory in which you will be
871 performing the analysis, typically
876 .Pa /sys/dev/raid/vinum/.gdbinit.crash ,
878 .Pa /sys/dev/raid/vinum/.gdbinit.kernel ,
880 .Pa /sys/dev/raid/vinum/.gdbinit.serial ,
882 .Pa /sys/dev/raid/vinum/.gdbinit.vinum
885 .Pa /sys/dev/raid/vinum/.gdbinit.vinum.paths
888 Make sure that you build the
890 module with debugging information.
893 builds a module with debugging symbols by default.
898 does not contain symbols, you will not get an error message, but the stack trace
899 will not show the symbols.
900 Check the module before starting
903 $ file /modules/vinum.ko
904 /modules/vinum.ko: ELF 32-bit LSB shared object, Intel 80386,
905 version 1 (FreeBSD), not stripped
908 If the output shows that
909 .Pa /modules/vinum.ko
910 is stripped, you will have to find a version which is not.
913 .Pa /usr/obj/usr/src/sys/SYSTEM_NAME/usr/src/sys/dev/raid/vinum/vinum.ko
917 .Dq Li "make world" )
919 .Pa /sys/dev/raid/vinum/vinum.ko
924 .Pa .gdbinit.vinum.paths
927 Either take a dump or use remote serial
929 to analyse the problem.
930 To analyse a dump, say
931 .Pa /var/crash/vmcore.5 ,
933 .Pa /var/crash/.gdbinit.crash
935 .Pa /var/crash/.gdbinit
937 .Bd -literal -offset indent
939 gdb -k kernel.debug vmcore.5
942 This example assumes that you have installed the correct debug kernel at
943 .Pa /var/crash/kernel.debug .
944 If not, substitute the correct name of the debug kernel.
946 To perform remote serial debugging,
948 .Pa /var/crash/.gdbinit.serial
950 .Pa /var/crash/.gdbinit
952 .Bd -literal -offset indent
959 file performs the functions necessary to establish connection.
961 machine must already be in debug mode: enter the kernel debugger and select
968 file expects the serial connection to run at 38400 bits per second; if you run
969 at a different speed, edit the file accordingly (look for the
973 The following example shows a remote debugging session using the
980 GDB 4.16 (i386-unknown-dragonfly), Copyright 1996 Free Software Foundation, Inc.
981 Debugger (msg=0xf1093174 "vinum debug") at ../../i386/i386/db_interface.c:318
983 #1 0xf108d9bc in vinumioctl (dev=0x40001900, cmd=0xc008464b, data=0xf6dedee0 "",
984 flag=0x3, p=0xf68b7940) at
985 /usr/src/sys/dev/raid/vinum/vinumioctl.c:102
986 102 Debugger ("vinum debug");
988 #0 Debugger (msg=0xf0f661ac "vinum debug") at ../../i386/i386/db_interface.c:318
989 #1 0xf0f60a7c in vinumioctl (dev=0x40001900, cmd=0xc008464b, data=0xf6923ed0 "",
990 flag=0x3, p=0xf688e6c0) at
991 /usr/src/sys/dev/raid/vinum/vinumioctl.c:109
992 #2 0xf01833b7 in spec_ioctl (ap=0xf6923e0c) at ../../miscfs/specfs/spec_vnops.c:424
993 #3 0xf0182cc9 in spec_vnoperate (ap=0xf6923e0c) at ../../miscfs/specfs/spec_vnops.c:129
994 #4 0xf01eb3c1 in ufs_vnoperatespec (ap=0xf6923e0c) at ../../ufs/ufs/ufs_vnops.c:2312
995 #5 0xf017dbb1 in vn_ioctl (fp=0xf1007ec0, com=0xc008464b, data=0xf6923ed0 "",
996 p=0xf688e6c0) at vnode_if.h:395
997 #6 0xf015dce0 in ioctl (p=0xf688e6c0, uap=0xf6923f84) at ../../kern/sys_generic.c:473
998 #7 0xf0214c0b in syscall (frame={tf_es = 0x27, tf_ds = 0x27, tf_edi = 0xefbfcff8,
999 tf_esi = 0x1, tf_ebp = 0xefbfcf90, tf_isp = 0xf6923fd4, tf_ebx = 0x2,
1000 tf_edx = 0x804b614, tf_ecx = 0x8085d10, tf_eax = 0x36, tf_trapno = 0x7,
1001 tf_err = 0x2, tf_eip = 0x8060a34, tf_cs = 0x1f, tf_eflags = 0x286,
1002 tf_esp = 0xefbfcf78, tf_ss = 0x27}) at ../../i386/i386/trap.c:1100
1003 #8 0xf020a1fc in Xint0x80_syscall ()
1004 #9 0x804832d in ?? ()
1005 #10 0x80482ad in ?? ()
1006 #11 0x80480e9 in ?? ()
1011 When entering from the debugger, it is important that the source of frame 1
1014 file at the top of the example) contains the text
1015 .Dq Li "Debugger (\*[q]vinum debug\*[q]);" .
1017 This is an indication that the address specifications are correct.
1019 some other output, your symbols and the kernel module are out of sync, and the
1020 trace will be meaningless.
1023 For an initial investigation, the most important information is the output of
1026 (backtrace) command above.
1027 .Ss Reporting Problems with Vinum
1028 If you find any bugs in
1030 please report them to
1031 .An Greg Lehey Aq grog@lemis.com .
1032 Supply the following
1042 Any messages printed in
1043 .Pa /var/log/messages .
1044 All such messages will be identified by the text
1048 If you have a panic, a stack trace as described above.
1059 The RAID-5 component of
1061 was developed by Cybernet Inc.\&
1062 .Pq Pa http://www.cybernet.com/ ,
1063 for its NetMAX product.
1065 .An Greg Lehey Aq grog@lemis.com .
1069 Bugs can be expected.
1070 The configuration mechanism is not yet
1072 If you have difficulties, please look at the section
1073 .Sx "DEBUGGING PROBLEMS WITH VINUM"
1074 before reporting problems.
1078 pseudo-device appear to work, but are not supported.
1079 If you have trouble with
1080 this configuration, please first replace the kernel with a
1082 kernel and test with the kld module.
1084 Detection of differences between the version of the kernel and the kld is not
1087 The RAID-5 functionality is new in
1089 Some problems have been
1092 in combination with soft updates, but these are not reproducible on all
1094 If you are planning to use
1096 in a production environment, please test carefully.