Wednesday, April 25, 2018

How to create a ISO image using mksysb and perform the restoration in aix?

How to perform the AIX restore using the ISO image in aix?



Assume the server name is "testserver"


Taking the mksysb on the /mnt directory. (it can be nim server nfs filesystem)
mksysb -i -e -X /mnt/testserver.mksysb     


To confirm the mksysb backup is good for restore.
listvgbackup –f /mnt/testserver.mksysb


To create a iso directory to hold the iso image and go inside it.
mkdir /mnt/testserver/iso
cd /mnt/testserver/iso


To create iso image using mksysb
mkcd -L -S -I /mnt/testserver/iso -m /mnt/testserver.mksysb


cd_image_12345 file has been created, we can rename it 


Rename the iso image for the better naming convention.
mv cd_image_12345 testserver.iso


Confirm the rename is successful
ls -l testserver.iso 


Now the iso can be stored in the /home/padmin directory of the VIO server.
scp testservcer.iso padmin@vioserver:/home/padmin/.


To Lists and displays information about the Virtual Media Repository.
lsrep


To create the media repository
mkrep -sp rootvg -size 10G


To confirm the media repository created
lsrep


To copy the iso image to the repository image
cp testserver.iso /var/vio/VMLibrary/


To create a optical device and map it on the proper vhostX
lsmap -vadapter vhost0
mkvdev -fbo -vadapter vhost0 -dev testserver_opt0
lsmap -vadapter vhost0


To load the virtual media on the optical device
loadopt -disk testserver.iso -vtd testserver_opt0
lsmap -vadapter vhost0


Now the output should be like


VTD testserver_opt0
Status Available
LUN 0x8200000000000000
Backing device /var/vio/VMLibrary/testserver.iso
Physloc
Mirrored N/A


Now we can able to restore the iso image to the corresponding lpar.

Login to the hmc and Activate the AIX server “testserver” to the SMS Menu
And choose the below options.

(5) Select boot option
(1) Select install/ Boot device
(7)  List all devices
(2) SCSI-CD ROM  (location code lun id match with the lun id of the mapped vhost - 0x8200000000000000)
(2)  Select normal boot
(1) Yes  (to exit system management service)

Once exiting from the sms menu, the server “testserver” will boot up from the virtual optical device to the AIX Installation Menus

Now the install /restoration aix operating system.starts



Note:

Sometimes, 2 ISO images created due to the large size of mksysb. In that case, while perform the restoration first we have to add the first iso image and after sometime we need to load the second .iso image. (The system will let you know to add the second iso image - "Please remove volume 1, insert volume 2, and press the ENTER key.")


Follow the below procedure if you are in the situation to add the second iso image.


lsmap –vadapter vhost0
unloadopt -vtd testserver_opt0
loadopt -disk testserver2.iso -vtd testserver_opt0
lsmap –vadapter vhost0