Unix Study-- AIX deletes physical volumes in a volume group
Unix Study-- AIX deletes physical volumes in a volume group
System environment:
Operating system: AIX 5300-08
Case study:
Delete pv (hdisk2) from rootvg:
[root@aix195: /] $lsvg-p rootvg
Rootvg:
PV_NAME PV STATE TOTAL PPs FREE PPs FREE DISTRIBUTION
Hdisk0 active 550 249 109..00..00..30..110
Hdisk2 active 319 260 64..64..04..64..64
Delete via smit:
[root@aix195: /] $smit reducevg
The following error message appears:
0516-016 ldeletepv: Cannot delete physical volume with allocated
Partitions. Use either migratepv to move the partitions or
Reducevg with the-d option to delete the partitions.
0516-884reducevg: Unable to remove physical volume hdisk2.
Delete through the reducevg tool:
[root@aix195: /] $reducevg
0516-606 reducevg: Volume group name not entered.
Usage: reducevg [- d] [- f] VGname PVname...
Reduces volume group size by removing a physical volume.
[root@aix195: /] $reducevg-d rootvg hdisk2
Tip: there are logical volumes on the pv of hdisk2
0516-914 rmlv: Warning, all data belonging to logical volume
Paging00 on physical volume hdisk2 will be destroyed.
Rmlv: Do you wish to continue? Y (es) n (o)?
N
0516-914 rmlv: Warning, all data belonging to logical volume
Paging01 on physical volume hdisk2 will be destroyed.
Rmlv: Do you wish to continue? Y (es) n (o)?
0516-914 rmlv: Warning, all data belonging to logical volume
Paging02 on physical volume hdisk2 will be destroyed.
Rmlv: Do you wish to continue? Y (es) n (o)?
0516-016 ldeletepv: Cannot delete physical volume with allocated
Partitions. Use either migratepv to move the partitions or
Reducevg with the-d option to delete the partitions.
0516-884reducevg: Unable to remove physical volume hdisk2.
View the system page swap space:
[root@aix195: /] $lsps-a
Page Space Physical Volume Volume Group Size Used Active Auto Type
Paging02 hdisk2 rootvg 1792MB 1 yes yes lv
Paging01 hdisk2 rootvg 1792MB 1 yes yes lv
Paging00 hdisk2 rootvg 192MB 1 yes yes lv
Hd6 hdisk0 rootvg 320MB 1 yes yes lv
-paging00,01,02 is the later added page space, whose logical volume is built on the PV of hdisk2
Close paging00, 01, 02:
[root@aix195: /] $swapoff / dev/paging00
[root@aix195: /] $swapoff / dev/paging01
[root@aix195: /] $swapoff / dev/paging02
Delete paging00, 01, 02 logical volumes through smit
[root@aix195: /] $lsps-a
Page Space Physical Volume Volume Group Size Used Active Auto Type
Hd6 hdisk0 rootvg 2048MB 1 yes yes lv
Before deleting the PV of the volume group through reducevg:
[root@aix195: /] $lsvg-p rootvg
Rootvg:
PV_NAME PV STATE TOTAL PPs FREE PPs FREE DISTRIBUTION
Hdisk0 active 550 222 82..00..00..30..110
Hdisk2 active 319 319 64..64..63..64..64
[root@aix195: /] $reducevg-d rootvg hdisk2
Deleted successfully:
[root@aix195: /] $lsvg-p rootvg
Rootvg:
PV_NAME PV STATE TOTAL PPs FREE PPs FREE DISTRIBUTION
Hdisk0 active 550 222 82..00..00..30..110
[root@aix195: /] $lspv
Hdisk0 000bf7bdcd61dd0a rootvg active
Hdisk1 00434bbc952e964d None
Hdisk2 000bf7bd1ed7cab8 None