Archive for April, 2012

Welcome back to the troubleshooting tutorials series we are sharing through this blog. For the past 4 days I am dealing with troubleshooting of different configuration files under /etc and /boot and whatever I learn from that experience is presented here so that more and more people can acquire the basic troubleshooting skills in Linux. Today we’ll see what to do in case your inittab file is deleted.

First of all let’s understand what is the importance of inittab file. You  may know that init is the first process running under Linux and this file is used to start init process. This file also start the runlevels and if this file is deleted you won’t be able to boot. You can’t use even single user mode to fix the problem.

Recover from deleted /etc/inittab file in RHEL

The situation may seem complex to you but the solution is quite easy for that kind of problem. Here we’ll have to enter into rescue mode and if you are following this tutorial series then you must recall that I have told you how to enter into rescue mode. If you have missed the show then that’s not a problem as you can get it from this link.

Now when you’ve entered into rescue mode then it’s time to enter into root environment using chroot /mnt/sysimage command.Now you’ll have to mount he CD or iso file in case you are using RHEL under VMWare. To mount it issue mount /dev/hdc /mnt command. Do remember that on your system the path to CD or iso may be different from mine. So you must know the right path and for this you can use df -h command.

Once you have mounted the CD or iso all you need to do is to install initscripts rpm file stored under Server folder of the CD or iso. So issue rpm -Uvh –force /mnt/Server/init and hit tab to auto-complete the full name of the initscripts rpm file.Once the installation is complete you’ll get your inittab file back.

But there is a small glitch.When you’ll reboot your machine then it will boot into runlevel 3. You can change the default runlevel to 5 and next time it will boot in graphical mode.

That’s done for today.Let’s see what’s next.


Missing initrd File In RHEL

Back again with another troubleshooting tutorial. This time we’ll deal with the initrd image file. This is the file needed during the booting to initialize the kernel. As I told you earlier that I am using scripts contained in Trouble-Maker tool. Last time it blow my network off and this time it’s playing with my initrd image. After running that script I got following screen-

Missing initrd image file in RHEL

As you can see that it’s showing file not found error. I even tried to boot into single user mode but that didn’t work because the same message appeared there too. Now the last option is to boot into rescue mode and try to recover from the shit.

I am using RHEL on Vmware and I select the booting device to CD to enter into rescue mode..You can also boot from RHEL CD if you are using RHEL as a stand-alone installation.  At the start of booting you’ll be prompt with the following screen. Type linux rescue to enter into rescue mode.

Booting into Linux Rescue Mode

Once you boot into rescue mode you’re system will be mounted on /mnt/sysimage. To enter into root environment you’ll have to issue chroot /mnt/sysimage command. So type this command.

We know that initrd file is defined at /boot/grub/grub.conf file. So I opened this file using vi /boot/grub/grub.conf command.You can’t use vim here. But here everything was ok.

Missing initrd file in RHELNow I got stuck at this point because grub.conf file was correct. Then I listed /boot to see the contents of the directory and-voila! The problem was here. The script I executed didn’t alter my grub file but it changed the name of the initrd file.

Recovering from missing initrd file in RHEL

It appended .missing to the name of initrd file and thus making it inaccessible for grub. To recover from that problem I just renamed it to its original name using mv /boot/initrd-2.6.18-128.el5.img.missing /boot/initrd-2.6.18-128.el5.img command.Now just save it quit the rescue mode using ctrl+d.Now the system started normally. So another problem is solved successfully.Let’s see next is what.

A very good after noon to you. As you know that these days we are discussing Linux troubleshooting and today we will deal with the Network-off problem. Do you remember my post about Trouble-Maker? If not then have a look at it.This tool contains various scripts which I am running to cause problem in my Linux machine and then I am learning to troubleshoot it. During this process I faced a problem of network connection after running a script. I was normally using my internet but after running that script I lost my connection.

Troubleshooting network off problem In RHEL

After checking Firefox setting and finding them right I switched to the network file of RHEL /etc/sysconfig/network and found that the problem was in this file as it contained NETWORKING=no line and this was causing the problem. Due to this line my system was unable to use networking and I lost my internet connection. Altering it to NETWORKING=yes fixed the problem.After writing this line all I need to do was to restart network service using service network restart command and it fixed the problem and I got my internet connection back.

Troubleshooting network off problem in RHEL

Troubleshooting is fun only if you know the problem exactly.Right!