Installation guide

From ArchWiki
Revision as of 19:52, 18 July 2012 by Emiralle (talk | contribs) (Add intro.)
Jump to: navigation, search

The Arch Install Scripts are a set of Bash scripts that simplify Arch installation. This article summarizes a basic install process using these scripts.

Partition disks

There are many utilities to use for the partitioning of disks such as fdisk, parted, cfdisk etc. Pick one you are most familiar with. Remember to create any stacked block devices like LVM, LUKS, or RAID.

Format partitions

mkfs is a nice utility for formatting the partitions into filesystems of your choosing. By typing mkfs and hitting Tab you will see all the available choices. For example let's say we created three partitions sda1, sda2 and sda3. The corresponding commands can be found in the table below.

Partition Mountpoint mkfs command
/dev/sda1 /boot mkfs.ext4 /dev/sda1
/dev/sda2 / mkfs.ext4 /dev/sda2
/dev/sda3 /home mkfs.ext4 /dev/sda3

Mount the partitions

Given the above example, we now must mount the root partition on /mnt.

# mount /dev/sda2 /mnt

Next we create directories for any other partitions into /mnt and then we mount them.

# mkdir /mnt/boot && mount /dev/sda1 /mnt/boot

Same with /home

# mkdir /mnt/home && mount /dev/sda3 /mnt/home

Connect to the internet

Assuming a wired connection, running dhcpcd is sufficient to get a lease. For more info visit configuring network.

Install the base system

Using the pacstrap script we install the base system.

# pacstrap /mnt base{,-devel} 

One can install other packages appending their names to the above command (space seperated).

Install a bootloader

# pacstrap /mnt syslinux
# pacstrap /mnt grub

Configure system

Generate an fstab with the following command.

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

Next we chroot into our newly installed system.

# arch-chroot /mnt
  • Write your hostname to /etc/hostname.
  • Symlink /etc/localtime to /usr/share/zoneinfo/Zone/SubZone. Replace Zone and Subzone to your liking. For example
# ln -s /usr/share/zoneinfo/Europe/Athens /etc/localtime
  • You may want to add locale preferences to /etc/rc.conf or /etc/locale.conf.
  • Uncomment your preferred locales from /etc/locale.gen and generate them with locale-gen.
  • Configure /etc/mkinitcpio.conf as needed (see mkinitcpio) and create an initial ramdisk with
# mkinitcpio -p linux
  • Configure the bootloader.
  • For syslinux edit the /boot/syslinux/syslinux.cfg to point to the right /boot partition. Then type the following command to install (-i), set boot flag (-a) and install mbr (-m).
# /usr/sbin/syslinux-install_update -iam
  • Set a root password with passwd.

Unmount the things you mounted

If you are still in the chroot environment then type exit or Ctrl+D in order to exit chroot. In step 3 we mounted the partitions under /mnt. In this step we will unmount them.

# umount /mnt/boot
# umount /mnt/home
# umount /mnt

Finally reboot and configure your system as explained in Beginners' Guide/Post-Installation.