Ubuntu Server 18.04 – Utilizing bootable recovery media

Initial Server Setup with CentOS 8

The concept of live media is a wonderful thing, as we can boot into a completely different working environment from the operating system installed on our device and perform tasks without disrupting installed software on the host system. The desktop version of Ubuntu, for example, offers a complete computing environment we can use in order to not only test hardware and troubleshoot our systems, but also to browse the web just as we would on an installed system. In terms of recovering from disasters, live media becomes a saving grace.

As administrators, we’ll run into one problem after another. This gives us our job security. Computers often seemingly have a mind of their own, failing when least expected (as well as seemingly every holiday). Our servers and desktops can encounter a fault at any time, and live media allows us to separate hardware issues from software issues, by troubleshooting from a known good working environment.

One of my favorites when it comes to live media is the desktop version of Ubuntu. Although geared primarily toward end users who wish to install Ubuntu on a laptop or desktop, as administrators we can use it to boot a machine that normally wouldn’t, or even recover data from failed disks. For example, I’ve used the Ubuntu live media to recover data from both failed Windows and Linux systems, by booting the machine with the live media and utilizing a network connection to move data from the bad machine to a network share. Often, when a computer or server fails to boot, the data on its disk is still accessible. Assuming the disk wasn’t encrypted during installation, you should have no problem accessing data on a server or workstation using live media such as the Ubuntu live media.

Sometimes, certain levels of failure require us to use different tools. While Ubuntu’s live media is great, it doesn’t work for absolutely everything. One situation is a failing disk. Often, you’ll be able to recover data using Ubuntu’s live media from a failing disk, but if it’s too far gone, then the Ubuntu media will have difficulty accessing data from it as well.

In addition, you can actually restore a system’s ability to boot, using a third-party utility known as Boot Repair. This utility will allow you to restore GRUB on a system that has a damaged boot sector and is no longer able to boot. GRUB is a crucial service, since it’s the boot-loader that’s responsible for a system’s ability to boot a Linux distribution. Should GRUB ever stop functioning properly, the Boot Repair utility is a good way to fix it. Having to reinstall or repair GRUB is actually quite common on systems that dual boot some flavor of Linux with Windows, as Windows will often overwrite the boot-loader (thus wiping out your option to boot Linux) when certain updates are installed. Windows always assumes it’s the only operating system in use, so it has no problem wiping out other operating systems that share the same machine.

To use this utility, first boot the affected machine from the Ubuntu live media (the desktop version) and connect to the internet. Then, you can install the Boot Repair utility with the following commands:

sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt update && apt install boot-repair

Now, the Boot Repair utility is installed in the live system. You can access it from the Ubuntu dash, or you can simply enter the boot-repair command from the terminal to open it:

The main screen of the Boot Repair utility

For most situations, you can simply choose the default option, Recommended repair. There are advanced options as well if you’d like to do something different; you can view these options by expanding the Advanced options menu. This will allow you to change where GRUB is reinstalled, if you’re restoring GRUB onto a different drive than the main drive. It also allows you to add additional options to GRUB if you’re having issues with certain hardware configurations, and even allows you to upgrade GRUB to its most recent version. Using Boot Repair, you should be able to resurrect an unbootable system if the underlying GRUB installation has become damaged.

As you can see, live media can totally save the day. The Ubuntu live image in particular is a great boot disk to have available to you, as it gives you a very extensive environment you can use to troubleshoot systems and recover data. One of the best aspects of using the Ubuntu live image is that you won’t have to deal with the underlying operating system and software set at all, you can bypass both by booting into a known working desktop, and then copy any important files from the drive right onto a network share. Another important feature of Ubuntu live media is the memory test option. Quite often, strange failures on a computer can be traced to defective memory. Other than simply letting you install Ubuntu, the live media is a Swiss Army knife of many tools you can use to recover a system from disaster. If nothing else, you can use live media to pinpoint whether a problem is software- or hardware-related. If a problem can only be reproduced in the installed environment but not in a live session, chances are a configuration problem is to blame. If a system also misbehaves in a live environment, it may help you identify a hardware issue. Either way, every good administrator should have live media available to troubleshoot systems and recover data when the need arises.

Comments are closed.