AIX alt_disk_copy

Required filesets:
    bos.alt_disk_install.boot_images
    bos.alt_disk_install.rte
    bos.msg.en_US.alt_disk_install.rte

alt_disk_copy -d <hdisk to clone rootvg>             this will clone the rootvg to the specified disk
alt_disk_copy -e /etc/exclude.rootvg -d <hdisk>      this will use the exclude list during the cloning
alt_disk_copy -T -d <hdisk>                          it will convert jfs to jfs2 on the new target disk (from 6.1 TL4 only)
alt_rootvg_op -X <cloned rootvg to destroy>          this will destroy the cloned rootvg (alt_rootvg_op -X altinst_rootvg)
alt_rootvg_op -W -d <hdisk>                          this will wake up a disk (cloned filesystems will be mounted with prefix /alt_)
alt_rootvg_op -S -t <hdisk>                          this will put cloned rootvg to sleep (before that it will do a bosboot)
                                                     (-S: put to sleep earlier "waked up" vg, -t: rebuilds the alt. bootimage before sleep)
alt_rootvg_op -v <new cloned rootvg name> -d <hdisk> this will rename the given cloned rootvg name
                                                     (after wake-up and sleep the cloned vg name will be changed, in this case it is useful)

alt_disk_mksysb -m /mnt/aix1mksysb -d hdisk1 -k      this will resore given mksysb (aix1mksysb) to hdisk1 (-k: keep device configuration)

/var/adm/ras/alt_disk_inst.log                       alt_disk log file 
----------------------------------

alt_disk_copy: (copy hdisk0 to hdsik1)
lv names can't be longer than 11 characters (because of alt_ prefix)
do not take out that disk which was used during boot (otherwise there will be problems with bosboot)

-unmirrorvg rootvg hdisk1    
-reducevg rootvg hdisk1        
-bosboot -ad hdisk0        
-bootlist -m normal hdisk0    
-alt_disk_copy -d hdisk1        
-bootlist -m normal hdisk0

after booting from hdisk1:
root@aix11: / # lspv
hdisk0          00cf5d8fe9c88a34                    old_rootvg
hdisk1          00cf5d8fadcaa9a9                    rootvg          active


booting from the old disk:
root@aix11: / # lspv
hdisk0          00cf5d8fe9c88a34                    rootvg          active
hdisk1          00cf5d8fadcaa9a9                    altinst_rootvg


removing the new image (keeping the old one):
-alt_rootvg_op -X altinst_rootvg         <--removing the new image from hdisk1
-chpv -c hdisk1                          <--clear that pv what contained the removed image
-extendvg -f rootvg hdisk1               <--extend the currently used rootvg with the cleared disk (hdisk1)
-mirrorvg -S rootvg hdisk1               <--mirroring rootvg to hdisk1 (checking: lsvg rootvg | grep STALE)(-S: -background sync)
-bosboot -ad hdisk0; bosboot -ad hdisk1  <--recreate the bootimage
-bootlist -m normal hdisk0 hdisk1        <--setup correct bootlist (checking: bootlist -m normal -o)

------------------------------------

Changing lv names (to avoid 11 characters problem):
1. # mkszfile                            <--creates image.data file of rootvg
2. # vi image.data                       <--edit image.data
3. # alt_disk_copy -d hdiskX -i /image.data -B    <--give image.data fie for alt_disk_copy


--------------------------------------

ONLINE UPDATE WITH ALT_DISK_INSTALL:

unmirrorvg rootvg hdisk1                 <--removing mirror ( check: lsvg -p rootvg)
chpv -c hdisk1                           <--clears boot record
reducevg rootvg hdisk1                   <--free up hdisk1
bosboot -ad hdisk0                       <--creates boot record
bootlist -m normal hdisk0                <--sets boot list (check: bootlist -m normal -o)

installp -s                              <--check if anything can be commited
copy new bos.rte.install                 <--will be needed for checking if update will be successful (cd to this directory)
install_all_updates -pYd .               <--preview of new bos.rte.install
install_all_updates -Yd .                <--installs new bos.rte.install

