Showing posts with label aix alternate disk. Show all posts
Showing posts with label aix alternate disk. Show all posts

Tuesday 8 June 2021

Take the rootvg backup using Alternate disk

Note: To support this blog.Please click the ads displayed in this Blog.That would be helpful for me.Continue with this post.

This method is useful to take the backup to alternate disk and no impact to original rootvg. We can easily roll back the server just by changing the bootlist.
If rootvg got corrupted or any issues after patching the server , we can easily roll back the server.

Required filesets:

bos.alt_disk_install.boot_images
bos.alt_disk_install.rte
bos.msg.en_US.alt_disk_install.rte

Flags 

-B

       Would specify not running bootlist after the mksysb or clone. If set, the -r flag cannot be used. Note: The -B and -X flags are mutually exclusive.

-C

            Clone rootvg.

-S 

       Will "put-to-sleep" the volume group. This is used after a volume group "wake-up". (W).


-W disk

       Used to "wake-up" a volume group for data access between the rootvg and the alternate disk rootvg.


-v new_volume_group_name disk 

       Used to rename the alternate disk volume group. This is especially useful when creating multiple alternate disks, on multiple volume groups,and name identification is necessary.

Examples:

To take the clone of rootvg, not change bootlist.

# alt_disk_install -B -C hdisk1


To "wake_up" an original rootvg, after booting from the new alternate disk:

            alt_disk_install -W hdisk0

Illustrated Example

            # lspv

            hdisk0          000040445043d9f3     old_rootvg

            hdisk1          00076443210a72ea     rootvg

            # alt_disk_install -W hdisk0

            # lspv

            hdisk0          000040445043d9f3     altinst_rootvg

            hdisk1          00076443210a72ea     rootvg

At this point, the "altinst_rootvg" volume group is varied-on and the /alt_inst file systems will be mounted.

To "put-to-sleep" a volume group that had experienced a "wake-up":

            alt_disk_install -S

Illustrated Example


            # lspv

            hdisk0          000040445043d9f3     altinst_rootvg

            hdisk1          00076443210a72ea     rootvg

            # alt_disk_install -S

            # lspv

            hdisk0          000040445043d9f3     altinst_rootvg

            hdisk1          00076443210a72ea     rootvg

The "altinst_rootvg" is no longer varied-on and the /alt_inst file systems are no longer mounted. If it's necessary for the "altinst_rootvg" volume group name to be changed back to "old_rootvg", this can be done with the "-v" flag.

To modify an alt_disk_install volume group name: 


            alt_disk_install -v alt_disk_432 hdisk2


Illustrated Example


            # lspv

            hdisk0          00006091aef8b687     rootvg

            hdisk1          00000103000d1a78     rootvg

            hdisk2          000040445043d9f3     altinst_rootvg

            hdisk3          00076443210a72ea     altinst_rootvg

            hdisk4          0000875f48998649     None

            hdisk5          000005317c58000e     None

            # alt_disk_install -v alt_disk_432   hdisk2

            #lspv

            hdisk0          00006091aef8b687     rootvg

            hdisk1          00000103000d1a78     rootvg

            hdisk2          000040445043d9f3     alt_disk_432

            hdisk3          00076443210a72ea     alt_disk_432

            hdisk4          0000875f48998649     None

            hdisk5          000005317c58000e     None

Process to take the alternate disk backup:

1. If rootvg is mirrored, break the mirror and free up one disk then proceed to take the backup using alternate disk method.

2. Take the alternate disk backup using the command alt_disk_install without changing the bootlist of AIX server.

# alt_disk_install -B -C <hdiskX>

3. Verify the bootlist and boot image created hdiskX.

# bootlist -m normal -o
# ipl_varyon -i

To roll back the server :

1. Verify and Change the bootlist to altinst_rootvg disk(hdiskX).

# bootlist -m normal -o

# bootlist -m normal  <hdiskX> hdisk0

2. Reboot the server using alternate disk(altinst_rootvg).

# shutdown -Fr now

3. Once server came back, verify whether it is booted with alternate disk or not. Make sure old disk with old_rootvg

# lspv

To remove the alternate disk backup we have execute the below command.

# alt_disk_install -X

Break the rootvg mirror and take the clone for quick rollback. If your VIO server with single disk take the mksysb backup:

To break the rootvg mirror and create a clone for quick rollback

$ bootlist -mode normal –ls

$ unmirrorios hdisk1

#  migratepv hdisk1 hdisk0     (Run as root user)

$ reducevg -rmlv rootvg hdisk1

$ alt_root_vg -target hdisk1


$oem_setup_env (to get root shell)

# bosboot -ad hdisk0 (using root shell)

# bootlist -mode normal hdisk0 hdisk1 (using root shell)


