Updating AIX using alt_disk_copy

Download PDF

Getting older means problems with memory. That’s why I’m writing here – to make a braindump. dd if=/dev/brains of=/this/blog.

Check, how many disks are in rootvg:

lsvg -p rootvg

Check, how many free disks we have:

lspv | grep None

Check the sizes of the free disks:

bootinfo -s hdiskXX

or (POSIX-way):

getconf DISK_SIZE /dev/hdiskXX

We should have at least as many free disks of the same size as rootvg has. If rootvg is mirrored and has two 73GB disks, we should have two free 73GB disks.

If we don’t have enough free disks on the LPAR, we can split rootvg. Of course if rootvg is mirrored. Check first which disks are there, and from which disk the LPAR was booted:

lsvg -p rootvg
bootinfo -b

Remove another disk from rootvg! If rootvg contains hdisk0 and hdisk1, and the LPAR was booted from hdisk0, split hdisk1 from rootvg. Trust me – it makes life easier in case of errors and accidental reboots ;-)

I use the following one-liner to remove (almost) all logical volumes from the disk:

lsvg -l rootvg | tail +3 | grep -v sysdump | awk '{print "rmlvcopy "$1" 1 hdisk1"}' | sh -v

Next check if you still have any logical volumes on the disk to remove from rootvg:

lspv -l hdisk1

if you have any sysdump devices, deactivate them first using sysdumpdev and then remove.

sysdumpdev -P -p /dev/sysdumpnull
rmlv lg_sysdumplv

If you have any other logical volumes, check if they have a copy and they should be migrated to another disk:

migratepv -l lv00 hdisk1 hdisk0

When the disk is empty and contains no more logical volumes, remove it from rootvg.

reducevg -f rootvg hdisk1

Don’t forget to remove boot record. Just in case.

chpv -c hdisk1

OK. Now we have a disk or two disks to make a copy of rootvg. Let’s do it! But first check if you have /etc/exclude.rootvg file and remove it or copy it to a safe place.

alt_disk_copy -B -d hdisk1


alt_disk_copy -B -d "hdisk2 hdisk3"

It takes a little bit time. But after this step we have two identical copies of rootvg. We can boot from either disk and have the same system.

Now we start to update our second copy of rootvg. We should first “wake up” it, then remove all emergency fixes we have and the update.

Wake up:

alt_rootvg_op -W -d hdisk1

Removal of emergency fixes:

INUCLIENTS=1 chroot /alt_inst /usr/sbin/emgr -l
INUCLIENTS=1 chroot /alt_inst /usr/sbin/emgr -rL <FIX-LABEL>

If you still don’t have a directory with AIX update, mount it from your NFS server or copy it locally.

mount -o soft nfs-server:/aix/update /mnt

Then start the longest process ever.

alt_rootvg_op -C -I "acNgXY" -b update_all -l /mnt

The first I is big i – installp options, the second l is small L – location.

Update usually runs very long. It depends, if you update a TL or just a SP. SP update can run 30-60 minutes. TL update can run several hours. But when it is done, you must check if it really was so successful as installp says:

chroot /alt_inst /usr/bin/oslevel -s
chroot /alt_inst /usr/bin/lppchk -vm3

If not, try to find an error ;-) If everything is ok, let altinst_rootvg sleep again.

alt_rootvg_op -S -t -d hdisk1

Updated rootvg can now “sleep” till the server’s maintenance window comes. But be careful – don’t add new filesystems or change something on the server, that changes files in rootvg, including ODM. Because you’ll lose all of your changes after reboot with new AIX version. Postpone all changes till after the maintenance window or recreate altinst_rootvg every time you change rootvg.

When you are allowed to reboot the server, set up new boot list and reboot the server.

bootlist -m normal hdisk1
shutdown -Fr

After reboot install new emergency fixes, if you have any, and your update is finished.

Happy AIXing :-)

Download PDF

One thought on “Updating AIX using alt_disk_copy

  1. Александр

    It’s very interesting and usefull, but why don’t you use alt_disk_copy?

Leave a Reply

Your email address will not be published. Required fields are marked *