How to Fix Booting Problems with Your Linux Server

How to Fix Booting Problems with Your Linux Server

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.

  1. Server Panic or ‘Init Not Found’ Error
    1. Follow this procedure to fix the infamous ‘init not found’ error.
    2. Boot the server into the command line or shell prompt.
      vim /etc/default/grub

    3. Edit grub and add the following line to the file:
      init=/bin/bash

    4. Save and exit the file.
    5. 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.
    6. Now you can check the log messages and try to find the reason for the server panic or boot error:
      more /var/log/messages

  2. Fix from Boot/Rescue CD
    1. Boot from either an appropriate Linux operating system boot cd or Hirens Boot
      CD.
    2. At the command prompt use the following command:
      boot rescue

    3. At the bash shell prompt that appears use the following command:
      chroot /mnt/sysimage

    4. Run fsck and check for any physical disc errors:
      fdisk -l /dev/sda

    5. Then run fsck on each partition:
      fsck -y /dev/sda2

  3. Reinstall GRUB
    1. Boot from either an appropriate Linux operating system boot cd or Hirens
      Boot CD.
    2. At the command prompt use the following command:
      chroot /mnt/sysimage
      /sbin/grub-install /dev/hda

  4. GRUB Configuration Issues
    1. 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.
    2. Load into the GRUB boot loader:
      find /boot/grub/grub.conf

      or

      find /grub/grub.conf

      or

      find boot/grub/stage1

    3. This will tell you that you have two /boot partitions.
    4. Now we have to reinstall the GRUB config on disk, one by one and retry.
      root (hd0,1)
      setup (hd0)
      quit

    5. If you have any doubts as to where the root partition is located then try to find the file in /etc:
      find /etc/fstab

    6. 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.

How to Set Up a Linux VPN Server from a Windows Client

VPN is important for securely connecting to server’s resource
5 min read
Vladimir Rakov
Vladimir Rakov
Hosting Expert

How To Set up a VSFTPD Server on a CentOS 7 VPS or Dedicated Server

Brief Description FTP is usually insecure exposing clear-text passwords, userna
2 min read
Avi Ilinsky
Avi Ilinsky
Hosting Expert

How To Set up a VSFTPD Server on an Ubuntu 16.04 VPS or Dedicated Server

Brief Description FTP data is usually insecure since information (usernames, pa
2 min read
Eliran Ouzan
Eliran Ouzan
Web Designer & Hosting Expert

How To Recover a Forgotten or Lost Root Password on a Linux Server

In this tutorial, we will reset the root password of a Linux web server by booti
2 min read
Avi Ilinsky
Avi Ilinsky
Hosting Expert
HostAdvice.com provides professional web hosting reviews fully independent of any other entity. Our reviews are unbiased, honest, and apply the same evaluation standards to all those reviewed. While monetary compensation is received from a few of the companies listed on this site, compensation of services and products have no influence on the direction or conclusions of our reviews. Nor does the compensation influence our rankings for certain host companies. This compensation covers account purchasing costs, testing costs and royalties paid to reviewers.
Click to go to the top of the page
Go To Top