vinum
maintains a
configuration database which describes the
objects known to an individual system. Initially, the user
creates the configuration database from one or more
configuration files using gvinum(8).
vinum
stores a copy of its
configuration database on each disk
device under its control. This database is
updated on each state change, so that a restart accurately
restores the state of each
vinum
object.
The configuration file describes individual
vinum
objects. The definition of a
simple volume might be:
This file describes four vinum
objects:
The drive line describes a disk partition (drive) and its location relative to the underlying hardware. It is given the symbolic name a. This separation of symbolic names from device names allows disks to be moved from one location to another without confusion.
The volume line describes a volume. The only required attribute is the name, in this case myvol.
The plex line defines a plex. The only required parameter is the organization, in this case concat. No name is necessary as the system automatically generates a name from the volume name by adding the suffix .px, where x is the number of the plex in the volume. Thus this plex will be called myvol.p0.
The sd line describes a subdisk.
The minimum specifications are the name of a drive on
which to store it, and the length of the subdisk. No name
is necessary as the system automatically assigns names
derived from the plex name by adding the suffix
.sx, where
x is the number of the subdisk in
the plex. Thus vinum
gives this
subdisk the name myvol.p0.s0.
After processing this file, gvinum(8) produces the following output:
#
gvinum -> create config1
Configuration summary
Drives: 1 (4 configured)
Volumes: 1 (4 configured)
Plexes: 1 (8 configured)
Subdisks: 1 (16 configured)
D a State: up Device /dev/da3h Avail: 2061/2573 MB (80%)
V myvol State: up Plexes: 1 Size: 512 MB
P myvol.p0 C State: up Subdisks: 1 Size: 512 MB
S myvol.p0.s0 State: up PO: 0 B Size: 512 MBThis output shows the brief listing format of
gvinum(8). It is represented graphically in Figure 22.4, “A Simple vinum
Volume”.
This figure, and the ones which follow, represent a volume, which contains the plexes, which in turn contains the subdisks. In this example, the volume contains one plex, and the plex contains one subdisk.
This particular volume has no specific advantage over a conventional disk partition. It contains a single plex, so it is not redundant. The plex contains a single subdisk, so there is no difference in storage allocation from a conventional disk partition. The following sections illustrate various more interesting configuration methods.
The resilience of a volume can be increased by mirroring. When laying out a mirrored volume, it is important to ensure that the subdisks of each plex are on different drives, so that a drive failure will not take down both plexes. The following configuration mirrors a volume:
In this example, it was not necessary to specify a
definition of drive a again, since
vinum
keeps track of all objects in
its configuration database. After processing this definition,
the configuration looks like:
Figure 22.5, “A Mirrored vinum
Volume” shows the
structure graphically.
In this example, each plex contains the full 512 MB of address space. As in the previous example, each plex contains only a single subdisk.
The mirrored volume in the previous example is more resistant to failure than an unmirrored volume, but its performance is less as each write to the volume requires a write to both drives, using up a greater proportion of the total disk bandwidth. Performance considerations demand a different approach: instead of mirroring, the data is striped across as many disk drives as possible. The following configuration shows a volume with a plex striped across four disk drives:
As before, it is not necessary to define the drives which
are already known to vinum
. After
processing this definition, the configuration looks
like:
This volume is represented in Figure 22.6, “A Striped vinum
Volume”. The darkness of the
stripes indicates the position within the plex address space,
where the lightest stripes come first and the darkest
last.
With sufficient hardware, it is possible to build volumes which show both increased resilience and increased performance compared to standard UNIX® partitions. A typical configuration file might be:
The subdisks of the second plex are offset by two drives from those of the first plex. This helps to ensure that writes do not go to the same subdisks even if a transfer goes over two drives.
Figure 22.7, “A Mirrored, Striped vinum
Volume” represents the
structure of this volume.
This, and other documents, can be downloaded from http://ftp.FreeBSD.org/pub/FreeBSD/doc/
For questions about FreeBSD, read the
documentation before
contacting <questions@FreeBSD.org>.
For questions about this documentation, e-mail <doc@FreeBSD.org>.