Installation guide
Table Of Contents
- LVM Administrator's Guide
- Table of Contents
- Introduction
- Chapter 1. The LVM Logical Volume Manager
- Chapter 2. LVM Components
- Chapter 3. LVM Administration Overview
- Chapter 4. LVM Administration with CLI Commands
- 1. Using CLI Commands
- 2. Physical Volume Administration
- 3. Volume Group Administration
- 3.1. Creating Volume Groups
- 3.2. Adding Physical Volumes to a Volume Group
- 3.3. Displaying Volume Groups
- 3.4. Scanning Disks for Volume Groups to Build the Cache File
- 3.5. Removing Physical Volumes from a Volume Group
- 3.6. Changing the Parameters of a Volume Group
- 3.7. Activating and Deactivating Volume Groups
- 3.8. Removing Volume Groups
- 3.9. Splitting a Volume Group
- 3.10. Combining Volume Groups
- 3.11. Backing Up Volume Group Metadata
- 3.12. Renaming a Volume Group
- 3.13. Moving a Volume Group to Another System
- 3.14. Recreating a Volume Group Directory
- 4. Logical Volume Administration
- 4.1. Creating Logical Volumes
- 4.2. Persistent Device Numbers
- 4.3. Resizing Logical Volumes
- 4.4. Changing the Parameters of a Logical Volume Group
- 4.5. Renaming Logical Volumes
- 4.6. Removing Logical Volumes
- 4.7. Displaying Logical Volumes
- 4.8. Growing Logical Volumes
- 4.9. Extending a Striped Volume
- 4.10. Shrinking Logical Volumes
- 5. Creating Snapshot Volumes
- 6. Controlling LVM Device Scans with Filters
- 7. Online Data Relocation
- 8. Activating Logical Volumes on Individual Nodes in a Cluster
- 9. Customized Reporting for LVM
- Chapter 5. LVM Configuration Examples
- Chapter 6. LVM Troubleshooting
- Chapter 7. LVM Administration with the LVM GUI
- Appendix A. The Device Mapper
- Appendix B. The LVM Configuration Files
- Appendix C. LVM Object Tags
- Appendix D. LVM Volume Group Metadata
- Index

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