across two physical volumes, is named
stripelv
and is in volume group
testvg
. The stripe will
use sectors 0-50 of
/dev/sda1
and sectors 50-100 of
/dev/sdb1
.
# lvcreate -l 100 -i2 -nstripelv testvg /dev/sda1:0-50 /dev/sdb1:50-100
Using default stripesize 64.00 KB
Logical volume "stripelv" created
4.1.3. Creating Mirrored Volumes
When you create a mirrored volume, you specify the number of copies of the data to make with
the
-m
argument of the
lvcreate
command. Specifying
-m1
creates one mirror, which yields
two copies of the file system: a linear logical volume plus one copy. Similarly, specifying
-m2
creates two mirrors, yielding three copies of the file system.
The following command creates a mirrored logical volume with a single mirror. The volume is 50
gigabytes in size, is named
mirrorlv
, and is carved out of volume group
vg0
:
lvcreate -L 50G -m1 -n gfslv vg0
An LVM mirror divides the device being copied into regions that, by default, are 512KB in size.
You can use the
-R
argument to specify the region size in MB. LVM maintains a small log which
it uses to keep track of which regions are in sync with the mirror or mirrors. By default, this log is
kept on disk, which keeps it persistent across reboots. You can specify instead that this log be
kept in memory with the
--corelog
argument; this eliminates the need for an extra log device,
but it requires that the entire mirror be resynchronized at every reboot.
The following command creates a mirrored logical volume from the volume group
bigvg
. The
logical is named
ondiskmirvol
and has a single mirror. The volume is 12MB in size and keeps
the mirror log in memory.
# lvcreate -L 12MB -m1 --corelog -n ondiskmirvol bigvg
Logical volume "ondiskmirvol" created
When a mirror is created, the mirror regions are synchronized. For large mirror components, the
sync process may take a long time. When you are creating a new mirror that does not need to
be revived, you can specify the
nosync
argument to indicate that an initial synchronization from
the first device is not required.
You can specify which devices to use for the mirror logs and log, and which extents of the
devices to use. To force the log onto a particular disk, specify exactly one extent on the disk on
which it will be placed. LVM does not necessary respect the order in which devices are listed in
the command line. If any physical volumes are listed that is the only space on which allocation
will take place. Any physical extents included in the list that are already allocated will get
Chapter 4. LVM Administration with CLI Commands
36
Содержание GLOBAL FILE SYSTEM 5.0
Страница 1: ...LVM Administrator s Guide Configuration and Administration 5 0 ISBN N A Publication date...
Страница 4: ...LVM Administrator s Guide...
Страница 8: ...viii...
Страница 18: ...6...
Страница 28: ...16...
Страница 32: ...20...
Страница 80: ...68...
Страница 90: ...78...
Страница 92: ...80...
Страница 94: ...82...
Страница 112: ...100...