Monday, September 7, 2009

Physical Volume

Physical Volume:

You can create PV on a hard disk or partiiosn (of type '8e' / Linux LVM)

To initialize a PV on a partition:
# pvcreate /dev/sdb1

To initialize multiple PVs:
# pvcreate /dev/sdb1 /dev/sdb2 /dev/sdb3

To forcibly initialize a PV on a disk :
# pvcreate -f /dev/sdb

Above command initializes a PV by putting a volume group descriptor area a.k.a VGDA at the start of the PV

To show the information about a PV:
# pvdisplay /dev/sdb1

To report information about PVs:
# pvs

To scan all disks for Physical volumes:
# pvscan

To scan/show PVs only for exported VGs:
# pvscan -e

To scan/show PVs not belonging to any VG:
# pvscan -n

To expand a PV after enlarging the partition with fdisk:
# pvresize /dev/sdb1

To shrink a PV on a partition prior to shrinking the partition with fdisk:
# pvresize --setphysicalvolumesize 40G /dev/sdb1

To view PEs:
# pvdata -E /dev/vg1/lv1

To move PEs between PVs :
# pvmove -n lv1 /dev/sdd1 /dev/sdd2

No comments: