Persistent Device Numbers; Resizing Logical Volumes - Red Hat ENTERPRISE LINUX 5.1 - LVM ADMINISTRATION Manual

Table of Contents

Advertisement

Chapter 4. LVM Administration with CLI Commands
lvcreate -L 500M -m1 -n mirrorlv vg0 /dev/sda1:0-499 /dev/sdb1:0-499 /
dev/sdc1:0
4.4.1.4. Changing Mirrored Volume Configuration
You can convert a logical volume from a mirrored volume to a linear volume or from a linear volume
to a mirrored volume with the lvconvert command. You can also use this command to reconfigure
other mirror parameters of an existing logical volume, such as corelog.
When you convert a logical volume to a mirrored volume, you are basically creating mirror legs for an
existing volume. This means that your volume group must contain the devices and space for the mirror
legs and for the mirror log.
If you lose a leg of a mirror, LVM converts the volume to a linear volume so that you still have access
to the volume, without the mirror redundancy. After you replace the leg, you can use the lvconvert
command to restore the mirror. This procedure is provided in
Mirror
Failure".
The following command converts the linear logical volume vg00/lvol1 to a mirrored logical volume.
lvconvert -m1 vg00/lvol1
The following command converts the mirrored logical volume vg00/lvol1 to a linear logical volume,
removing the mirror leg.
lvconvert -m0 vg00/lvol1

4.4.2. Persistent Device Numbers

Major and minor device numbers are allocated dynamically at module load. Some applications work
best if the block device always is activated with the same device (major and minor) number. You can
specify these with the lvcreate and the lvchange commands by using the following arguments:
--persistent y --major major --minor minor
Use a large minor number to be sure that it hasn't already been allocated to another device
dynamically.
If you are exporting a file system using NFS, specifying the fsid parameter in the exports file may
avoid the need to set a persistent device number within LVM.

4.4.3. Resizing Logical Volumes

To change the size of a logical volume, use the lvreduce command. If the logical volume contains a
file system, be sure to reduce the file system first (or use the LVM GUI) so that the logical volume is
always at least as large as the file system expects it to be.
30
Section 6.3, "Recovering from LVM

Advertisement

Table of Contents
loading

This manual is also suitable for:

Enterprise linux 5.1 cluster logical volume manager

Table of Contents