Howto: Rescue Arch Linux with arch-chroot and a USB Drive

Howto: Rescue Arch Linux with arch-chroot and a USB Drive

Arch Linux runs on a rolling update system, so when you update the system, you are often receiving very new patches which might have undiscovered bugs.

Occasionally you will be unable to boot into your system. This is a very good reason why you should always have multiple backups and system clones.

If you however find yourself in a situation where Arch is failing to boot, then you may need to use the following techniques to rescue the system. Read more about how to create a necessary backup routine here.

First, you will need a USB drive which has been flashed with the Arch Linux ISO. More information on creating a set of flashed USB drives with all the possible tools you could need can be found here.

Boot into the Arch Linux ISO, by starting your machine and selecting the option to enter "setup" mode which will allow you to select an internal or external drive to boot from.

On an Lenovo T430s, you enter setup mode by pressing enter after hearing the beep and seeing the words on screen "To interupt normal startup, press Enter"

arch-chroot-4

After entering setup mode, select the option for choosing a startup device, sometimes called a startup disk or boot drive. On the T430s that is the F12 key.

arch-chroot-3

You will then select the boot drive, in this case the USB drive which is currently plugged into the computer. After doing so, you will see the Arch Linux prompt. Select the first option to boot into Arch Linux.

Arch-Linux

You will boot into a copy of Arch Linux which is being read directly from the USB drive. You will fall into a root prompt.

root@archiso:/#

arch-chroot-2

You now want to mount your existing installation of Arch. This means you will be given a prompt which is operating on your existing Arch Linux installation.

You achive this by first listing your drives also known as block devices. Always list your drives before mounting them, as the drives do not always show in the same order.

root@archiso:/# lsblk

Next mount your parition which contains your existing Arch installation.

root@archiso:/# mkdir /mnt/arch
root@archiso:/# mount /dev/sda1 /mnt/arch

Note that you need to use the correct partition above. It will not always be partition sda1.

Next you will use a special command which will load you into your existing Arch install and drop you into a root prompt.

root@archiso:/# arch-chroot /mnt/arch

You now will be able to run commands on your existing system to diagnose and fix the problem.

The most obvious solution to fix most problems is to run a fresh update and upgrade on your system to install newer software which might fix an existing bug and also to reinstall or finish installing any failed upgrades from before.

root@archiso:/# pacman -Syu

arch-chroot-1

Good luck!


Share Tweet Send
0 Comments
Loading...
You've successfully subscribed to Linux Developer
Great! Next, complete checkout for full access to Linux Developer
Welcome back! You've successfully signed in
Success! Your account is fully activated, you now have access to all content.