Boot using arch ISO live cd or usb

if you want to install from USB then follow as below

1. download latest arch as ISO

2. if you are using windows then download usbwriter
http://sourceforge.net/p/usbwriter/wiki/Documentation/

if you are using linux then use dd

dd if=image.iso of=/dev/sdb bs=4M

Boot using installation media i.e USB

arch_linux_install

Select x86_64 if you want 64 bit installed (preferred) otherwise select i686 for 32 bit version and press enter

After booting you will see following

fdisk

use fdisk to see available disks, in above you can see I have 60GB hard drive as /dev/sda

Partitioning:

If you are setting up your system first time, you need to create partitions. If partitions already created then you will need to adjust them.

It is recommended to use three partitions for linux. One for root or linux system and second for swap and third for user space i.e home directory.

You can delete a partition and then create 3 partitions from it, if you have partitions already created or you can select existing partitions to install.

I am going with cfdisk to create MBR style partitions on an empty disk. If you need GPT style partitions then you can use cgdisk.

dos

Type cfdisk and select dos

Create a new partition for root (containing your linux OS)

new-partition

Select New and hit enter

root-partition

Enter root partition size. 10 GB is enough. If you want to install lots of software then increase as you want. I am intended to use Linux as my primary OS so I am gonna make it 27G.

Select Primary on next screen

primary

Hit enter and select newly created partition. It has created /dev/sda1 as root partition for me, select Bootable from menu and hit enter to make root partition bootable.

makebootable

Creating Swap Partition (Swap helps great in performance if you don’t have large ram or installing it in VM)

new-parition-swap

Select new and hit enter to create a new partition for swap

swap

Set swap partition size. 2GB is enough. If you have low ram and heavy load then you can select 3 or 4G. I want 3GB so I selected 3G.

swap-primary

Mark your swap partition as primary and hit enter.

Create extended partitions

We are all set with root and swap partitions. Now we are going to create a home partition where linux will store all user data and config files as well as I will store my documents, music, files, downloads etc. I will mark remaining diskspace as extended to create further partitions as extended instead of primary.

new-extended

Hit new to create extended partitions

extended-partition-size

I want to have 30GB size for extended partitions so I write 30G and hit enter, you can give the desired partitions size and hit enter.

make-extended

Extended is best way to group your partitions so you can shrink or extend later with other partitions.
Extended just marks the next partitions as extended instead of primary, so now we create actual home partition inside extended area.

If you want a primary partition instead then you don’t need to create an extended partition, rather directly create primary partition.

Create Home partition inside the extended partitions group

create-home

Select Free space and New and hit enter to create new partition as home.

home-partition-size

I want whole remaining space as home partition, you can give the desired size if you want to have more than one partitions like one partition for home and other for data and other for music. To create multiple partitions repeat above steps.
Hit enter and it will create a new partition as /dev/sda5

write-paritions

Now my all partitions are created, its time to save partition structure to hard disk, select Write and hit enter.

yes-parition-write

Write yes when it asks for confirmation and hit enter.

quit-partitions

After writing partitions structure to hard disk, just quit the cfdisk.

Verify partitions

Again type fdisk -l to view your newly created partitions.

all-paritions

Formatting your partitions 

Its time to format our partitions so linux can use them.
Formatting root partition.

# mkfs.ext4 /dev/sda1

formatting_ext4_root

Root formatted

formated-root

Formatting home partition

# mkfs.ext4 /dev/sda5

format-home

Home formatted

formated-home

Making Swap

We have formatted partitions, now we are going to setup swap partition.
We have created /dev/sda2 as swap partition of 3GB, so we are now marking that partition as swap so linux would be able to use that as swap area.

# mkswap /dev/sda2
# swapon /dev/sda2

creating-swap

Mounting your partitions

Linux can use only those partitions which are mounted. So we need to mount our partitions specifically.

Mount root partition.

# mount /dev/sda1 /mnt

mount-mnt

Mount home partition.

# mkdir /mnt/home
# mount /dev/sda5 /mnt/home

mount-home

Start Install

Hard disk all setup, now forward to install linux.

Select a mirror list:

During installation linux will download files from internet, it is recommended that you select nearest mirror to get fast downloads

# nano /etc/pacman.d/mirrorlist

edit-mirror

find your country or nearest one in file by pressing ctrl+w and type your country name and hit enter

copy whole line using alt+6 and now go to start by using pageup button or home button on keyboard

paste that line on the top of file using ctrl+u

mirrorset
now save the file using ctrl+x and enter y to save

Testing your internet connection

Test your internet connection by pinging the google.com

# ping -c 3 www.google.com

verify-network

Installing base arch linux

# pacstrap -i /mnt base

if you want to build packages then you should need

# pacstrap -i /mnt base base-devel

setting-up-pacstrap

pacstrap

Hit Enter and it will show the screen below

pacstrap-1

Hit enter and it will start downloading and installing.

