Linux Mint – Diagnosing boot issues

How to Setup a Node.js Application Using PM2

Issues related to booting your Linux computer may happen due to any one of several reasons. However, most startup issues seem to be caused by Windows. If you dual-boot Windows and Linux, it’s not uncommon to have issues with booting Linux at some point. When upgrading from one version of Windows to another, Windows will typically not respect the fact that you dual-boot into Linux and may even wipe out your Linux boot sector. To solve this particular issue, see the Reinstalling GRUB section later in this chapter. Typically, when you reinstall GRUB, it will discover that you also have Windows installed and create an option to boot it along with Linux. Windows, on the other hand, will wipe out your Linux boot options when its boot loader (NTLDR) is reinstalled.

Other issues that can cause your computer to cease booting normally include hard drive corruption, faulty RAM, UUID changes, and invalid GRUB configuration. In the case of faulty RAM, this chapter includes the Testing the RAM section, which will walk you through diagnosing whether or not your system has memory issues. An invalid GRUB configuration, even for reasons outside of Windows overwriting the boot configuration, is solved by reinstalling GRUB.

However, UUID issues can be tricky. In fact, UUIDs are both a blessing and a curse. Before UUIDs were in common use, the naming convention of /dev/sda1, /dev/sdc3, and so on were used system-wide, even for removable devices. The problem was that if the order of the device connections was swapped around inside your case, the system may become confused and initialize the media in the wrong order. UUIDs have solved this problem by generating a UUID value unique to each device, therefore referencing them by something predictable instead of something that is dynamically applied. In fact, most (if not all) Linux distributions shipped today use UUIDs.

The downside of the UUID methodology is that they make it harder to deploy a single Linux snapshot across several computers of varying makes and models. Worse, if the UUID doesn’t match what the boot loader expects, the system will refuse to boot. In order to fix issues such as these, you can either find the new UUID and change it in all the related files, or you may find it less of a pain to reinstall GRUB.

If you wish to update the UUID value to what it’s supposed to be, follow these steps. First, we need to know which partitions are on our system. Unfortunately, we can’t boot the system, because that’s not working. For reasons such as these, it’s important to keep a live CD or DVD handy. Mint’s install disc is live media, so you can boot from the same disc you used to install the distribution. Once loaded, you will have a fully functional environment and will be able to work toward repairing the issue.

First, you’ll need to mount your hard drive. The easiest way to do this is to open it through the file manager, such as Nemo in the Mint edition. Then, execute the following command to get a list of partitions on your hard disk(s):

sudo fdisk -l

The output of the previous command will list all the partitions on your system. Pay attention to your primary hard disk (or any hard disk on which Linux is installed) and write down the device names. You can usually deduce which one corresponds to which mountpoint. If you need clues, look at the content of the /etc/fstab file (located in the /etc folder of your disk, NOT the live media). It typically has some comments regarding which partition is matched to which mountpoint. Next, we need to find our current UUIDs. The following command will display the current UUIDs:

sudo blkid

Now, you are armed with the information that you need. You have your partition layout, the UUIDs of your partitions, and the /etc/fstab file as a guide to what goes where. The following files are the ones you will need to update with the correct UUID. Keep in mind that the paths listed are relative to your hard disk, not to the file system of the live media. For example, if your hard disk is mounted under the /media/jdoe/MyDisk directory in the file manager, the path to the /etc/fstab file, for example, would then be /media/jdoe/MyDisk/etc/fstab.

The following is the list of files that contain the UUID and would need to be updated:

  • /etc/fstab
  • /boot/grub/grub.cfg

If your next boot also fails, make sure that you have edited your UUID in every occurrence. For example, consider the following command:

cat /boot/grub/grub.cfg | grep UUID

The preceding command will search a text file for every occurrence of UUID, therefore displaying all the values as well. You can compare these values to what the values should be.

Comments are closed.