Logical Volume Manager – LVM Configuration,pvcreate,vgdisplay,vgscan,lvcreate

What is  Logical Volume Manager ?

HP-UX LVM is used to manage disk space with special features like mirroring, high availability, stripping, etc. Physical volumes can be organized into a logical volume groups with equal size extent.

Each volume group can have one or more physical volumes. A system can have more than single volume groups. A volume group can be moved from a system to another instead of physical disk.

A volume group can be divided into virtual disks, called logical volumes. A logical volume can span a number of physical volumes or represent only a portion of one physical volume. Disks can be added into logical volumes with different sizes.

The following commands are used to create, display and manipulate the LVM:

1. pvcreate

Creates physical volume to use in logical volume group.

Syntax:  pvcreate -f /dev/rdsk/c2tod1

2. pvdisplay

Displays information about physical volumes in LVM volume group.

Syntax:  pvdisplay /dev/dsk/c2tod1

3. pvmove

Move allocated physical extents frm one LVM physcal volume to another.

Syntax:  pvmove /dev/dsk/c1t0d0 PVG0

4. vgcreate

Creates LVM volume group.

Syntax:  Create a directory for volume group. 

mkdir /dev/vg00 

vgcreate -s 2 /dev/vg00 /dev/dsk/c1t0d0

5. vgdisplay

Display information about LVM volume groups.

Syntax:  vgdisplay -v /dev/vg00

6. vgexport

Export an LVM volume group and its associated logical volumes.

Syntax:  vgexport -v -f vg00.outfile /dev/vg00

7. vgimport

Import an LVM volume group onto the system.

Syntax: vgimport -v /dev/vg00 /dev/dsk/c0t1d0

8. vgextend

Extend an LVM volume group by adding physical volumes.

Syntax:  vgextend /dev/vg00 /dev/dsk/c0t1d0

9. vgreduce

Remove physical volumes from an LVM volume group.

Syntax:  vgreduce /dev/vg00 /dev/dsk/c0t1d0

10. vgremove

Remove LVM logical volume group from system.

Syntax:  vgremove /dev/vg00 /dev/dsk/c0t1d0

11. vgscan

Scans physcal volumes for LVM volume group.

Syntax: vgscan

12. lvcreate

Creates logical volume in LVM volume group.

Syntax: 

lvcreate -L 100 /dev/vg03

13.  lvdisplay

Displays information about logical volumes .

lvdisplay /dev/vg00

14. lvextend

Increase space,mirrors for logical volumes.

lvextend -L 400 /dev/vg03

15.  lvreduce

Reduce number of physical extents, mirrors.

lvreduce -L 50 /dev/vg03

16. lvremove

Remove one or more logical volumes from system.

lvremove -f /dev/vg03

17. lvlnboot

Prepare LVM logical volume to be root, boot, primary swap, or dump volume.

lvlnboot -r /dev/vg00

18. lvrmboot

Remove logical volume link to root, primary swap, or dump volume.

lvrmboot -r /dev/vg00

Regards,
R.Gopinath

Tell a friend

Leave a Reply

Security Code: