I’ve written in my previous posts about introduction to Physical Volumes. There I also discussed some operations to be carried out on Physical Volumes. Now, I’ll be discussing some other operations on Physical Volumes like listing Physical Volumes, Logical Volumes on Physical Volumes, Physical Partitions allocations etc. For more information you can see the previous article: Aix Logical Volume Manager A Brief Introduction.
How To List Physical Volumes In Aix
To list Physical Volumes in Aix lspv command is used. This command gives the output as name of Physical Volume, its identifier which is a 16 character serial number, the Volume Group to which it belongs and the state of the physical volume whether its active or not. The identifier is also called PVID. Below is the command:
wiw_labs:$ lspv
hdisk0 034cd34d03b25531 altinst_rootvg
hdisk1 034cd34d7533e52b altinst_rootvg
hdisk2 034cd34d753ca221 rootvg active
hdisk3 034cd34d753ca5a8 rootvg active
How To List Connectivity Information of Physical Volume
To see the connectivity information of a Physical Volume you need to issue lsdev command. Here is how you issue this command:
wiw_labs:$ lsdev -C -c disk
hdisk0 Available 23-06-00-6,0 16 Bit LVD SCSI Disk Drive
hdisk1 Available 3p-06-00-6,0 16 Bit LVD SCSI Disk Drive
hdisk2 Available 4b-06-00-6,0 16 Bit LVD SCSI Disk Drive
hdisk3 Available 5M-06-00-6,0 16 Bit LVD SCSI Disk Drive
-C: Device Class
-c: Device subclass(disk in this case)
Here you see the name of the disk, the status of the disk(available), its connectivity information and type of the disk.
How To List Overall Information About A Physical Volume
To see the overview of a physical volume let’s say hdisk2, we issue the command lspv with hdisk2 as argument as below:
wiw_labs:$ lspv hdisk2
PHYSICAL VOLUME | hdisk2 | VOLUME GROUP | rootvg |
PV IDENTIFIER | 002cd34d753ca221 | VG IDENTIFIER 002cd34d00004c000000010cfa6a1c1e | |
PV STATE | active | ||
STALE PARTITIONS | 0 | ALLOCATABLE | yes |
PP SIZE | 64 megabyte(s) | LOGICAL VOLUMES | 11 |
TOTAL PPs | 542 (34688 megabytes) | VG DESCRIPTORS | 2 |
FREE PPs | 258 (16512 megabytes) | HOT SPARE | no |
USED PPs | 284 (18176 megabytes) | MAX REQUEST | 256 kilobytes |
FREE DISTRIBUTION | 28..13..00..108..109 | ||
USED DISTRIBUTION | 81..95..108..00..00 |
*(Verify the distribution parameters by adding the PPs in a particular region and then check in overall information.)
The above command gives information about name, state, ID, Physical Partition Size, No of PP, Free and used PP, distribution of PPs, VG, allocatability and other parameters.
How To See What Logical Volumes Are Present On Physical Volume
To see the Logical Volume information on a Physical Volumes, you need to issue the command lspv with -l(logical volume) option. This gives information of Logical Volume name, no. of Logical Partitions in LV, No. of Physical Volume, the allocation distribution and mount point. Here is an example output:
wiw_labs:$ lspv -l hdisk2
LV NAME | LPs | PPs | DISTRIBUTION | MOUNT POINT |
hd10opt |
2 |
2 |
00..01..01..00..00 | /opt |
hd9var |
39 |
39 |
00..05..34..00..00 | /var |
hd2 |
55 |
55 |
00..04..51..00..00 | /usr |
hd1 |
1 |
1 |
00..00..01..00..00 | /home |
hd3 |
32 |
32 |
00..20..12..00..00 | /tmp |
hd6 |
64 |
64 |
00..64..00..00..00 | N/A |
hd5 |
1 |
1 |
01..00..00..00..00 | N/A |
hd4 |
8 |
8 |
00..00..08..00..00 | / |
hd8 |
1 |
1 |
00..00..01..00..00 | N/A |
hd7 |
80 |
80 |
80..00..00..00..00 | N/A |
loglv00 |
1 |
1 |
00..01..00..00..00 | N/A |
How To See Physical Partition Information of Physical Volume
To see the Physical Partition information of a particular Physical Volume, you need to issue lspv command with -p flag.
wiw_labs:$ lspv -p hdisk2
PP RANGE | STATE | REGION | LV NAME | TYPE | MOUNT POINT |
1-1 | used | outer edge | hd5 | boot | N/A |
2-29 | free | outer edge | |||
30-109 | used | outer edge | hd7 | sysdump | N/A |
110-173 | used | outer middle | hd6 | paging | N/A |
174-174 | used | outer middle | loglv00 | jfslog | N/A |
175-187 | free | outer middle | |||
188-188 | used | outer middle | hd10opt | jfs2 | /opt |
189-192 | used | outer middle | hd2 | jfs2 | /usr |
193-212 | used | outer middle | hd3 | jfs2 | /tmp |
213-217 | used | outer middle | hd9var | jfs2 | /var |
218-218 | used | center | hd8 | jfs2log | N/A |
219-226 | used | center | hd4 | jfs2 | / |
227-277 | used | center | hd2 | jfs2 | /usr |
278-288 | used | center | hd9var | jfs2 | /var |
289-300 | used | center | hd3 | jfs2 | /tmp |
301-301 | used | center | hd1 | jfs2 | /home |
302-302 | used | center | hd10opt | jfs2 | /opt |
303-325 | used | center | hd9var | jfs2 | /var |
326-433 | free | inner middle | |||
434-542 | free | inner edge |
PP Range: Tells about Physical Partitions being used.
State: Whether PP is used or free.
Region: Where the PP is located on disk: outer edge, outer middle, center, inner middle or inner edge.
LV: Which Logical Volume is using these PPs.
Type: What type of Logical volume is there like boot, sysdump, jfs2, jfslog, paging etc.
Mount Point: It’s the mount point where a particular LV is mounted.
How To Determine Which Physical Partition is Mapped To Which Logical Partition
To determine the partition mapping from PP to LP, you need to issue lspv command with -M option. Let’s see the output below:
wiw_labs:$ lspv -M hdisk2
hdisk2:1 | hd5:1:1 |
hdisk2:2-29 | |
hdisk2:30 | hd7:1 |
hdisk2:31 | hd7:2 |
hdisk2:32 | hd7:3 |
hdisk2:33 | hd7:4 |
hdisk2:34 | hd7:5 |
hdisk2:35 | hd7:6 |
hdisk2:36 | hd7:7 |
hdisk2:37 | hd7:8 |
The output is truncated, because of space considerations.
The output shows which Physical Partition on hdisk2 is mapped to which Logical Partition on a Logical Volume.