Skip to content

Arch installation

Eduardo Flores edited this page Oct 8, 2024 · 4 revisions

This is the method I find most convenient for installing Arch in my personal desktop. Yours may vary slightly, but this is what I usually follow. Official installation guide: Arch Wiki.

Disclaimer: Read everything from the official guide; don't assume anything from this one. The installation depends on your specific system.

Verification

To check the boot mode:

# cat /sys/firmware/efi/fw_platform_size

To test your internet connection:

# ping google.com

Partitioning, Formatting, and Mounting

Partitioning

I recommend using # cfdisk with the GPT label for this step.

You'll need three partitions:

  1. Boot (300MiB or > 1 GiB if installing multiple kernels)
  2. Swap (Half your RAM is more than enough; if planning on hibernating, use your full RAM)
  3. Root (Use the rest of the available space)

Formatting

  1. # mkfs.ext4 /dev/[root_partition]
  2. # mkswap /dev/[swap_partition]
  3. # mkfs.fat -F 32 /dev/[efi_system_partition]

Mounting

  1. # mount /dev/[root_partition] /mnt
  2. # mkdir -p /mnt/boot/efi
  3. # mount /dev/[efi_system_partition] /mnt/boot/efi
  4. # swapon /dev/[swap_partition]

Installation

Install your desired packages, for example:

# pacstrap -K /mnt base linux linux-firmware base-devel grub efibootmgr networkmanager intel-ucode nano

If the installation fails, do # pacman -Sy archlinux-keyring and then repeat the above command.

Configuration

Fstab

Generate an fstab:

# genfstab -U /mnt >> /mnt/etc/fstab

Change root

To change root into the new system:

# arch-chroot /mnt

Time

Set the timezone:

# ln -sf /usr/share/zoneinfo/[Region]/[City] /etc/localtime

Run:

# hwclock --systohc

Localization

Uncomment your needed locales from /etc/locale.gen, for example:

en_US.UTF-8 UTF-8
es_MX.UTF-8 UTF-8

Then run:

# locale-gen

Language

Set it by editing /etc/locale.conf and adding one of the previous locales, for example:

LANG=en_US.UTF-8

Similarly, set your keyboard layout:

# loadkeys [layout]

You can see available layouts with # localectl list-keymaps. Edit /etc/vconsole.conf and set it there, for example:

KEYMAP=la-latin1

Hostname

Edit /etc/hostname and add your hostname there.

Root password

Set a password:

# passwd

User

Create a user:

# useradd -m -G wheel -s /bin/bash [name]

# passwd [name]

Add the user to the sudoers by uncommenting the %wheel ALL=(ALL) ALL section:

# EDITOR=nano visudo

Network

Enable the network service to have internet access:

# systemctl enable NetworkManager

Bootloader

Install GRUB:

# grub-install /dev/[device]

Then enable os-prober by editing /etc/default/grub and uncommenting #GRUB_DISABLE_OS_PROBER=false.

Finally, update the configuration:

# grub-mkconfig -o /boot/grub/grub.cfg

Last steps

Exit the chroot environment by typing # exit, unmount all partitions with # umount -a, and finally # reboot.

Dual Boot

If you have Windows already installed on another drive and want to make it accessible via GRUB:

  1. Install os-prober package, which searches for other installed systems (# pacman -S os-prober).
  2. Use fdisk -l or similar to identify the EFI partition from Windows, example:
$ fdisk -l

Disk /dev/sdb: 223.57 GiB, 240057409536 bytes, 468862128 sectors
Disk model: KINGSTON SA400S3
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 5693B4F1-3895-4A2F-9EB7-1360A1A59564

Device         Start       End   Sectors   Size Type
/dev/sdb1       2048    206847    204800   100M EFI System  <- This one!
/dev/sdb2     206848    239615     32768    16M Microsoft reserved
/dev/sdb3     239616 467739037 467499422 222.9G Microsoft basic data
/dev/sdb4  467740672 468858879   1118208   546M Windows recovery environment
  1. Mount the EFI partition (# mount /dev/[efi_system_partition] /mnt).
  2. Run sudo os-prober to check if it detects the Windows system.
  3. Reload the GRUB config file with # grub-mkconfig -o /boot/grub/grub.cfg.

Clone this wiki locally