Physical Volume in AIX is a hard drive with special characteristics which are useful for LVM(Logical Volume Control). So, if any hard drive is to be used for LVM purpose, it needs to be made as Physical Volume. Physical Volume has several properties which differentiate it from normal hard drive. These are listed as below:
- It has 16 digit unique identifier. This is called Physical Volume Identifier(PVID). Without this Physical Volume can not be used under LVM.
- The properties of Physical Volume can be changed on the fly.
- Physical Volume can be made available or unavailable to a Volume Group through command line or smitty.
- Physical Volume can be set to removed state through command line.
- Its possible to list characteristics of Physical Volume using command line or smitty.
- Physical Volume can be converted to normal hard drive through command line. InÂ that case it can not be used under Logical Volume and all data will be lost.
- Physical Volume allows us to specify, where exactly on Physical Volume to store the data.
- Use of Physical Volume is transparent to Logical Volumes under Volume Group.
How To Configure A Hard Drive As Physical Volume
The hard drive can be configured as Physical Volume in the following ways:
- Restart the server. The command cfgmgr is used during boot stage. So, Physical Volume is configured.
- Run cfgmgr command. In this case you don’t need to reboot server.
- Run the command:
mkdev -c disk -s scsi -t 22000mb -p scsi3 -w 6,0 -a pv=yes
-sÂ Â Â Â Â Â Â Â Subclass under disk.
-tÂ Â Â Â Â Â Â Â Â Type of disk
-pÂ Â Â Â Â Â Â Â Parent name of device.
-wÂ Â Â Â Â Â Â Where the device is connected.
-a pvÂ Â Â Setting this attribute to yes makes the hard drive a Physical Volume.
Setting Already available disk as Physical Volume
Let’s say the disk available is hdisk2. So, change the attribute pv to yes. The command used is chpv as follows:
chdev -l hdisk2 -a pv=yes
Setting Allocation Permissions on A Physical Volume
Logical Volume can allocate Physical Partitions from a Physical Volume only if it has allocation permissions on that Physical Volume. If no allocation permissions are there, it can not allocate Physical Partitions from that Physical Volume. We’ll take hdisk2 as an example of a Physical Volume. Following is the way to set allocation permissions:
chpv -a y hdisk2
If you want to remove allocation permissions then use:
chpv -a n hdisk2
Setting Availability of A Physical Volume
Physical Volume is said to be available if Logical input or output operations can be carried out on Physical Volume. Normally Physical Volumes are made unavailable before removing them from VG or system. Again chpv comes handy.
To set Physical Volume as unavailable: Â Â Â Â Â Â Â Â chpv -v Â Â r Â Â hdisk2
This is also called closing a PV.
To make it available: Â Â Â Â Â Â Â Â Â Â Â Â Â chpvÂ -v Â Â aÂ Â hdisk2
This is also called opening a PV.
Clearing The Boot Record of Physical Volume
Physical Volume’s boot record can be cleared as: Â Â Â Â chpv -cÂ Â hdisk2
Resetting The PVID of Physical Volume
Physical Volume’s PVID can be cleared as: Â chdev -a Â Â Â pv=clearÂ Â hdisk2
RemovingÂ A Physical Volume
Physical Volume can be removed from system as follows: rmdevÂ Â Â -lÂ Â hdisk2
In this case the entries are still there in ODM.
To remove it completely from system use -d flag as follows:
rmdevÂ Â Â Â Â Â Â -lÂ Â Â Â Â Â -dÂ Â Â Â Â hdisk2
The above command removes the Physical Volume from system and ODM as well.