Nearly every computer user has felt the pit in their stomach when they turn on their machine and see an error message where their OS should be.

Fortunately, there's a live Linux distro that can serve as a first aid kit for computer trouble, no matter what OS you use. SystemRescue will help you nurse your PC back to health.

What Is SystemRescue?

SystemRescue is a live Linux distro that's meant for rescuing unbootable PC systems. If you have a problem booting, you just stick your bootable media in your computer and attempt to use the included tools to help fix it.

SystemRescue is based on Arch Linux, but you don't have to be a Linux guru to use it. You don't have to know much about Linux at all. All you have to do is follow the extensive instructions on SystemRescue's site for fixing your system. The SystemRescue documentation is available online, but a local copy is included on the image because you may not have network access.

Download: SystemRescue ISO

Obtaining Installation Media

As with many other live Linux distros, you obtain the ISO image from the project's download page and then extract it to your installation media of choice, such as a USB drive. It's a good idea to do this before you run into any computer trouble.

When you finally boot your media, you'll be confronted with the text console. Don't panic. Just type "startx" at the prompt and an XFCE desktop will come up.

At the console or the prompt, you're running as root, as shown by the "#" prompt, so be careful. There won't be any of the usual checks against editing important system files you would have as a regular user, so you might end up breaking your system even more than it already is if you don't pay attention.

Disk Partitioning With SystemRescue

You may need to grow or shrink any disk partitions on your machine. The easiest way to do this is to use the graphical GParted utility included with SystemRescue. You can launch it from the XFCE menu.

You can directly manipulate the partition table to add, grow, shrink, or delete partitions.

Repairing the GRUB Bootloader

Sometimes, the bootloader, the program on your hard drive that loads your operating system, gets corrupted or overwritten. This is especially true if you upgrade a certain major proprietary OS on your machine.

If you can't boot into your machine, you can try to fix it by reinstalling the GRUB bootloader. To do this, you'll have to boot your SystemRescue media and mount your drives.

You can use grub-install to install the GRUB bootloader to the drive you want. On most PCs, the primary hard drive is typically under /dev/sda.

You can use the lsblk command to identify any disks attached to your machine. Then mount the drive you want to reinstall the bootloader on. You would then use arch-chroot to change the root directory of SystemRescue from the boot media to your hard drive.

When you've "chrooted," you can now run grub-install to reinstall the bootloader. Exit the shell by typing "exit" or pressing Ctrl + D. Now you can reboot your computer, making sure to remove the boot media and see if it worked. Hopefully, you'll be able to boot into Linux again.

If you don't know which partition your Linux installation is on, you can use the output of the lsblk command to see the partitions on your system.

GParted running on SystemRescue

In this case, the Linux system is on /dev/sda1. You can create a directory to mount it using mkdir with the -p option and then mount it:

        mkdir -p /mnt/linux
mount /dev/sda1 /mnt/linux

Now chroot into the directory we created:

        arch-chroot /mnt/linux
    

Now we can make changes to the system as if we had booted it directly. Look over the /boot/grub/grub.conf to make sure it looks correct and edit it if necessary.

If you haven't changed anything, this will likely be as it was when you installed your Linux system. You can most likely go with it as it is just to see if it works. If it doesn't, you can always use the mount-and-chroot method to get back to the GRUB configuration menu and try again.

Now we can run the grub-install command to reinstall the bootloader:

        grub-install /dev/sda1
    

Here comes the moment of truth. Type "reboot" at the prompt. If the installation media is still in the drive, select "Boot Existing OS" from the boot menu, and it should start the GRUB bootloader on your hard drive or SSD. If all goes well, you should be able to boot as normal. You can now breathe a sigh of relief! Linux is back!

Testing Memory With Memtest86+

SystemRescue Memory Test

If you start running into strange errors like kernel panics in Linux or blue screens of death on Windows and you haven't made any recent changes or updated recently, you may have a hardware issue. It could be that your hard drive is failing, or it could be that your RAM might have a problem. You can also test the latter with SystemRescue.

To test the RAM, boot up SystemRescue and choose "Memtest86+" at the boot menu. This will take you to the memory testing utility. It will run through a series of tests to check the integrity of the RAM chips and report success or failure.

Using SystemRescue to Archive Files From a Failing Drive

SystemRescue running lsblk command

If you want to move some files off of a drive because it's failing, you can boot up SystemRescue and mount the disk as seen earlier, then mount another drive and copy files to it.

        mkdir -p /mnt/harddrive
mount /dev/sda /mnt/harddrive

If you have a USB drive plugged in, and you don't know what device name it is, you can use the lsblk command again to see which device name it's attached to. You can mount it as with any other drive. For example:

        mkdir -p /mnt/usb
Mount /dev/sdb1 /mnt/usb

Now you can simply copy files from the hard drive to the external drive:

        cp /mnt/harddrive/files /mnt/usb
    

Cloning Disks to a New Device

You can also copy entire drives to external media using the dd command. But first, make sure you've mounted both your drives. Then issue the following dd command. The "if=" part of the command will be the infile, or the drive you want to copy, and the outfile, or the "of=" part will be the drive you want to copy to.

        dd if=/dev/sda of=/dev/sdb
    

Make sure you have the device names exactly the way you want them, or you could permanently erase your disks.

Resetting Passwords With SystemRescue

Sometimes, you might forget important passwords. Or maybe you bought a used PC and don't have a password. Fortunately, you can reset Linux and Windows passwords with SystemRescue.

On the Linux side, chroot into your system as shown earlier and run the passwd command for the account you want to reset. To reset the root password:

        passwd root
    

Resetting Windows passwords is a little more involved. First, you have to mount your Windows partition and run the chntpw utility, included with SystemRescue. The password information for local accounts is typically located in C:\Windows\System32\config\SAM.

        mkdir -p /mnt/windows
mount /dev/hda1 /mnt/windows
chntpw -l /mnt/windows/Windows/System32/config/SAM

This will bring up a menu of Windows accounts you find on the system. Select the one you want to change and choose the menu option to clear the password. This will make it completely blank. Reboot into Windows and you'll be able to log in without a password and choose a new password in the account settings.

If your Windows account is a Microsoft account, you'll have to reset the password from the Microsoft account page instead, like any other website reset method.

SystemRescue: A First Aid Kit for Your PC

While your Linux distro's installation image will often have tools for you to try to repair your broken system, SystemRescue is a nice distro-agnostic tool to have around in case of an emergency. It's like a first aid kit: you hope you never have to use it, but if you do, you'll be glad you had it around.

If you've been pressed into being the IT help desk for your friends and family, you can use SystemRescue when their machines fail to boot, but you can also set things up so they don't need you as much for simple things.