oslevel -sg 5300-09-01-0847              <--shows which fileset is greater than current service pack, it will show bos.rte.install
instfix -i | grep SP                     <--it will show where to update (53-09-020849_SP)
oslevel -sl 53-09-020849                 <--shows which filesets should be update

cd /mnt/5300-09-SP2                      <--go to servicepack dir
install_all_updates -pYd .               <--preview check

alt_disk_copy -d hdisk1 -b update_all -l /mnt/5300-09-SP2     <--this will do the update

shutdown -Fr                             <--new OS will boot up
smitty commit                            <--if needed

alt_rootvg_op -X old_rootvg              <--removes cloned old OS
chpv -c hdisk0                           <--clears bootrecord
extendvg -f rootvg hdisk0                <--add hdisk0 to rootvg
mirrorvg -S rootvg hdisk0                <--mirror rootvg (-S: in background)
bosboot -a                               <--creates boot record
bootlist -m normal hdisk0 hdisk1         <--set bootlist

--------------------------------------

alt_disk error during AIX update:

If you see this:
...
...
install_all_updates: Result = SUCCESS
Modifying ODM on cloned disk.
Building boot image on cloned disk.

0301-150 bosboot: Invalid or no boot device specified!
usage:  bosboot {-a | -v} [-d device] [-p proto] [-k kernel] [-l lvdev]
                [-b file] [-M primary|standby|both] [-D|-I] [-LTq]
        Where:
        -a              Create boot image and write to device or file.
        -v              Verify, but do not build boot image.
        -d device       Device for which to create the boot image.
        -p proto        Use given proto file for RAM disk file system.
        -k kernel       Use given kernel file for boot image.
        -l lvdev        Target boot logical volume for boot image.
        -b file         Use given file name for boot image name.
        -D              Load kernel debugger.
        -I              Load and Invoke kernel debugger.
        -M primary|standby|both Boot mode - primary or standby.
        -T platform     Specifies the hardware platform type.
        -q              Query disk space required to create boot image.
        -L              Enable MP locks instrumentation.
0505-120 alt_disk_install: Error running bosboot in the cloned
root volume group.
Cleaning up.
forced unmount of /alt_inst/var/adm/ras/livedump
forced unmount of /alt_inst/var/adm/ras/livedump
...
...


There is a bug in alt_disk fileset in different 6.1 TL levels (for example in TL6).
Solution is to update alt_disk filesets separately before doing AIX update

1. I use these files, and copy them to a separate directory:
-rwxrwxrwx    1 root     nobody     28393472 Mar 05 13:36 bos.alt_disk_install.boot_images.6.1.9.30.U
-rwxrwxrwx    1 root     nobody       709632 Mar 05 13:35 bos.alt_disk_install.rte.6.1.9.30.U

2. update filesets with smitty update_all or install_all_updates -cYd /mnt/bb/alt_disk

3. try again AIX update: alt_disk_copy -d hdiskX -n -b update_all -l /mnt/AIX_new_level
--------------------------------------

0 (0)
Article Rating (No Votes)
Rate this article
Attachments
There are no attachments for this article.
Comments
There are no comments for this article. Be the first to post a comment.
Full Name
Email Address
Security Code Security Code
Related Articles RSS Feed
A tcpdump Tutorial and Primer with Examples
Viewed 4681 times since Sun, Jun 17, 2018
AIX perf how to
Viewed 18417 times since Tue, Aug 14, 2018
SNAP in AIX
Viewed 11297 times since Mon, Sep 17, 2018
AIX - How to monitor CPU usage
Viewed 25983 times since Fri, Jun 8, 2018
AIX How to Investigate a System Reboot
Viewed 6180 times since Tue, Aug 14, 2018
Remove disk from volumegroup in AIX
Viewed 6379 times since Tue, Apr 16, 2019
Backup and Restore With AIX
Viewed 4148 times since Sat, May 19, 2018
How to Analyze or Read OS Watcher Output in three easy steps -- With Example ?
Viewed 40593 times since Thu, Jun 21, 2018
AIX ODM for MPIO User Guide 09
Viewed 3741 times since Mon, Dec 31, 2018
Online Backups and Recovery in a Snap AIX
Viewed 4726 times since Wed, May 30, 2018