Archive for the tag 'Group'

SBDavid

Renaming a Volume Group

Renaming a Volume Group

Use the vgrename command to rename an existing volume group.

Either of the following commands renames the existing volume group vg02 to my_volume_group

# vgrename /dev/vg02 /dev/my_volume_group

or

# vgrename vg02 my_volume_group
SBDavid

Backing Up Volume Group Metadata

Backing Up Volume Group Metadata

Metadata backups and archives are automatically created on every volume group and logical volume configuration change unless disabled in the lvm.conf file. By default, the metadata backup is stored in the /etc/lvm/backup file and the metadata archives are stored in the /etc/lvm/archives file.

You can manually back up the metadata to the /etc/lvm/backup file with the vgcfgbackupcommand.

The vgcfrestore command restores the metadata of a volume group from the archive to all the physical volumes in the volume groups.

SBDavid

Splitting a Volume Group

Splitting a Volume Group

To split the physical volumes of a volume group and create a new volume group, use the vgsplit command.

Logical volumes cannot be split between volume groups. Each existing logical volume must be entirely on the physical volumes forming either the old or the new volume group. If necessary, however, you can use the pvmove command to force the split.

The following example splits off the new volume group vgsmall from the original volume group vgbig.

vgsplit bigvg vgsmall /dev/disk1
Volume group “vgsmall” successfully split from “vgbig”

vgchange - change attributes of a volume group
vgchange allows you to change the attributes of one or more volume groups. Its main purpose is to activate and deactivate VolumeGroupName, or all volume groups if none is specified. Only active volume groups are subject to changes and allow access to their logical volumes.

During volume group activation, if vgchange recognizes snapshot logical volumes which were dropped because they ran out of space, it displays a message informing the administrator that such snapshots should be removed.
EXAMPLES
To activate all known volume groups in the system:

vgchange -a y

To change the maximum number of logical volumes of inactive volume group vg00 to 128.

vgchange -l 128 /dev/vg00

Removing Physical Volumes from a Volume Group

To remove unused physical volumes from a volume group, use the vgreduce command. The vgreduce command shrinks a volume group’s capacity by removing one or more empty physical volumes. This frees those physical volumes to be used in different volume groups or to be removed from the system.

Before removing a physical volume from a volume group, you can make sure that the physical volume is not used by any logical volumes by using the pvdisplay command.

# pvdisplay /dev/hda1

If the physical volume is still being used you will have to migrate the data to another physical volume using the pvmove command. Then use the vgreduce command to remove the physical volume:

The following command removes the physical volume /dev/hda1 from the volume group my_volume_group.

# vgreduce my_volume_group /dev/hda1

Next »