Generate an fstab

linux needs to store partitions and mount information for future use to auto mount drives

lets generate that configuration file

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

to make sure file has been create correctly please use following

# nano /mnt/etc/fstab

fstab

Enter to new arch linux environment

# arch-chroot /mnt

chroot

Set your locale

edit locales file

# nano /etc/locale.gen

and uncomment your locale

I uncomment en_US.UTF-8 UTF-8 for english

localegen

Generate the locale(s) specified in /etc/locale.gen:

# locale-gen

localegenerate

Create the /etc/locale.conf file substituting your chosen locale:

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

Export substituting your chosen locale:

# export LANG=en_US.UTF-8

localesettings

Time zone

Available time zones and subzones can be found in the /usr/share/zoneinfo/Zone/SubZone directories.

To view the available zones, check the directory /usr/share/zoneinfo/:

# ls /usr/share/zoneinfo/

Similarly, you can check the contents of directories belonging to a subzone:

# ls /usr/share/zoneinfo/Asia

Create a symbolic link /etc/localtime to your subzone file /usr/share/zoneinfo/Zone/SubZone using this command:

# ln -s /usr/share/zoneinfo/Zone/SubZone /etc/localtime

Example:

# ln -s /usr/share/zoneinfo/Asia/Karachi /etc/localtime

localesettings

Hardware clock

Set the hardware clock mode uniformly between your operating systems. Otherwise, they may overwrite the hardware clock and cause time shifts.

# hwclock --systohc --utc

Hostname

Set the hostname of your computer (e.g. arch):

# echo arch > /etc/hostname

hostname

Configure your net work

If you prefer wifi:

# pacman -S iw wpa_supplicant dialog wpa_actiond
# wifi-menu
# systemctl enable netctl-auto@interface_name.service

If you prefer lan then do following

# systemctl enable dhcpcd@interface_name.service
example:
# systemctl enable dhcpcd@enp0s3.service

To find your interface name you can use either

# ip link
or
# ls /sys/class/net

You will see your device name as some thing like “enp0s3”

Note: In vm you might not be able to see the wireless as VM provides you network connectivity using your ethernet.

network-setup

Finishing base installation

Set the root password with:

# passwd

root-password

Now it’s time to create a user for the system and also add some groups to it.

So run the following command and replace ‘tofeeq‘ with your user-name.

# useradd -m -g users -G wheel,storage,power -s /bin/bash tofeeq

add a password to tofeeq

# passwd tofeeq

user-create

Once that is done, we will now allow the users in wheel group to be able to performance administrative tasks with sudo. Run the following command to edit the sudoers:

# EDITOR=nano visudo

editor

It will open the sudoers file where you have to uncomment this line:

%wheel ALL=(ALL) ALL

wheel

I will also recommend installing bash-completion so that Arch auto-complete commands of names of packages:

# pacman -S bash-completion

Install boot loader

GRUB

Install the grub package and then run grub-install to install the bootloader:

# pacman -S grub

grub-install

# grub-install --target=i386-pc --recheck /dev/sda
# pacman -S os-prober

grubsetup

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

generating-grub

Basic Installation finished, Reboot

# exit
# reboot

exitandreboot

After rebooting it will get you following screen.

restarted

Provide login username and password and switch to root mode for further installations.

userlogin

Installing display managers

install xserver

# pacman -S xorg xorg-server xorg-server-utils xorg-xinit

Now we will also install mesa for 3D support:

# pacman -S mesa

It’s time to install video drivers. I am using intel graphic card so would be using

# sudo pacman -S xf86-video-intel intel-dri

If you are not using intel then you might explore

https://wiki.archlinux.org/index.php/General_recommendations

If you are using a laptop you need to install the drivers for input devices like touch-pad

# pacman -S xf86-input-synaptics
# pacman -S xorg-twm xorg-xclock xterm

You can install all at once using following

# pacman -S xorg xorg-server xorg-server-utils xorg-xinit mesa xf86-video-intel intel-dri xf86-input-synaptics xorg-twm xorg-xclock xterm

install-xorg

It will ask you to confirm, just hit enter and continue

xorg-install

It will now keep installing

xorg-installed

Install Desktop Environment

I choose gnome as my desktop environment, If you want to install any other then follow this link

# sudo pacman -S gnome gnome-extra

gnome-install

Hit enter and continue

Starting gnome

Exit to normal user from root

exit-to-user

Add gnome to your .xinitrc file

$ nano ~/.xinitrc

add-gnome-session

press ctrl + x and hit enter.

Start gnome

$ startx

startx

You will see a graphical interface of arch linux as gnome is running 🙂

gnome-running

Audio management

To have better audio experience open terminal and switch to sudo by typing sudo -i and install alsa and pulse audio

# pacman -S alsa-utils pulseaudio pavucontrol

That’s it start enjoying wonderful arch linux !!!

Please add your comments to make it even more easier.

Advertisements