Project

General

Profile

Bug #762 » vinum.8.patch

thomas.nikolajsen, 08/09/2007 09:49 PM

View differences:

vinum.8 9 Aug 2007 19:19:40 -0000
1432 1432
.Pp
1433 1433
See above for the description of the commands.  Here are some examples, all
1434 1434
performed with the same collection of disks.  Note that the first drive,
1435
.Pa /dev/da1h ,
1435
.Pa /dev/da1s0h ,
1436 1436
is smaller than the others.  This has an effect on the sizes chosen for each
1437 1437
kind of subdisk.
1438 1438
.Pp
......
1446 1446
Use a volume with a single concatenated plex for the largest possible storage
1447 1447
without resilience to drive failures:
1448 1448
.Bd -literal
1449
vinum -> concat -v /dev/da1h /dev/da2h /dev/da3h /dev/da4h
1449
vinum -> concat -v /dev/da1s0h /dev/da2s0h /dev/da3s0h /dev/da4s0h
1450 1450
volume vinum0
1451 1451
  plex name vinum0.p0 org concat
1452
drive vinumdrive0 device /dev/da1h
1452
drive vinumdrive0 device /dev/da1s0h
1453 1453
    sd name vinum0.p0.s0 drive vinumdrive0 size 0
1454
drive vinumdrive1 device /dev/da2h
1454
drive vinumdrive1 device /dev/da2s0h
1455 1455
    sd name vinum0.p0.s1 drive vinumdrive1 size 0
1456
drive vinumdrive2 device /dev/da3h
1456
drive vinumdrive2 device /dev/da3s0h
1457 1457
    sd name vinum0.p0.s2 drive vinumdrive2 size 0
1458
drive vinumdrive3 device /dev/da4h
1458
drive vinumdrive3 device /dev/da4s0h
1459 1459
    sd name vinum0.p0.s3 drive vinumdrive3 size 0
1460 1460
V vinum0                State: up       Plexes:       1 Size:       2134 MB
1461 1461
P vinum0.p0           C State: up       Subdisks:     4 Size:       2134 MB
......
1472 1472
concatenated plex, but restrictions on striped plexes can mean that the volume
1473 1473
is smaller.  It will also not be resilient to a drive failure:
1474 1474
.Bd -literal
1475
vinum -> stripe -v /dev/da1h /dev/da2h /dev/da3h /dev/da4h
1476
drive vinumdrive0 device /dev/da1h
1477
drive vinumdrive1 device /dev/da2h
1478
drive vinumdrive2 device /dev/da3h
1479
drive vinumdrive3 device /dev/da4h
1475
vinum -> stripe -v /dev/da1s0h /dev/da2s0h /dev/da3s0h /dev/da4s0h
1476
drive vinumdrive0 device /dev/da1s0h
1477
drive vinumdrive1 device /dev/da2s0h
1478
drive vinumdrive2 device /dev/da3s0h
1479
drive vinumdrive3 device /dev/da4s0h
1480 1480
volume vinum0
1481 1481
  plex name vinum0.p0 org striped 256k
1482 1482
    sd name vinum0.p0.s0 drive vinumdrive0 size 849825b
......
1496 1496
.Ss Mirrored volume with two concatenated plexes
1497 1497
For more reliability, use a mirrored, concatenated volume:
1498 1498
.Bd -literal
1499
vinum -> mirror -v -n mirror /dev/da1h /dev/da2h /dev/da3h /dev/da4h
1500
drive vinumdrive0 device /dev/da1h
1501
drive vinumdrive1 device /dev/da2h
1502
drive vinumdrive2 device /dev/da3h
1503
drive vinumdrive3 device /dev/da4h
1499
vinum -> mirror -v -n mirror /dev/da1s0h /dev/da2s0h /dev/da3s0h /dev/da4s0h
1500
drive vinumdrive0 device /dev/da1s0h
1501
drive vinumdrive1 device /dev/da2s0h
1502
drive vinumdrive2 device /dev/da3s0h
1503
drive vinumdrive3 device /dev/da4s0h
1504 1504
volume mirror setupstate
1505 1505
  plex name mirror.p0 org concat
1506 1506
    sd name mirror.p0.s0 drive vinumdrive0 size 0b
