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
AIX HOW TO CLONE A ROOTVG USING ALTERNATE DISK INSTALLATION ALTER_DISK_COPY
Viewed 15692 times since Sun, Jun 30, 2019
n a perfect world....rootvg would always reside on hdisk0
Viewed 2066 times since Thu, Jun 6, 2019
System Admin Mirrorvg without locking the volume group
Viewed 2846 times since Mon, May 21, 2018
Mirroring session (TTY) on AIX using portmir
Viewed 9003 times since Thu, Feb 21, 2019
AIX lspath Missing path
Viewed 9061 times since Fri, Oct 5, 2018
How to set Kernel Parameters in AIX ?
Viewed 14203 times since Tue, Jul 2, 2019
AIX Increase paging space logical volume size
Viewed 2652 times since Tue, Jul 17, 2018
How To Mirror Your Root Disk On AIX (a.k.a. rootvg)
Viewed 4844 times since Mon, May 21, 2018
How do I analyze and debug core files on AIX
Viewed 5730 times since Thu, Feb 21, 2019
Customizing a NIM Client Restore With a Post-Install Script
Viewed 10667 times since Wed, May 30, 2018