Red Hat LVM ADMINISTRATOR FOR RHEL 4.5 Administrator's Manual page 48

Lvm administrator's guide for rhel 4.5
Table of Contents

Advertisement

Chapter 4. LVM Administration with CLI Commands
across two physical volumes, is named
use sectors 0-50 of
/dev/sda1
# 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
argument of the
-m
two copies of the file system: a linear logical volume plus one copy. Similarly, specifying
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
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
argument to specify the region size in MB. LVM maintains a small log which
-R
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
but it requires that the entire mirror be resynchronized at every reboot.
The following command creates a mirrored logical volume from the volume group
logical is named
ondiskmirvol
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
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
36
stripelv
and sectors 50-100 of
command. Specifying
lvcreate
, and is carved out of volume group
mirrorlv
argument; this eliminates the need for an extra log device,
--corelog
and has a single mirror. The volume is 12MB in size and keeps
argument to indicate that an initial synchronization from
nosync
and is in volume group
.
/dev/sdb1
creates one mirror, which yields
-m1
. The stripe will
testvg
-m2
:
vg0
. The
bigvg

Advertisement

Table of Contents
loading

This manual is also suitable for:

Configuration and administration 4.5

Table of Contents