......
1529 1529
.Fl s
1530 1530
option to create a mirrored volume with two striped plexes:
1531 1531
.Bd -literal
1532
vinum -> mirror -v -n raid10 -s /dev/da1h /dev/da2h /dev/da3h /dev/da4h
1533
drive vinumdrive0 device /dev/da1h
1534
drive vinumdrive1 device /dev/da2h
1535
drive vinumdrive2 device /dev/da3h
1536
drive vinumdrive3 device /dev/da4h
1532
vinum -> mirror -v -n raid10 -s /dev/da1s0h /dev/da2s0h /dev/da3s0h /dev/da4s0h
1533
drive vinumdrive0 device /dev/da1s0h
1534
drive vinumdrive1 device /dev/da2s0h
1535
drive vinumdrive2 device /dev/da3s0h
1536
drive vinumdrive3 device /dev/da4s0h
1537 1537
volume raid10 setupstate
1538 1538
  plex name raid10.p0 org striped 256k
1539 1539
    sd name raid10.p0.s0 drive vinumdrive0 size 849825b
......
1597 1597
Specify the device on which the drive resides.
1598 1598
.Ar devicename
1599 1599
must be the name of a disk partition, for example
1600
.Pa /dev/da1e
1600
.Pa /dev/da1s0e
1601 1601
or
1602 1602
.Pa /dev/ad3s2h ,
1603 1603
and it must be of type
......
1768 1768
# Sample vinum configuration file
1769 1769
#
1770 1770
# Our drives
1771
drive drive1 device /dev/da1h
1772
drive drive2 device /dev/da2h
1773
drive drive3 device /dev/da3h
1774
drive drive4 device /dev/da4h
1775
drive drive5 device /dev/da5h
1776
drive drive6 device /dev/da6h
1771
drive drive1 device /dev/da1s0h
1772
drive drive2 device /dev/da2s0h
1773
drive drive3 device /dev/da3s0h
1774
drive drive4 device /dev/da4s0h
1775
drive drive5 device /dev/da5s0h
1776
drive drive6 device /dev/da6s0h
1777 1777
# A volume with one striped plex
1778 1778
volume tinyvol
1779 1779
 plex org striped 512b
......
1824 1824
partition layout as shown by
1825 1825
.Xr disklabel 8 :
1826 1826
.Bd -literal
1827
8 partitions:
1828
#        size   offset    fstype   [fsize bsize bps/cpg]
1829
  a:    81920   344064    4.2BSD        0     0     0   # (Cyl.  240*- 297*)
1830
  b:   262144    81920      swap                        # (Cyl.   57*- 240*)
1831
  c:  4226725        0    unused        0     0         # (Cyl.    0 - 2955*)
1832
  e:    81920        0    4.2BSD        0     0     0   # (Cyl.    0 - 57*)
1833
  f:  1900000   425984    4.2BSD        0     0     0   # (Cyl.  297*- 1626*)
1834
  g:  1900741  2325984     vinum        0     0     0   # (Cyl. 1626*- 2955*)
1827
16 partitions:
1828
#          size     offset    fstype
1829
  a:      81920     344064    4.2BSD	#      40.000M
1830
  b:     262144      81920      swap	#     128.000M
1831
  c:    4226725          0    unused	#    2063.830M
1832
  e:      81920          0    4.2BSD	#      40.000M
1833
  f:    1900000     425984    4.2BSD	#     927.734M
1834
  g:    1900741    2325984     vinum	#     928.095M
1835 1835
.Ed
1836 1836
.Pp
1837 1837
In this example, partition
......
1845 1845
.Dq Li f
1846 1846
may be used as
1847 1847
.Em UFS
1848
file systems or
1849
.Em ccd
1850
partitions.  Partition
1848
file systems.
1849
Partition
1851 1850
.Dq Li b
1852 1851
is a swap partition, and partition
1853 1852
.Dq Li c
......
1884 1883
They should be partitions, not devices, and they should not be partition
1885 1884
.Dq Li c .
1886 1885
For example, good names are
1887
.Pa /dev/da0e
1886
.Pa /dev/da0s0e
1888 1887
or
1889 1888
.Pa /dev/ad3s4a .
1890 1889
Bad names are
......
1892 1891
and
1893 1892
.Pa /dev/da0s1 ,
1894 1893
both of which represent a device, not a partition, and
1895
.Pa /dev/ad1c ,
1894
.Pa /dev/ad1s0c ,
1896 1895
which represents a complete disk and should be of type
1897 1896
.Em unused .
1898 1897
See the example under
......
1908 1907
system.  For example, if you had five small drives and wanted to use all the
1909 1908
space for a single volume, you might write a configuration file like:
1910 1909
.Bd -literal -offset indent
1911
drive d1 device /dev/da2e
1912
drive d2 device /dev/da3e
1913
drive d3 device /dev/da4e
1914
drive d4 device /dev/da5e
1915
drive d5 device /dev/da6e
1910
drive d1 device /dev/da2s0e
1911
drive d2 device /dev/da3s0e
1912
drive d3 device /dev/da4s0e
1913
drive d4 device /dev/da5s0e
1914
drive d5 device /dev/da6s0e
1916 1915
volume bigger
1917 1916
 plex org concat
