Chrooting into an Arch Linux Installation for Repair

1. List Block Devices

First, identify your block devices and partitions to determine the correct ones to mount:

$ lsblk

Example output:

NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
sda           8:0    0 931.5G  0 disk
├─sda1        8:1    0  531M  0 part
├─sda2        8:2    0    8G  0 part
├─sda3        8:3    0 342.6G  0 part
└─sda4        8:4    0 580.4G  0 part 
nvme0n1     259:0    0 465.8G  0 disk
├─nvme0n1p1 259:1    0 1000M  0 part /boot/efi
├─nvme0n1p2 259:2    0 447.7G  0 part /
└─nvme0n1p3 259:3    0  17.1G  0 part [SWAP]

2. Boot from Arch ISO

Boot your system using an Arch Linux installation USB (archiso).

3. Mount the Filesystems

To access your Arch installation, mount the necessary filesystems:

# Mount root partition
mount -t ext4 /dev/nvme0n1p2 /mnt

# Mount the boot partition
mount /dev/nvme0n1p1 /mnt/boot

# Mount temporary API filesystems
mount -t proc /proc /mnt/proc
mount -t sysfs /sys /mnt/sys
mount -o bind /dev /mnt/dev
mount --bind /run /mnt/run

Note: The -t option specifies the filesystem type (e.g., ext4, proc, sysfs).

4. Ensure Network Connectivity

To ensure network connectivity inside the chroot environment:

cp -L /etc/resolv.conf /mnt/etc/resolv.conf

5. Chroot into the Mounted Environment

Finally, chroot into your installed system:

chroot /mnt /bin/bash

You are now in your system’s environment and can perform repairs or updates as needed.