Step Up with Arch Linux – Part I

Share

Installing Arch Linux (Dual Boot with Windows, UEFI, Over WiFi, Using btrfs File System)

 

Arch Linux is started by Judd Vinet in March, 2002. Arch is a operating system which is using rolling release model to update the system. So once you install the system, you don’t need to re-install the system to upgrade to new system. Arch will allows you to upgrade the system while you’re inside the system. There’s no need to even restart.

Anyway Arch is a powerful OS and with this one, you could learn how an OS is working. And also you will learn that format and re-install is not the real way to solve a problem by using Arch Linux. You’re the one who install everything in here. There’s no any automatic method so you know how you have created the OS and so you know when you’re facing an error where’s the problem. It’s a light weight OS as you are installing it.

Since this article is going to instruct you to install Arch in UEFI mode, insert your bootable disk or device which is created as GPT bootable.

02
Figure 1

Go to Boot Arch Linux (x86_64). Then it will be boot into Arch Linux console.

03
Figure 2

Now follow following steps to install Arch Linux

 Since you’re having pre-installed Windows operating system, it will be easy if you create a partition to use in Linux, once you’re inside Windows. Otherwise, use gdisk /dev/sda command to create your partition. Use following commands to get partition information, so you can obtain the partition numbers that you’re going to work with.

# gdisk -l /dev/sda

From now on, X will be your partition number. First, format the disk with btrfs file system by using following command.

# mkfs.btrfs -L “Arch Linux” /dev/sdaX

If you’re going to have a swap partition, use following commands to create swap partition.

# mkswap /dev/sdaX
# swapon /dev/sdaX

Then mount the root and home using following commands. You can use different partitions if you want. If you have only one partition, you can use it for both root and home.

# mount /dev/sdaX /mnt
# mkdir /mnt/home
# mount /dev/sdaX /mnt/home

To install Arch Linux, you need to connect with internet. LAN connection has nothing to be configured but WiFi does. So here’s the way to connect using WiFi. Use the  following commands and select your WiFi connection. Enter a name and the password too.

# wifi-menu

If your connection needs proxy configuration, use following commands to insert proxy.

# export http_proxy='http://proxy_address:proxy_port'
# export https_proxy='http://proxy_address:proxy_port'
# export ftp_proxy='http://proxy_address:proxy_port'
# export rsync_proxy='http://proxy_address:proxy_port'

 Now install base system using following command.

# pacstrap -i /mnt base
04
Figure 3

Press enter to select all.

05
Figure 4

Enter Y and press enter to begin the installation. Then the base will be installed.

06
Figure 5

Now use following commands to mount your EFI partition.

# mkdir /mnt/boot/efi
# mount /dev/sdaX /mnt/boot/efi

Use the command below to generate fstab.

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

Now change root to newly installed OS using following command.

# arch-chroot /mnt

Now we have to install packages which will be needed in order to connect with the WiFi at the next reboot. You can do it with the following command.

# pacman -S dialog wpa_supplicant      

Now edit your system language using below. Uncomment en_US.UTF-8 to add English (you can add other languages too in a similar way). At the end, Ctrl + O to write out changes and press Enter then press Ctrl + X to exit form the editing prompt.

# nano /etc/locale.gen
# locale-gen
# echo  LANG=en_US.UTF-8 > /etc/locale.conf
# export LANG=en_US.UTF-8

Now set your timezone….

# ln -s /usr/share/zoneinfo/Asia/Colombo /etc/localtime
# hwclock –systohc –utc

Add your hostname….

# echo yourHostName > /etc/hostname

Edit pacman.conf file using following command and uncomment multilib section to use 32bit repositories such as skype.

# nano /etc/pacman.conf

Now update package database.

# pacman -Sy

Now set root password..

# passwd

Install and configure grub2 boot manager using following commands.

# pacman -S grub efibootmgr
# grub-mkconfig -o /boot/grub/grub.cfg

Install grub for your hard disk.

# grub-install /dev/sda

Now check if the boot loader is installed or not..

# ls -l /boot/efi/EFI/arch/

Then exit, unmount and reboot using following commands.
# exit
# umount -R /mnt
# reboot

Log on to root account using user name root and using the password that you have entered at the installation. Then use wifi-menu command to connect to WiFi and use following commands to enable dhcpcd.

# systemctl enable dhcpcd
# systemctl start dhcpcd

Now add your user account using following commands. I recommend you to have different password to this account for security purposes.

# useradd -m -a /bin/bash yourUserName
# passwd yourUserName

And insert the password. Console will not display what you are typing as the password. Now to allow the new user to get root access, install sudo and edit sudoers file using following commands.

# pacman -S sudo
# EDITOR=nano visudo

Now add the following line after the line root ALL=(ALL)ALL.

yourUserName ALL=(ALL)ALL

Now install these packages using following commands. Just press enter to install default packages.

# pacman -S xorg xorg-server-utils xorg-xinit
# pacman -S mesa ttf-dejavu alsa-utils pulseaudio

After that, I plan to install gnome as the DE of Arch Linux. You can use other DEs such as KDE, xfce or else.

# pacman -S gnome gedit

 Now stop dhcpcd service and start NetworkManager service using following commands.

# systemctl disable dhcpcd
# systemctl stop dhcpcd
# systemctl enable NetworkManager
# systemctl start NetworkManager

Then start gnome display manager service to use gnome DE using these commands.

# systemctl enable gdm
# systemctl start gdm

  Now, installing Arch Linux is completed. Then we have to add windows to grub boot loader. Use the following commands to do so.

# pacman -S os-prober
# grub-mkconfig -o /boot/grub/grub.cfg

Restart your system and check whether your boot loader works properly. Now you can use normal WiFi Menu to connect to WiFi.

Finally install ntfs-3g package so you can mount any windows partition inside Arch Linux.

# pacman -S ntfs-3g

If you have any problem or any suggestion to improve this article, please comment here or send an email to students.blog@fos.cmb.ac.lk.

 

Since we have installed Arch Linux, we’re going to instruct about the ways to use Arch Linux in our next articles. So keep in touch with us.

 

Thank you. 🙂

 

 

 

 
Tagged : / /