Wednesday, July 18, 2012

LINUX BOOTING SEQUENCE TROUBLESHOOTING

LINUX BOOTING SEQUENCE TROUBLESHOOTING
Case 1: No boot loader splash screen or prompt appears
Cause:
1) Grub.conf miss configures
2) Initrd misplaced or deleted
3) MBR cruuppet
4) /boot partition miss
Grub.conf miss configures
Remedy: try to pass boot location initrd location & kernel module location as follows
Step a) Grub > root (hd0,0)
Note: here hd0,0 means boot partition is in 1st partition of 1st hdd.(please use hd for SATA & SCSI hdd also )
Step b) grub > kernel /vmlinuz-$(uname -r) root=LABEL=/ rhgb quiet
Step c) grub > initrd /initrd-$(uname -r).img
Step d) grub > boot
Then after rebooting try to recreate grub.conf file
Initrd misplaced or deleted
Case a) system is up
This is the most fortunate situation for system admins who are managing the server remotely because now once the system will down it will not be up without rescue mode
Remedy:
[root@dh-localhost ~]# mkinitrd /boot/ initrd-$(uname -r).img $(uname -r)
Case b) system is down
Then boot from system via DVD & start it by rescue mode
Remedy:
Step 1) Boot: linux recue
After some process & ittrective prompt you will be on sh prompt
Step 2) chroot /mnt/sysimage
cd /boot
mkinitrd /boot/ initrd-$(uname -r).img $(uname -r)
Then reboot the system by HDD
Note: - in case of fstab is also misconfigured (ie / & other partition will not mount after boot) then chroot command will not work. So in this case your 1st step would be to correct fstab then perform above steps as follows
Step a) boot from DVD or other bootable media
Step b) chroot /mnt/sysimage (you will find chroot error here )
Step c) mkdir /test
e2label /dev/sda1 (if it will show boot them mount it otherwise try to search by e2label /dev/sda2 ownwards)
mount /dev/sda1 /test
cd /test
cd grub
vi grub.conf (please make it correct)
mkdir /data
mount /dev/sda2 /data (mounting / partition on /data )
cd /data
cd /etc
vi fstab (please correct it )
Then reboot the system & follow previous step
Mbr corrupt
Case a) system is up
Method 1
[root@dh-localhost ~]# /sbin/grub-install /dev/sda
Method 2
[root@dh-localhost ~]# grub
grub> root (hd0,0)
grub > setup (hd0)
grub > quit
Case b) system is down
Boot system by rescue mode
Sh #Chroot /mnt/sysimage
Sh # /sbin/grub-install /dev/sda
Note : A smart system admin always take backup of MBR as follows
[root@dh-localhost ~]# dd if=/home/mbr of=/home/mbr bs=1 count 500
&
For restoration for MBR
[root@dh-localhost ~]# dd if=/home/mbr of=/home/mbr bs=1 count 500
/boot partition miss
In this case if you have backup of /boot then you can recover it otherwise you need to rebuild the server again.

No comments:

Post a Comment