Installing Arch Linux Manually: Accidentally Mounted Wrong Root Partition
In this article, we will discuss the steps to install Arch Linux manually and the consequences of accidentally mounting the wrong root partition.
Table of Contents
- Preparation
- Booting the Live Environment
- Partitioning the Disk
- Mounting the Partitions
- Chroot into the New System
- Install the Base System
- Configuring the System
- Accidentally Mounting the Wrong Root Partition
Preparation
Before you start the installation process, make sure you have the following:
- A system with at least 2GB of RAM
- A USB flash drive or a DVD with the Arch Linux ISO image
- A partition scheme for your hard drive (e.g., MBR or GPT)
- At least one partition formatted with a Linux filesystem (e.g., ext4) for the root filesystem
Booting the Live Environment
- Boot your system from the Arch Linux ISO image.
- Select the language and keyboard layout.
- Choose the graphical installer (Bootx64.efi) or the text-based installer (linux).
Partitioning the Disk
- In the terminal, run
lsblkto list the available disk partitions. - Create a swap partition (e.g.,
/dev/sda5) using a tool likefdiskorparted. - Create the root filesystem partition (e.g.,
/dev/sda6). - Format the root filesystem partition with the desired filesystem (e.g.,
mkfs.ext4 /dev/sda6).
Mounting the Partitions
- Mount the root filesystem partition (
mount /dev/sda6 /mnt). - Mount the EFI system partition (
mount /dev/sda1 /mnt/boot/efiif you have one). - Mount the swap partition (
swapon /dev/sda5).
Chroot into the New System
- Install the base system packages (
arch-chroot /mnt). - Set the timezone (
ln -sf /usr/share/zoneinfo/America/Los_Angeles /etc/localtime). - Generate the fstab file (
nano /mnt/etc/fstab).
Install the Base System
- Install the base system packages (
pacstrap /mnt base linux linux-firmware). - Generate the fstab file (
genfstab -U /mnt >> /mnt/etc/fstab). - Switch root to the new system (
arch-chroot /mnt).
Configuring the System
- Set the hostname (
echo 'HOSTNAME=myhostname' > /etc/hostname). - Configure the locale (
nano /etc/locale.genandlocale-gen). - Configure the system time (
hwclock --systohc). - Set the root password (
passwd). - Configure the network (
nano /etc/netctl/eth0andnetctl enable eth0). - Configure the bootloader (
bootctl --path=/boot).
Accidentally Mounting the Wrong Root Partition
In this example, we accidentally mounted the root partition of an existing Pop!_OS! installation on the second drive during the Arch Linux installation process.
- Mount the wrong root partition (
mount /dev/sda7 /mnt). - Proceed with the Arch Linux installation process.
- After rebooting the system, you will find yourself in the Pop!_OS! environment instead of the newly installed Arch Linux system.
Summary
- Installing Arch Linux manually requires careful planning and execution.
- Accidentally mounting the wrong root partition can lead to unexpected results.
References