Arch Linux is a general-purpose Linux distribution for x86-64 computers and is very popular among the intermediate and advanced Linux users. It is free and open-source software. In this blog, we will check out how to install Arch Linux by setting software RAID 1.
Install Arch Linux
Download the iso
We can download the latest version of OS from the Arch Linux official website
Setup bootable USB and Boot from it
Setup a bootable USB or CD using the downloaded iso.
Power on the system and press F2 or F11 (Depends on the motherboard) to change/select the boot order.
Select the boot option accordingly to boot from the USB or CD drive.
Once the system boots, you will get an OS installer screen.
Choose Boot Arch Linux (x86_64) from the installer screen and then press Enter.
After various checks performed, you will get a root login prompt.
Setup the Network
You need internet connectivity to continue installing OS on the system. If you are using a DHCP environment system will detect the network automatically. If you are using a static IP address, you need to configure it manually as mentioned below:
ip addr flush dev enp1s0
ifconfig enp1s0 126.96.36.199 netmask 255.255.255.0
route add default gw 188.8.131.52
echo "nameserver 184.108.40.206" >> /etc/resolv.conf
Replace network card and IP address according to your network environment.
Partition the Disks
Here we need to setup Software RAID 1 which means data mirroring. You can check out more details about Software RAID and its setup using below links:
We are using mdadm command to setup RAID among disk. To create Software RAID 1 we use below command:
mdadm --create /dev/md0 --level=mirror --raid-devices=2 /dev/sd[a-b]1
Here we create a Raid device called /dev/md0. You can change the name according to your need.
Then we use the parted command to create partitions. Please don’t copy paste the exact commands as I mentioned below. You have to modify the device name and other things according to your system.
mklabel msdos #(Create an MS-DOS disk label)
mkpart primary ext4 1MiB 500MiB #(Creating a 500 MB partition for /boot)
set 1 boot on
mkpart primary linux-swap 500 MiB 8.5G #(Creating an 8 GB partition for swap)
mkpart primary ext4 8.5G 100% #(Set the remaining space for / partition)
quit (Exit from parted)
To see partition changes run below command:
fdisk -l /dev/md0
Create the Filesystem
Format the created partitions with the file systems you need
Mount the Partitions
Then we need to mount the partitions to desired mount points.
mount /dev/md0p3 /mnt
mkdir -p /mnt/boot
mount /dev/md0p1 /mnt/boot
If you have additional partitions you can mount the respective directories on /mnt. For Ex:
/home1 partition needs to be mounted on
Install Arch Linux Base System
Run below command to Install Arch Linux
pacstrap /mnt/ base base-devel
The installation will take at least 10 to 20 minutes depending upon your network speed.
Create fstab Entries
Once the installation completed we need to create fstab entries for the installed OS.
genfstab -U /mnt > /mnt/etc/fstab
nano /mnt/etc/fstab (replace UUIDs with device name. Ex:
Update mdadm conf
Now update the mdadm conf file to the installed OS to save the Raid configuration we have created.
mdadm --detail --scan --verbose >> /mnt/etc/mdadm.conf
Configuration Arch Linux System
To configure Arch Linux we need to chroot to the new system. The chroot changes the root directory for the currently running process.
Set System Language & Time
Configure the system language by un-commenting the required languages from locale.gen file.
vi /etc/locale.gen #(Uncomment en_US.UTF-8 UTF-8 for American-English.)
locale-gen #(Generate the locale)
Set the system locale by using the LANG variable in /etc/locale.conf file.
echo "LANG=en_US.UTF-8" > /etc/locale.conf
Configure the system time zone by creating a symlink.
ln -sf /usr/share/zoneinfo/US/Central /etc/localtime
Set the hardware clock to UTC.
hwclock --systohc --utc
Set root password
Use passwd command to set the root password
Work on some grub stuff
We need to install GRUB at first
pacman -Sv grub
nano /etc/default/grub #(Uncomment GRUB_DISABLE_LINUX_UUID=true)
Now edit mkinitcpio.conf file. Add mdadm_udev to HOOKS and /sbin/mdmon to BINARIES
HOOKS="base udev autodetect modconf block mdadm_udev filesystems fsck"
Regenerate the file to reflect changes
mkinitcpio -p linux
Install GRUB Boot Loader
grub-install /dev/sda && grub-install /dev/sdb
grub-mkconfig -o /boot/grub/grub.cfg
Now we need to create a hostname for the system by adding an entry in the /etc/hostname file
echo your-hostname > /etc/hostname
The installation has been completed. Now its time to reboot the system and boot it to the newly installed OS
Exit from chroot and perform the Reboot
The system will boot to the installed OS after the reboot. You can use root as username and password you have provided during the setup process to log in.
” margin_top=”50px” margin_bottom=”” animation_type=”slide” animation_direction=”left” animation_speed=”0.3″ class=”” id=””]