1918 1917
   sd length 0 drive d1
......
1938 1937
To set up mirroring, create multiple plexes in a volume.  For example, to create
1939 1938
a mirrored volume of 2 GB, you might create the following configuration file:
1940 1939
.Bd -literal -offset indent
1941
drive d1 device /dev/da2e
1942
drive d2 device /dev/da3e
1940
drive d1 device /dev/da2s0e
1941
drive d2 device /dev/da3s0e
1943 1942
volume mirror
1944 1943
 plex org concat
1945 1944
   sd length 2g drive d1
......
1960 1959
For example, to create an equivalent resilient volume of 2 GB, you might use the
1961 1960
following configuration file:
1962 1961
.Bd -literal -offset indent
1963
drive d1 device /dev/da2e
1964
drive d2 device /dev/da3e
1965
drive d3 device /dev/da4e
1966
drive d4 device /dev/da5e
1967
drive d5 device /dev/da6e
1962
drive d1 device /dev/da2s0e
1963
drive d2 device /dev/da3s0e
1964
drive d3 device /dev/da4s0e
1965
drive d4 device /dev/da5s0e
1966
drive d5 device /dev/da6s0e
1968 1967
volume raid
1969 1968
 plex org raid5 512k
1970 1969
   sd length 512m drive d1
......
1981 1980
configuration.  If you were to use the minimum of only three disks, you would
1982 1981
require 3 GB to store the information, for example:
1983 1982
.Bd -literal -offset indent
1984
drive d1 device /dev/da2e
1985
drive d2 device /dev/da3e
1986
drive d3 device /dev/da4e
1983
drive d1 device /dev/da2s0e
1984
drive d2 device /dev/da3s0e
1985
drive d3 device /dev/da4s0e
1987 1986
volume raid
1988 1987
 plex org raid5 512k
1989 1988
   sd length 1g drive d1
......
2016 2015
.Cm striped
2017 2016
plex:
2018 2017
.Bd -literal -offset indent
2019
drive d1 device /dev/da2e
2020
drive d2 device /dev/da3e
2021
drive d3 device /dev/da4e
2022
drive d4 device /dev/da5e
2018
drive d1 device /dev/da2s0e
2019
drive d2 device /dev/da3s0e
2020
drive d3 device /dev/da4s0e
2021
drive d4 device /dev/da5s0e
2023 2022
volume raid
2024 2023
 plex org striped 512k
2025 2024
   sd length 512m drive d1
......
2037 2036
.Nm
2038 2037
you can do this with the following configuration file:
2039 2038
.Bd -literal -offset indent
2040
drive d1 device /dev/da2e
2041
drive d2 device /dev/da3e
2042
drive d3 device /dev/da4e
2043
drive d4 device /dev/da5e
2039
drive d1 device /dev/da2s0e
2040
drive d2 device /dev/da3s0e
2041
drive d3 device /dev/da4s0e
2042
drive d4 device /dev/da5s0e
2044 2043
volume raid setupstate
2045 2044
 plex org striped 512k
2046 2045
   sd length 512m drive d1
......
2071 2070
.Pa configfile :
2072 2071
.Bd -literal -offset 2n
2073 2072
# vinum create -v configfile
2074
   1: drive d1 device /dev/da2e
2075
   2: drive d2 device /dev/da3e
2073
   1: drive d1 device /dev/da2s0e
2074
   2: drive d2 device /dev/da3s0e
2076 2075
   3: volume mirror
2077 2076
   4:  plex org concat
2078 2077
   5:    sd length 2g drive d1
......
2085 2084
Plexes:         2 (8 configured)
2086 2085
Subdisks:       2 (16 configured)
2087 2086

  
2088
Drive d1:       Device /dev/da2e
2087
Drive d1:       Device /dev/da2s0e
2089 2088
                Created on vinum.lemis.com at Tue Mar 23 12:30:31 1999
