Unmount the incorrect root partition immediately to prevent data corruption, then verify your block devices using lsblk or fdisk -l to identify the correct target. Re-mount the intended partition to /mnt, ensure all subvolumes and swap are correctly configured, and proceed with pacstrap to install the base system on the proper storage.
Immediate Recovery Steps
When you realize you have mounted the wrong drive as/mnt during an Arch Linux installation, the first priority is to stop any write operations. If you have already run commands like pacstrap or genfstab, those changes are now written to the wrong disk. You must reverse these actions carefully to avoid bricking the unintended system.
First, unmount the incorrectly mounted partition. Use the following command to detach it from the mount point:
umount /mnt
If the system reports that the device is busy, check for active processes using fuser -vm /mnt and terminate them if safe, or simply reboot into a live environment to ensure a clean slate. Once unmounted, do not attempt to reinstall packages on this disk unless you intend to wipe it completely.
Next, identify the correct partition. Booting from the Arch ISO again provides the safest environment for this diagnostic step. Use lsblk to display the tree of block devices. Look for the partition that matches your desired size, filesystem type (typically ext4, btrfs, or xfs), and label. Avoid relying solely on device names like sda1 or nvme0n1p2, as these can change between boots or across different hardware configurations. Instead, use persistent identifiers found in /dev/disk/by-id/ or /dev/disk/by-uuid/.
Re-mounting the Correct Partition
After confirming the correct partition identifier, mount it to/mnt. This is the standard mount point expected by the Arch installation scripts. For example, if your correct partition is /dev/sdb2, the command would be:
mount /dev/sdb2 /mnt
If you are using BTRFS or LVM, additional steps are required before mounting the root filesystem. For BTRFS, you might need to mount a specific subvolume using the -o subvol=root option. For LVM, ensure the volume group is activated with vgchange -ay before mounting the logical volume.
Verify the mount was successful by running df -h /mnt. The output should show your target partition at the top of the list. At this stage, you should also create necessary directories for boot and home if they were not created during the initial (incorrect) attempt, although re-running these steps is harmless.
mkdir -p /mnt/boot
mkdir -p /mnt/home
Installing the Base System
With the correct partition mounted, you can now proceed with installing the base system. Runpacstrap to install the essential packages. This command will download and extract the core Arch Linux components onto your correctly identified drive.
pacstrap /mnt base linux linux-firmware
This process may take several minutes depending on your internet connection speed. Once completed, generate the fstab file to ensure the system mounts partitions correctly at boot time. Use the -f flag to force generation even if the fstab file already exists from the previous failed attempt.
genfstab -U /mnt >> /mnt/etc/fstab
Review the generated /mnt/etc/fstab file using a text editor like nano or vi. Ensure that the UUIDs listed correspond to the correct partitions. An error here is a common cause of boot failures, so double-check that no entries point to the old, incorrect disk.
Chrooting and Configuration
Finally, chroot into the new system to perform final configuration tasks. This allows you to set the root password, configure the timezone, and install a bootloader.arch-chroot /mnt
Inside the chroot environment, set your locale, timezone, and hostname. Then, install and configure your bootloader (GRUB, systemd-boot, or rEFInd). Remember to update the bootloader configuration to reflect the new kernel parameters if necessary. Exit the chroot, unmount all partitions with umount -R /mnt, and reboot.
Preventing Future Mistakes
To avoid repeating this issue, always verify your partition layout before mounting. Creating a mental map of your drives or writing down the UUIDs beforehand can save significant time. Additionally, consider usingparted or gparted in the live environment to visually inspect partitions before proceeding with the terminal-based installation.
For users migrating systems or dealing with complex drive setups, understanding how partitions interact is crucial. You might find it helpful to review guides on managing package lists and mounted drives to better understand the underlying storage structure.
Migrating Arch Linux to a New Machine: Installing listpacman AUR packages and mounted drives
Similarly, if you encounter issues with partition deletion or SSD management, referring to troubleshooting articles on installation failures can provide broader context on disk management best practices.
SSD Installation Failed: Deleting Partitions Prevented Ubuntu Installation
Frequently Asked Questions
What happens if I ran pacstrap on the wrong disk?
You have installed a partial Arch Linux system on an unintended drive. You should unmount it immediately and decide whether to wipe the drive entirely or leave it as is if it contains other data. Do not attempt to fix the installation on that disk; start over on the correct partition instead.
Can I use lsblk to find my USB installer drive?
Yes, but be careful not to unmount or format the installer drive itself. The installer is usually small and located on a separate USB stick. Identify your target internal drive by its larger capacity and lack of "removable" flags in the lsblk output.
Why does genfstab show the wrong UUID?
This usually happens if you mounted the wrong partition initially. Always verify the UUID in /etc/fstab against the output of blkid or lsblk after mounting. If they mismatch, edit the fstab file manually to correct the identifier before rebooting.
Is it safe to reboot without fixing the fstab?
No, rebooting with an incorrect fstab can lead to a kernel panic or a drop to emergency shell because the system cannot find the root filesystem. Always validate the fstab entries within the chroot environment before exiting and rebooting.
How do I verify I am in the correct chroot?
Check the mount points inside the chroot using mount | grep /mnt. Ensure that the root directory corresponds to the partition you intended to install on. You can also check the size of the installed files with du -sh / to confirm it matches a fresh base installation.