(no commit message)
[ikiwiki.git] / docs / handbook / handbook-vinum-object-naming.mdwn
1 \r
2 \r
3 ## 13.7 Object Naming \r
4 \r
5 As described above, Vinum assigns default names to plexes and subdisks, although they may be overridden. Overriding the default names is not recommended: experience with the VERITAS volume manager, which allows arbitrary naming of objects, has shown that this flexibility does not bring a significant advantage, and it can cause confusion.\r
6 \r
7 Names may contain any non-blank character, but it is recommended to restrict them to letters, digits and the underscore characters. The names of volumes, plexes and subdisks may be up to 64 characters long, and the names of drives may be up to 32 characters long.\r
8 \r
9 Vinum objects are assigned device nodes in the hierarchy `/dev/vinum`. The configuration shown above would cause Vinum to create the following device nodes:\r
10 \r
11
12 * The control devices `/dev/vinum/control` and `/dev/vinum/controld`, which are used by [vinum(8)](http://leaf.dragonflybsd.org/cgi/web-man?command#vinum&section8) and the Vinum daemon respectively.\r
13
14 * Block and character device entries for each volume. These are the main devices used by Vinum. The block device names are the name of the volume, while the character device names follow the BSD tradition of prepending the letter ***r*** to the name. Thus the configuration above would include the block devices `/dev/vinum/myvol`, `/dev/vinum/mirror`, `/dev/vinum/striped`, `/dev/vinum/raid5` and `/dev/vinum/raid10`, and the character devices `/dev/vinum/rmyvol`, `/dev/vinum/rmirror`, `/dev/vinum/rstriped`, `/dev/vinum/rraid5` and `/dev/vinum/rraid10`. There is obviously a problem here: it is possible to have two volumes called ***r*** and ***rr***, but there will be a conflict creating the device node `/dev/vinum/rr`: is it a character device for volume ***r*** or a block device for volume ***rr***? Currently Vinum does not address this conflict: the first-defined volume will get the name.\r
15
16 * A directory `/dev/vinum/drive` with entries for each drive. These entries are in fact symbolic links to the corresponding disk nodes.\r
17
18 * A directory `/dev/vinum/volume` with entries for each volume. It contains subdirectories for each plex, which in turn contain subdirectories for their component subdisks.\r
19
20 * The directories `/dev/vinum/plex`, `/dev/vinum/sd`, and `/dev/vinum/rsd`, which contain block device nodes for each plex and block and character device nodes respectively for each subdisk.\r
21 \r
22 For example, consider the following configuration file:\r
23 \r
24     \r
25         drive drive1 device /dev/sd1h\r
26         drive drive2 device /dev/sd2h\r
27         drive drive3 device /dev/sd3h\r
28         drive drive4 device /dev/sd4h\r
29         volume s64 setupstate\r
30           plex org striped 64k\r
31             sd length 100m drive drive1\r
32             sd length 100m drive drive2\r
33             sd length 100m drive drive3\r
34             sd length 100m drive drive4\r
35 \r
36 \r
37 After processing this file, [vinum(8)](http://leaf.dragonflybsd.org/cgi/web-man?command#vinum&section8) creates the following structure in `/dev/vinum`:\r
38 \r
39     \r
40         brwx------  1 root  wheel   25, 0x40000001 Apr 13 16:46 Control\r
41         brwx------  1 root  wheel   25, 0x40000002 Apr 13 16:46 control\r
42         brwx------  1 root  wheel   25, 0x40000000 Apr 13 16:46 controld\r
43         drwxr-xr-x  2 root  wheel       512 Apr 13 16:46 drive\r
44         drwxr-xr-x  2 root  wheel       512 Apr 13 16:46 plex\r
45         crwxr-xr--  1 root  wheel   91,   2 Apr 13 16:46 rs64\r
46         drwxr-xr-x  2 root  wheel       512 Apr 13 16:46 rsd\r
47         drwxr-xr-x  2 root  wheel       512 Apr 13 16:46 rvol\r
48         brwxr-xr--  1 root  wheel   25,   2 Apr 13 16:46 s64\r
49         drwxr-xr-x  2 root  wheel       512 Apr 13 16:46 sd\r
50         drwxr-xr-x  3 root  wheel       512 Apr 13 16:46 vol\r
51     \r
52         /dev/vinum/drive:\r
53         total 0\r
54         lrwxr-xr-x  1 root  wheel  9 Apr 13 16:46 drive1 -> /dev/sd1h\r
55         lrwxr-xr-x  1 root  wheel  9 Apr 13 16:46 drive2 -> /dev/sd2h\r
56         lrwxr-xr-x  1 root  wheel  9 Apr 13 16:46 drive3 -> /dev/sd3h\r
57         lrwxr-xr-x  1 root  wheel  9 Apr 13 16:46 drive4 -> /dev/sd4h\r
58     \r
59         /dev/vinum/plex:\r
60         total 0\r
61         brwxr-xr--  1 root  wheel   25, 0x10000002 Apr 13 16:46 s64.p0\r
62     \r
63         /dev/vinum/rsd:\r
64         total 0\r
65         crwxr-xr--  1 root  wheel   91, 0x20000002 Apr 13 16:46 s64.p0.s0\r
66         crwxr-xr--  1 root  wheel   91, 0x20100002 Apr 13 16:46 s64.p0.s1\r
67         crwxr-xr--  1 root  wheel   91, 0x20200002 Apr 13 16:46 s64.p0.s2\r
68         crwxr-xr--  1 root  wheel   91, 0x20300002 Apr 13 16:46 s64.p0.s3\r
69     \r
70         /dev/vinum/rvol:\r
71         total 0\r
72         crwxr-xr--  1 root  wheel   91,   2 Apr 13 16:46 s64\r
73     \r
74         /dev/vinum/sd:\r
75         total 0\r
76         brwxr-xr--  1 root  wheel   25, 0x20000002 Apr 13 16:46 s64.p0.s0\r
77         brwxr-xr--  1 root  wheel   25, 0x20100002 Apr 13 16:46 s64.p0.s1\r
78         brwxr-xr--  1 root  wheel   25, 0x20200002 Apr 13 16:46 s64.p0.s2\r
79         brwxr-xr--  1 root  wheel   25, 0x20300002 Apr 13 16:46 s64.p0.s3\r
80     \r
81         /dev/vinum/vol:\r
82         total 1\r
83         brwxr-xr--  1 root  wheel   25,   2 Apr 13 16:46 s64\r
84         drwxr-xr-x  3 root  wheel       512 Apr 13 16:46 s64.plex\r
85     \r
86         /dev/vinum/vol/s64.plex:\r
87         total 1\r
88         brwxr-xr--  1 root  wheel   25, 0x10000002 Apr 13 16:46 s64.p0\r
89         drwxr-xr-x  2 root  wheel       512 Apr 13 16:46 s64.p0.sd\r
90     \r
91         /dev/vinum/vol/s64.plex/s64.p0.sd:\r
92         total 0\r
93         brwxr-xr--  1 root  wheel   25, 0x20000002 Apr 13 16:46 s64.p0.s0\r
94         brwxr-xr--  1 root  wheel   25, 0x20100002 Apr 13 16:46 s64.p0.s1\r
95         brwxr-xr--  1 root  wheel   25, 0x20200002 Apr 13 16:46 s64.p0.s2\r
96         brwxr-xr--  1 root  wheel   25, 0x20300002 Apr 13 16:46 s64.p0.s3\r
97 \r
98 \r
99 Although it is recommended that plexes and subdisks should not be allocated specific names, Vinum drives must be named. This makes it possible to move a drive to a different location and still recognize it automatically. Drive names may be up to 32 characters long.\r
100 \r
101 ### 13.7.1 Creating File Systems \r
102 \r
103 Volumes appear to the system to be identical to disks, with one exception. Unlike UNIX® drives, Vinum does not partition volumes, which thus do not contain a partition table. This has required modification to some disk utilities, notably [newfs(8)](http://leaf.dragonflybsd.org/cgi/web-man?command#newfs&section8), which previously tried to interpret the last letter of a Vinum volume name as a partition identifier. For example, a disk drive may have a name like `/dev/ad0a` or `/dev/da2h`. These names represent the first partition (`a`) on the first (0) IDE disk (`ad`) and the eighth partition (`h`) on the third (2) SCSI disk (`da`) respectively. By contrast, a Vinum volume might be called `/dev/vinum/concat`, a name which has no relationship with a partition name.\r
104 \r
105 Normally, [newfs(8)](http://leaf.dragonflybsd.org/cgi/web-man?command#newfs&section8) interprets the name of the disk and complains if it cannot understand it. For example:\r
106 \r
107     \r
108     # newfs /dev/vinum/concat\r
109     newfs: /dev/vinum/concat: can't figure out file system partition\r
110 \r
111 \r
112 \r
113 \r
114 CategoryHandbook\r
115 CategoryHandbook-vinum\r