AIX Breaking Root Disk Mirrors for OS Upgrade

Before performing any OS patching, it is common practice to break the root disk mirrors. One mirror is used to perform the patching and the second mirror is saved for fail back purposes. This note describes a procedure to break root disk for AIX OS upgrade. This procedure was tested successfully on AIX 5.3 TL7 but should work on all AIX 5.3+ technology levels.

Note:
1. Do a mksysb backup before patching to provide an alternative method of rebuilding the OS from the NIM server using mksysb copy.
2. The following example assumes that the rootvg contains mirrored copies of LVs on hdisk0 and hdisk1.

###
### Step 1: Save the system configuration and break the root mirrors
###
Capture and save outputs from the following commands:
# lspv
# lsvg
# lsvg -o
# lsvg -l `lsvg -o`
# lsvg -p `lsvg -o`
# bootlist -m normal -o

Export all non-rootvg volume groups
Extract the major and minor number of the disk the system was booted from:

# ls -al /dev/ipldevice
crw------- 2 root system 22, 9 Feb 10 11:15 /dev/ipldevice

Confirm the disk the system was booted from:
# ls -al /dev | grep "22, 9"
brw------- 1 root system 22, 9 Feb 11 15:50 hdisk0
crw------- 2 root system 22, 9 Feb 10 11:15 ipldevice
crw------- 2 root system 22, 9 Feb 10 11:15 rhdisk0

Check the current bootlist:
# bootlist -m normal -o
hdisk0 blv=hd5
hdisk1 blv=hd5

Remove LV mirrored copies from hdisk1:
# unmirrorvg rootvg hdisk1

Remove the boot block from hdisk1:
# chpv -c hdisk1

Remove hdisk1 from rootvg:
# reducevg rootvg hdisk1

If you see the following error:
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-884 reducevg: Unable to remove physical volume hdisk1
some LVs are present only in hdisk1 and have not been mirrored.

Migrate them to hdisk0 and then remove hdisk1 from rootvg:
# migratepv hdisk1 hdisk0
# reducevg rootvg hdisk1

Confirm that hdisk1 has been removed from rootvg:
# lsvg -p rootvg
rootvg:
PV_NAME PV STATE TOTAL PPs FREE PPs FREE DISTRIBUTION
hdisk0 active 546 250 107..87..22..00..34


###
### Step 2: Create the alternate boot disk
###
Create the alternate boot disk on hdisk1:
# alt_disk_copy -d hdisk1
Check the volume groups:
# lsvg
rootvg
altinst_rootvg <= altinst_rootvg contains rootvg on hdisk1

# lsvg -o
rootvg <= altinst_rootvg is varied off

The boot list should now point to the alternate disk only:
# bootlist -m normal -o
hdisk1 blv=hd5


###
### Step 3: Boot from the alternate boot disk (hdisk1)
###
Reboot:
# shutdown -rF
Verify that the system was booted from the alternate boot disk (hdisk1):
# ls -al /dev/ipldevice
crw------- 2 root system 22, 1 Feb 20 15:50 /dev/ipldevice

# ls -al /dev | grep "22, 1"
brw------- 1 root system 22, 1 Feb 20 16:07 hdisk1
crw------- 2 root system 22, 1 Feb 20 15:50 ipldevice
crw------- 2 root system 22, 1 Feb 20 15:50 rhdisk1

Check the volume groups:
# lsvg
rootvg
old_rootvg <= old_rootvg contains rootvg on hdisk0

# lsvg -o
rootvg <= old_rootvg is varied off
Change the boot list to point to the original boot disk only:
# bootlist -m normal hdisk0
# bootlist -m normal -o
hdisk0 blv=hd5

###
### Step 4: Boot from the original boot disk (hdisk0)
###
Reboot:
# shutdown -rF
Confirm that the system was booted from the original boot disk (hdisk0):
# ls -al /dev/ipldevice
crw------- 2 root system 22, 9 Feb 10 11:15 /dev/ipldevice
# ls -al /dev | grep "22, 9"
brw------- 1 root system 22, 9 Feb 11 15:50 hdisk0
crw------- 2 root system 22, 9 Feb 10 11:15 ipldevice
crw------- 2 root system 22, 9 Feb 10 11:15 rhdisk0

Proceed with the OS upgrade

###
### Step 5: If the upgrade is successful
###
Remove the alternate boot disk:
# exportvg alinst_rootvg

Remove the boot block from hdisk1:
# chpv -c hdisk1

Add hdisk1 to rootvg:
# extendvg -f rootvg hdisk1

Reestablish root mirroring:
# mirrorvg -S rootvg

Update the boot list:
# bootlist -m normal hdisk0 hdisk1

Rebuild the boot volume:
# bosboot -ad /dev/ipldevice
Import non-rootvg volume groups

###
### Step 6:
### If the upgrade is unsuccessful, boot from the alternate boot disk
### to failback to the OS before the upgrade
###
Update the boot list to point to the alternate boot disk:
# bootlist -m normal hdisk1
# bootlist -m normal -o
hdisk1 blv=hd5

Reboot:
# shutdown -rF
Check the volume groups:
# lsvg
rootvg
old_rootvg <= old_rootvg contains rootvg on hdisk0

# lsvg -o
rootvg <= old_rootvg is varied off

Remove old_rootvg permanently:
# alt_rootvg_op -X old_rootvg - OR -
# alt_disk_install -X old_rootvg

Add hdisk0 to rootvg and reestablish root mirroring
Import non-rootvg volume groups