What Do I Need?
- A Dedicated or VPS Linux Server
- Ubuntu
- Putty
- Hiren’s Boot CD
What are Booting Problems?
Have you ever had that problem that when you command your server to restart it instead just shuts down and the restart never takes place for some inexplicable reason? What about when you switch on for the first time and instead of going into your control panel of choice the server decides to just show a string of inscrutable errors? If you experienced these issues or anything similar you’ll know just how frustrating it can be.
- Server Panic or ‘Init Not Found’ Error
- Follow this procedure to fix the infamous ‘init not found’ error.
- Boot the server into the command line or shell prompt.
vim /etc/default/grub
- Edit grub and add the following line to the file:
init=/bin/bash
- Save and exit the file.
- Reboot the server. On restart, you’ll launch straight into a bash shell prompt. Then you can remount the root / filesystem and check /var/log/messages for any error.
- Now you can check the log messages and try to find the reason for the server panic or boot error:
more /var/log/messages
- Fix from Boot/Rescue CD
- Boot from either an appropriate Linux operating system boot cd or Hirens Boot
CD. - At the command prompt use the following command:
boot rescue
- At the bash shell prompt that appears use the following command:
chroot /mnt/sysimage
- Run fsck and check for any physical disc errors:
fdisk -l /dev/sda
- Then run fsck on each partition:
fsck -y /dev/sda2
- Boot from either an appropriate Linux operating system boot cd or Hirens Boot
- Reinstall GRUB
- Boot from either an appropriate Linux operating system boot cd or Hirens
Boot CD. - At the command prompt use the following command:
chroot /mnt/sysimage /sbin/grub-install /dev/hda
- Boot from either an appropriate Linux operating system boot cd or Hirens
- GRUB Configuration Issues
- These kinds of issues can be caused by incorrect changes to the GRUB configuration file, installation of a competing operating system, changes to device ordering or other hardware changes.
- Load into the GRUB boot loader:
find /boot/grub/grub.conf
or
find /grub/grub.conf
or
find boot/grub/stage1
- This will tell you that you have two /boot partitions.
- Now we have to reinstall the GRUB config on disk, one by one and retry.
root (hd0,1) setup (hd0) quit
- If you have any doubts as to where the root partition is located then try to find the file in /etc:
find /etc/fstab
- If you cannot find your drives or mapping then I would recommend reviewing your device.map file:
cat /boot/grub/device.map
Conclusion
This is not an inexhaustible list of the things that can go wrong with the boot-up of your Linux server;
however, it’s some of the most common. It could be that you’re experiencing an issue because of a failed session. No matter how much you adore your Linux machine, there will come a time when you’ll have to rescue your installation. Yes, even a Linux
machine can suffer from a disaster, whether it’s because of a corrupt video configuration, a kernel update gone wrong, or a misconfigured init script. Like Agent Smith says, it’s inevitable.
Linux is a very stable environment, but because there are so many systems within the system, things an go wrong.
Although it’s very easy to become complacent with Linux, due to its numerous strengths, it’s always smart to know how to rescue a machine from an untimely demise. Of course, all of the rescue systems in the world won’t recover your system 100 percent of the time, so you might want to consider implementing a disaster-recovery program for your Linux servers and desktops.
- Check the recommendations for the best VPS and get a suitable one.