2090 2089
                Config last updated Tue Mar 23 14:30:32 1999
2091 2090
                Size:      60105216000 bytes (57320 MB)
......
2093 2092
                Available: 57957596672 bytes (55272 MB)
2094 2093
                State: up
2095 2094
                Last error: none
2096
Drive d2:       Device /dev/da3e
2095
Drive d2:       Device /dev/da3s0e
2097 2096
                Created on vinum.lemis.com at Tue Mar 23 12:30:32 1999
2098 2097
                Config last updated Tue Mar 23 14:30:33 1999
2099 2098
                Size:      60105216000 bytes (57320 MB)
......
2156 2155
Plexes:         4 (8 configured)
2157 2156
Subdisks:       4 (16 configured)
2158 2157

  
2159
D d1                    State: up       Device /dev/da2e        Avail: 53224/57320 MB (92%)
2160
D d2                    State: up       Device /dev/da3e        Avail: 53224/57320 MB (92%)
2158
D d1                    State: up       Device /dev/da2s0e      Avail: 53224/57320 MB (92%)
2159
D d2                    State: up       Device /dev/da3s0e      Avail: 53224/57320 MB (92%)
2161 2160

  
2162 2161
V mirror                State: up       Plexes:       4 Size:       2048 MB
2163 2162

  
......
2183 2182
already knows about.  For example, to create a volume
2184 2183
.Pa raid
2185 2184
on the four drives
2186
.Pa /dev/da1e , /dev/da2e , /dev/da3e
2185
.Pa /dev/da1s0e , /dev/da2s0e , /dev/da3s0e
2187 2186
and
2188
.Pa /dev/da4e ,
2187
.Pa /dev/da4s0e ,
2189 2188
you only need to mention the other two:
2190 2189
.Bd -literal -offset indent
2191
drive d3 device /dev/da1e
2192
drive d4 device /dev/da4e
2190
drive d3 device /dev/da1s0e
2191
drive d4 device /dev/da4s0e
2193 2192
volume raid
2194 2193
  plex org raid5 512k
2195 2194
    sd size 2g drive d1
......
2208 2207
Plexes:         5 (8 configured)
2209 2208
Subdisks:       8 (16 configured)
2210 2209

  
2211
D d1                    State: up       Device /dev/da2e        Avail: 51176/57320 MB (89%)
2212
D d2                    State: up       Device /dev/da3e        Avail: 53220/57320 MB (89%)
2213
D d3                    State: up       Device /dev/da1e        Avail: 53224/57320 MB (92%)
2214
D d4                    State: up       Device /dev/da4e        Avail: 53224/57320 MB (92%)
2210
D d1                    State: up       Device /dev/da2s0e      Avail: 51176/57320 MB (89%)
2211
D d2                    State: up       Device /dev/da3s0e      Avail: 53220/57320 MB (89%)
2212
D d3                    State: up       Device /dev/da1s0e      Avail: 53224/57320 MB (92%)
2213
D d4                    State: up       Device /dev/da4s0e      Avail: 53224/57320 MB (92%)
2215 2214

  
2216 2215
V mirror                State: down     Plexes:       4 Size:       2048 MB
2217 2216
V raid                  State: down     Plexes:       1 Size:       6144 MB
......
2458 2457
.Ux
2459 2458
disk partitions and must have the partition type
2460 2459
.Em vinum .
2461
This is different from
2462
.Xr ccd 4 ,
2463
which expects partitions of type
2464
.Em 4.2BSD .
2465
This behaviour of
2466
.Nm ccd
2467
is an invitation to shoot yourself in the foot: with
2468
.Nm ccd
2469
you can easily overwrite a file system.
2470
.Nm
2471
will not permit this.
2472 2460
.Pp
2473
For similar reasons, the
2461
The
2474 2462
.Nm Ic start
2475 2463
command will not accept a drive on partition
2476 2464
.Dq Li c .
......
2571 2559
.Nm Ic read
2572 2560
should be used for maintenance purposes only.  Note that its syntax has changed,
2573 2561
and the arguments must be disk slices, such as
2574
.Pa /dev/da0 ,
2562
.Pa /dev/da0s0 ,
2575 2563
not partitions such as
2576
.Pa /dev/da0e .
2564
.Pa /dev/da0s0e .
2577 2565
.El
2578 2566
.Sh ENVIRONMENT
2579 2567
.Bl -tag -width VINUM_DATEFORMAT
(11-11/11)