Red Hat ENTERPRISE LINUX 5 - LOGICAL VOLUME MANAGER ADMINISTRATION Manual page 46

Hide thumbs Also See for ENTERPRISE LINUX 5 - LOGICAL VOLUME MANAGER ADMINISTRATION:
Table of Contents

Advertisement

Chapter 4. LVM Administration with CLI Commands
of 2, using that number as the -R argument to the lvcreate command. For example,
if your mirror size is 1.5TB, you could specify -R 2. If your mirror size is 3TB, you could
specify -R 4. For a mirror size of 5TB, you could specify -R 8.
The following command creates a mirrored logical volume with a region size of 2MB:
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
The mirror log is created on a separate device from the devices on which any of the mirror legs are
created. It is possible, however, to create the mirror log on the same device as one of the mirror
legs by using the --alloc anywhere argument of the vgcreate command. This may degrade
performance, but it allows you to create a mirror even if you have only two underlying devices.
The following command creates a mirrored logical volume with a single mirror for which the mirror
log is on the same device as one of the mirror legs. In this example, the volume group vg0 consists
of only two devices. This command creates a 500 megabyte volume named mirrorlv in the vg0
volume group.
lvcreate -L 500M -m1 -n mirrorlv -alloc anywhere vg0
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 ignored.
The following command creates a mirrored logical volume with a single mirror. The volume is 500
megabytes in size, it is named mirrorlv, and it is carved out of volume group vg0. The first leg of
the mirror is on device /dev/sda1, the second leg of the mirror is on device /dev/sdb1, and the
mirror log is on /dev/sdc1.
34
lvcreate -m1 -L 2T -R 2 -n mirror vol_group

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ENTERPRISE LINUX 5 - LOGICAL VOLUME MANAGER ADMINISTRATION and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Table of Contents