Tuesday, January 5, 2010

LVM - Physical Volume

Naming Convention:

Here is a set of examples for pv naming convention.

/dev/disk/disk1 - Persistent block device file for disk1

/dev/disk/disk1_p1 - Persistent block device file for partition 2 belonging to disk1

/dev/rdisk/disk1 - Persistent character/raw device file for disk1

/dev/rdisk/disk1 - Persistent character/raw device file for partition 2 belonging to disk1

/dev/dsk/c1t1d1 - Legacy block device file for disk1 located in target 1 of controller 1

/dev/dsk/c1t1d1s1 - Legacy block device file for the partition 1 belonging to the above disk

/dev/rdsk/c1t1d1 - Legacy character/raw device file for disk1 located in target 1 of controller 1

/dev/rdsk/c1t1d1s1 - Legacy character/raw device file for the partition 1 belonging to the above disk

Here are the mostly used commands for managing PV's :

To create a PV:
# pvcreate

To change the characteristics :
# pvchange

To display the info on PV :
# pvdisplay

To move data between PVs :
# pvmove

To remove a PV from LVM control :
# pvremove

To check or repair a PV :
# pvck

To check if a disk is under LVM control :
# lvmchk

Few Examples,

1. To initialize a disk for LVM [ To create a PV out of a disk] :

# pvcreate /dev/rdisk/disk12

2. To initialize a disk for LVM to use as a boot device :

# pvcreate -B /dev/rdisk/disk2_p2

3. To display the properties of a PV :

# pvdisplay /dev/disk/disk12

4. To display the detailed properties of a PV :

# pvdisplay -v /dev/disk/disk12

5. To move the data between PVs :

# pvmove /dev/disk/disk12:2 /dev/disk/disk13

No comments:

Post a Comment