Sunday, January 16, 2011

Steps of boot process

Boot Sequence:
1. A boot loader finds the kernel image on the disk, loads it into memory, and starts it.
2. The kernel initializes the devices and its drivers.
3. The kernel mounts the root filesystem.
4. The kernel starts a program called init.
5. init sets the rest of the processes in motion.
6. The last processes that init starts as part of the boot sequence allow you to log in.

Steps of Boot  Process:

1. BIOS    ->Do POST ->power on self test and Check boot priority,
2. MBR     ->I stage boot loader,partition table, o/s signature
3. /etc/grub/grub.conf   ->root (hd0,0)
                           kernel /vmlinuz...... ro root=LABEL=/
                           initrd /initrd.....img
4. /etc/inittab          ->/etc/rc.d/rc.sysinit     ->Set hostname
                                                    ->Set clock
                                                    ->Enable selinux,quota
                                                    ->check filesystem
                                                    ->Enable root in rw mode
5. /etc/inittab          ->runlevel
6. /etc/rc.d/rc          ->whenever runlevel changes
7. /etc/rc.d/rc.local    ->last script executed in boot process


1. Problem  -> MBR CORRUPTED
   Corrupt  -> dd if=/dev/zero of=/dev/sda bs=446 count=1
   Error    -> Stops at boot from for long time
   Recovery -> Put first cd and reboot thn press linux rescue
                chroot  /mnt/sysimage
                grub-install  /dev/sda


2. Problem  -> grub.conf file missing  OR wrong entries in grub.conf
   Corrupt  -> mv /boot/grub/grub.conf /root
   Error    -> drops you to grub prompt
   Recovery -> root (hd0,0)
               kernel /vmlinuz...... ro root=LABEL=/
               initrd /initrd.....img

               
3. Problem  -> /vmlinuz or /initrd file missing from /boot dir.
   Corrupt  -> rm -rf /boot/vmlinuz....... rm -rf /boot/initrd.......
   Error    -> file not found
   Recovery -> Put first cd and reboot thn press linux rescue
                chroot  /mnt/sysimage
                cat /proc/sys/dev/cdrom/info  ->check cdroms identity
                mount /dev/hdb /media
                cd  /media/Server
                rpm --ivh --force kernel.................

4. Problem  -> /etc/rc.d/rc.sysinit    OR       /etc/inittab file missing
   Corrupt  -> rm -rf /etc/rc.d/rc.sysinit OR   /etc/inittab
   Error    -> cannot that execute /etc/rc.d/rc.sysinit OR No process left
   Recovery -> Put first cd and reboot thn press linux rescue
                chroot  /mnt/sysimage
                cat /proc/sys/dev/cdrom/info  ->check cdroms identity
                mount /dev/hdb /media
                cd  /media/Server
                rpm --ivh --force initscripts-8.45

5. Problem  -> Wrong entry of runlevel 0 or 6
   Corrupt  -> vim /etc/inittab and edit runlevel to 0 OR 6
   Error    -> continously reboots
   Recovery ->  Reboot machine and go to single user mode
                and edit vim /etc/initab file and change runlevel to
                3 or 5. and press init q for changes.
               


6. Problem  -> Wrong entries in the /etc/fstab
   Corrupt  -> vim /etc/fstab make some changes in the labels
   Error    -> Drops you to emergencey mode
   Recovery -> First provide roots passwd
               mount -o remount,rw /
               vim /etc/fstab ->and correct the labels  
               If you dotn know label e2label /dev/sda1
               keep checking for correct label e2label /dev/sda2


1 comment: