
1.
Split the logical volume
/dev/vg00/lvol1
into two separate logical volumes as follows:
# lvsplit /dev/vg00/lvol1
This creates the new logical volume
/dev/vg00/lvol1b
. The original logical volume
/dev/
vg00/lvol1
remains online.
2.
Perform a file system consistency check on the logical volume to be backed up as follows:
# fsck /dev/vg00/lvol1b
3.
Mount the file system as follows:
# mkdir /backup_dir
# mount /dev/vg00/lvol1b /backup_dir
4.
Perform the backup using the utility of your choice.
5.
Unmount the file system as follows:
# umount /backup_dir
6.
Merge the split logical volume back with the original logical volume as follows:
# lvmerge /dev/vg00/lvol1b /dev/vg00/lvol1
NOTE:
lvsplit
is not supported on snapshot logical volumes.
lvmerge
is not supported for
snapshots as well as logical volumes having snapshots.
Backing Up and Restoring Volume Group Configuration
It is important that volume group configuration information be saved whenever you make any
change to the configuration such as:
•
Adding or removing disks to a volume group
•
Changing the disks in a root volume group
•
Creating or removing logical volumes
•
Extending or reducing logical volumes
Unlike fixed disk partitions or nonpartitioned disks that begin and end at known locations on a
given disk, each volume group configuration is unique, changes, and uses space on several disks.
If you back up your volume group configuration, you can restore a corrupted or lost LVM
configuration in the event of a disk failure or corruption of your LVM configuration information.
The
vgcfgbackup
command creates or updates a backup file containing the volume group
configuration; it does not back up the data within your logical volumes. To simplify the backup
process,
vgcfgbackup
is invoked automatically whenever you make a configuration change as
a result of using any of the following commands:
lvmerge
lvlnboot
lvextend
lvcreate
lvchange
vgcreate
lvsplit
lvrmboot
lvremove
lvreduce
vgmodify
vgextend
vgchange
1
pvmove
pvchange
vgreduce
1
For volume group Version 2.2 and higher, the
vgchange
command automatically takes a backup of the volume group
configuration during deactivation, provided they are not activated in read-only mode. In all earlier versions, there is
no automatic backup when
vgchange
is used.
When snapshots are involved, the volume group configuration changes with respect to the snapshot data unsharing
while writes are occurring on the snapshot tree. So, it is recommended that the automatic backup of the volume group
configuration not be overridden by the
—A n
option during volume group deactivation.
You can display LVM configuration information previously backed up with
vgcfgbackup
or
restore it using
vgcfgrestore
.
Common LVM Tasks
69