Installation guide

Table Of Contents
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 Section 3, “Recovering
from LVM 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.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) num-
ber. 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 dy-
namically.
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.3. Resizing Logical Volumes
To change the size of a logical volume, use the lvreduce command. If the logical volume con-
tains a file system, be sure to reduce the file system first (or use the LVM GUI) so that the logic-
al volume is always at least as large as the file system expects it to be.
The following command reduces the size of logical volume lvol1 in volume group vg00 by 3 lo-
gical extents.
4.2. Persistent Device Numbers
32