Patching using alternate disk:
If rootvg is mirrored, break the mirror and free up one disk then proceed with AIX patching using alternate disk method.

# alt_disk_copy -d <altdiskname> -b update_all -l <TL Location>

# alt_rootvg_op -W -d hdisk8 

# chroot /alt_inst /usr/bin/ksh

# oslevel -s

# exit

# alt_rootvg_op -S altinst_rootvg


Friday 18 November 2016

How to upgrade TL and SP in AIX using alternate disk(alt_disk_copy)


Many method available to upgrade/patch AIX technology level(TL) and service pack(SP) to latest level.This is perfect method to update the AIX server using alternate disk, there is no impact to original rootvg whatever the upgrade you are performing that will goes into alternate disk.To restart the server you have to take downtime from customer or application/database team then you can say it will take minimum downtime. For upgrade/update/migration activities you must take mksysb backup, this backup will useful to restore AIX OS if incase any issues. This mksysb image you can restore by creating NIM resource like mksysb and SPOT .

I may suggest you mksysb backup is optional for alternate disk upgrade(alt_disk_copy) . If you face any issues during or after the upgrade its very easy to backout, just to change the bootlist and restart the system to old rootvg. You must install latest level of bos.alt_disk_install.rte and bos.alt_disk_install.boot_images filesets to current AIX OS, you do not install most cases AIX TL upgrade will fail.

Advantages :
1. Server up and running you can do the OS upgrade/Patching
2. Minimum downtime
3. Easy to backout/rollback to previous version.


Pre-Checks:


1. Verify current operating system version
   # oslevel -s

2. Check currently installed AIX TL and SP levels consistency, make sure no missed filesets for AIX technology level(ML) and service pack(SP)
   # instfix -i | grep ML
   # instfix -i | grep SP

3. Need to check if any filesets missed
   # lppchk -vm3

4. List the installed ifixes/emergency fixes.
   # emgr -l

5. To remove the ifixes/emergency fixes
   # emgr -l
   # emgr -rL <fix>

6. Commit all applied filesets installed on current AIX level
   # installp -s
   # installp -c all

Download the new packages from IBM Fix central(https://www-945.ibm.com/support/fixcentral/) , copy to destination server through ftp or winscp.
In this method mksysb backup not must to take, because upgrading is going on alternate disk. It wont impact to original rootvg

6. Install latest level packages of bos.alt_disk_install.rte and bos.alt_disk_install.boot_images
   # smit installp

Implementation Steps :
If rootvg mirrored follow the below steps, not ignore step 1

1. Reduce the disk from rootvg and use it for upgrade OS using alt_disk_copy
   # unmirrorvg rootvg hdisk5
   # reducevg -df rootvg hdisk5
   # chpv -c hdisk5
   # ipl_varyon -i (To check bootable devices)
   # bootlist -m normal -o
   # bosboot -ad /dev/hdisk0

2. Not mirrored get the new disk(equal or higher size of rootvg disk) from storage team.
   Run following command to take alt disk clone and upgrade to latest level.
   # alt_disk_copy -d <altdiskname> -b update_all -l <TL Location>

   # alt_disk_copy -d hdisk5 -b update_all -l /mnt/AIX_TL

   -d represents alternate disk name
   -b represents bundle
   -l represent location of the TL or SP packages.

Recommended : Execute the command in nohup, to avoid the network issues while doing activity

   # nohup alt_disk_copy -d hdisk5 -b update_all -l /mnt/AIX_TL > /tmp/altinst_log &

 To verify the output
   # tail -f /tmp/altinst_log

3. Verify the "altinst_rootvg"  created on hdisk5
   # lspv

Once step 2 completed, bootlist automatically set to target disk hdisk5 and reboot the server.

Post-Checks and Verification :

1. Change the bootlist, if not updated to target disk
   # bootlist -m normal hdisk5 hdisk0

2. Reboot the server, it should came up with new oslevel
   # shutdown -Fr
   # oslevel -s

3. Verify installed AIX OS ML(TL) and SP levels consistency, install if any missed
   # instfix -i | grep ML
   # instfix -i | grep SP
   # lppchk -vm3

4. If any filesets missed, check what all missed TL or SP
   # oslevel -rl <TL>
  Example : oslevel -rl 7100-04

  # oslevel -sl <SP>
  Example : oslevel -rl 71-04-011543


alt_disk_copy issues :
You got the below error while doing alt_disk_copy, must check the bos.alt_disk_install.rte and bos.alt_disk_install.boot_images filesets updated to latest level or not.
If not install or update it to latest version.

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]










Thanks for reading this post, any queries please write a comment


Privacy Policy

  Privacy Policy for UNIX TECH INFO At UNIX TECH INFO, accessible from https://unixworld4admin.blogspot.com/, one of our main priorities is ...