This example is removing the mapping from VIO to LPAR that is being decommissioned.
Access LPAR to determine the mapping information:
[root@ret4a139v:~] # lsvg
rootvg
From this output we see there is only one volume group called rootvg. Below we will list the logical volumes inside the rootvg volume group and see how they are mounted.
[root@ret4a139v:~] # lsvg -l rootvg
rootvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
hd5 boot 1 1 1 closed/syncd N/A
hd6 paging 128 128 1 open/syncd N/A
hd8 jfs2log 1 1 1 open/syncd N/A
hd4 jfs2 16 16 1 open/syncd /
hd2 jfs2 56 56 1 open/syncd /usr
hd9var jfs2 48 48 1 open/syncd /var
hd3 jfs2 32 32 1 open/syncd /tmp
hd1 jfs2 32 32 1 open/syncd /home
hd10opt jfs2 64 64 2 open/syncd /opt
hd11admin jfs2 1 1 1 open/syncd /admin
dump01 sysdump 32 32 1 open/syncd N/A
livedump jfs2 8 8 1 open/syncd /var/adm/ras/livedump
locallv jfs2 16 16 1 open/syncd /usr/local
rootlv jfs2 16 16 1 open/syncd /root
lv1msb01 jfs2 240 240 1 open/syncd /mksysb_dir
lv1esm01 jfs2 32 32 1 open/syncd /opt/esm
lv1tiv01 jfs2 48 48 1 open/syncd /opt/Tivoli
lv1oov01 jfs2 32 32 1 open/syncd /opt/openv
paging00 paging 128 128 1 open/syncd N/A
[root@ret4a139v:~] # lsfs
Name Nodename Mount Pt VFS Size Options Auto Accounting
/dev/hd4 -- / jfs2 2097152 -- yes no
/dev/hd1 -- /home jfs2 4194304 -- yes no
/dev/hd2 -- /usr jfs2 7340032 -- yes no
/dev/hd9var -- /var jfs2 6291456 -- yes no
/dev/hd3 -- /tmp jfs2 4194304 -- yes no
/dev/hd11admin -- /admin jfs2 131072 -- yes no
/proc -- /proc procfs -- -- yes no
/dev/hd10opt -- /opt jfs2 8388608 -- yes no
/dev/livedump -- /var/adm/ras/livedump jfs2 1048576 -- yes no
/dev/locallv -- /usr/local jfs2 2097152 -- yes no
/dev/rootlv -- /root jfs2 2097152 -- yes no
/dev/lv1msb01 -- /mksysb_dir jfs2 31457280 -- yes no
/dev/lv1esm01 -- /opt/esm jfs2 4194304 -- yes no
/dev/lv1tiv01 -- /opt/Tivoli jfs2 6291456 -- yes no
/dev/lv1oov01 -- /opt/openv jfs2 4194304 -- yes no
Now we can remove the mount points and logical volumes using rmfs command:
#for i in /opt/openv /opt/Tivoli /opt/esm /mksysb_dir /usr/local /root /var/adm/ras/livedump /opt /admin /tmp /var /usr /home; do rmfs -r $i; done
At this point we need to find out the vscsi slot number to identify the vhost on the VIO server. We will list the adapters then show the config for the vscsi on the LPAR. Then take the slot number and find the vhost on the VIO server on the same slot.
From the LPAR:
[root@ret4a139v:~] # lsdev -c adapter
ent0 Available Virtual I/O Ethernet Adapter (l-lan)
ent1 Available Virtual I/O Ethernet Adapter (l-lan)
fcs0 Available 00-00 4Gb FC PCI Express Adapter (df1000fe)
fcs1 Available 00-01 4Gb FC PCI Express Adapter (df1000fe)
fcs2 Available 02-00 4Gb FC PCI Express Adapter (df1000fe)
fcs3 Available 02-01 4Gb FC PCI Express Adapter (df1000fe)
fcs4 Available 05-00 4Gb FC PCI Express Adapter (df1000fe)
fcs5 Available 05-01 4Gb FC PCI Express Adapter (df1000fe)
fcs6 Available 01-00 4Gb FC PCI Express Adapter (df1000fe)
fcs7 Available 01-01 4Gb FC PCI Express Adapter (df1000fe)
fcs8 Available 04-00 4Gb FC PCI Express Adapter (df1000fe)
fcs9 Available 04-01 4Gb FC PCI Express Adapter (df1000fe)
fcs10 Available 03-00 4Gb FC PCI Express Adapter (df1000fe)
fcs11 Available 03-01 4Gb FC PCI Express Adapter (df1000fe)
vsa0 Available LPAR Virtual Serial Adapter
vscsi0 Available Virtual SCSI Client Adapter
vscsi1 Available Virtual SCSI Client Adapter
[root@ret4a139v:~] # lscfg -l vscsi0
vscsi0 U9117.MMB.1010F9P-V9-C53-T1 Virtual SCSI Client Adapter
[root@ret4a139v:~] # lscfg -l vscsi1
vscsi1 U9117.MMB.1010F9P-V9-C54-T1 Virtual SCSI Client Adapter
As padmin on the VIO server:
padmin@retvio187a1:/home/padmin $ lsmap -all | grep -i c53
vhost16 U9117.MMB.1010F9P-V1-C53 0x00000009
Alternatively, we can also use the below command:
padmin@retvio187a1:/home/padmin $ lsdev -slots | grep -i c53
U9117.MMB.1010F9P-V1-C53 Virtual I/O Slot vhost16
padmin@retvio187a1:/home/padmin $ lsmap -vadapter vhost16
SVSA Physloc Client Partition ID
--------------- -------------------------------------------- ------------------
vhost16 U9117.MMB.1010F9P-V1-C53 0x00000009
VTD 4a139_r_pwr151
Status Available
LUN 0x8100000000000000
Backing device hdiskpower151
Physloc U78C0.001.DBJ3457-P2-C1-T2-L153
VTD 4a139_r_pwr152
Status Available
LUN 0x8200000000000000
Backing device hdiskpower152
Physloc U78C0.001.DBJ3457-P2-C1-T2-L154
VTD 4a139_r_pwr153
Status Available
LUN 0x8300000000000000
Backing device hdiskpower153
Physloc U78C0.001.DBJ3457-P2-C1-T2-L155
Now we can remove all virtual target devices associated with the given backing devices.
#for i in hdiskpower151 hdiskpower152 hdiskpower153;do rmvdev -f -vdev $i;done