Tuesday, December 13, 2011

AIX BOOT PROCEDURE


This document gives you details of booting procedure in pseris aix based servers , the procedure is provided by examining the rc.boot file

A TYPICAL BOOTING PROCEDURE  

Seems to be very old question ,

Booting can be summarize in following points

i)          Initializing (activate and make alive) system hardware
ii)         Verify that the system hardware is working fine
iii)        Initialize the firmware (A small software stored in the system board contained in a cmos or any eeprom or any nvram ) , this is referred to IPL (initial program loader)
iv)        IPL selects the boot device already mentioned in the firmware utility , of                       course set by us
v)         Loads the bootstrap from the device
vi)        Bootstrap loads the boot image (for example kernel)
vii)       And IPL transfers the control over to the kernel
viii)            After this the booting process is much specific to the os


UNDERSTANDING AIX BOOTING PROCEDURE

Aix booting procedure can be summaries with following points

i)                    System starts and it checks and verify the functionality of devices (POST)
ii)                   Firmware program (stored in Read only storage ) checks for valid boot list (this firmware program is referred as IPL)

Note: The system maintains a default boot list located in ROS and a user boot list stored in NVRAM, for a normal boot. Separate default and user boot lists are also maintained for booting from the Service key position

     iv)  The first device in the valid boot list is checked for the first record or program sector number (PSN). If it is a valid boot record, it is load  into memory and is added to the initial program load (IPL) control block in memory. The  key boot record data contains the  starting location of the boot image on the boot device, the length of the boot image, and instructions on where to load the boot image in memory.

vi)                                        based on the information provided by key boot data , the boot image or blv is loaded into the memory (decompressed into the memory ) , Boot image contains Kernel , a Ram file system , compressed odm and basic commands
vii)                                      kernel loads and the control is passed from ipl to kernel , kernel loads the Ram file system into memory (it creates  ram drives into existing ram and mounts the file system in ram this facilitates the kernel to load initial prerequisites from a file system before the rootvg is varied on
viii)                                    From the ram file system init process is started which loads rc.boot file phase 1

The rc.bootfile sets few functions regarding network boot , iscsi boot , nim and others before going to the phase 1 , for example it runs the command bootinfo –c to get all network boot parameters
It sets home environment after setting the functions and then goes to the boot phase

rc.boot phase1

 In phase 1 rc.boot first restores odm information from boot image using command restbase , then it configures base devices , it also checks if system booted from iscsi and loads the drivers related to iscsi , error in boot phase 1 shows led codes 0x510 ,0x511 and 0x554 , in the last it links the boot device with ipldevice for that it runs bootinfo –b

After completion of phase 1 init starts rc.boot with option 2 or rc.boot phase 2

rc.boot phase2

It firsts call iplvaryon with –v and checks the output and shows led codes based on the output
ipl_varyon -v
rc=$?
case $rc in
        0 )     ;;  # do nothing
        7 | 8 ) loopled 0x554 "BOOTDEV ACC FAIL";;
        4 | 9 ) loopled 0x556 "LVM_QUERY ERROR";;
        * )     loopled 0x552 "IPLVARYON ERROR";;
esac

Then it checks and mounts root
Then it Copies  /dev special files from RAM filesystem to disk based filesystem, including /dev/ipldevice. The mounted root filesystem contains a symlink  /usr/lib that points to /../usr/lib, and that is how it  finds mergedev with the root fs mounted
/usr/lib/boot/mergedev 2>&1 | \
                /../usr/bin/tee -a /../tmp/boot_log
It then checks and mounts /usr
The date command is available after /usr is mounted
Then it checks and mounts /var , runs copycore command  
And un mounts /var
It checks for paging device using command lsps –t lv and if the lv name is not null it starts paging space
It starts savebase procedure that is merging the compressed odm with the odm in disk
It also checks if tcb is installed and invokes it if it is enabled
It then mounts /var and copies all the log from ramfs to /var

The init process starts rc.boot with option three or rc.boot phase 3
Then the init process executes the processes defined by records in the /etc/inittab file. One of the instructions in the /etc/inittab file executes phase 3 of the rc.boot script

rc.boot phase3

It starts with checking the existence of /etc/filesystems and if it is present it starts mounting of /tmp and if it fails to mount it shows an error
it checks for primary boot logical volume
it checks for space in /tmp
it then sets dump devices
it then sets and configures console and if required loads graphical boot
starts the errdemon
run diagnostics if system supports
complets end of boot
it also checks for any pending power event

After completion of rc.boot file from inittab
Rest of the daemons are run through /etc/inittab for example rc.tcpip