Arch is very stable, and highly customizable linux distro. You will like it if you want to build your OS up from scratch.
Prepare partition
You can use gparted from Ubuntu Live CD or another GUI tool to create root, home, and swap partitions. Or you can follow the following instruction.
Login as root.
# cgdisk /dev/sda
Create root partition
- Hit New -> Enter
- First Sector -> Enter
- Size in Sector -> 15GB -> Enter
- Hex Code of GUID (L to show codes, Enter = 8300) -> Enter
- Enter partition name – > Enter
- Now you will see a 15GB partition has been created.
Create swap partition
Use keyboard and select Free Space. If your RAM is 2GB, then you need 4GB or swap space. Swap space is extra memory for when you suspend your computer.
- Hit New -> Enter
- First Sector ->
- Size in Sector -> 4GB -> Enter
- Hex Code of GUID (L to show codes, Enter = 8300) -> Enter
- Enter partition name – > swap
Swap has been created.
Creating home partition
Use keyboard and select Free Space
- Hit New -> Enter
- First Sector -> Enter
- Size in Sector -> 40GB -> Enter
- Hex Code of GUID (L to show codes, Enter = 8300) -> Enter
- Enter partition name – > home -> Enter
Once ok select ‘Write‘. Type ‘yes‘ if you are sure, and then select ‘Quit‘.
Check the structure of partition by running this command:
# lsblk
You will see your hard-disk structure as follows:
sda1 – root
sda2 – swap
sda3 – home
Create file system
Format root and home
# mkfs.ext4 /dev/sda1
# mkfs.ext4 /dev/sda3
Format swap space
# mkswap /dev/sda2
# swapon /dev/sda2
Double-check your format
# lsblk /dev/sda
Install & Configure Base System
Mount drives
# mount /dev/sda1 /mnt
# mkdir /mnt/home
# mount /dev/sda3 /mnt/home
Install base packages
# pacstrap -i /mnt base base-devel
Configure Mounting
# genfstab -U -p /mnt >> /mnt/etc/fstab
Check if all looks good:
# nano /mnt/etc/fstab
Configure System
Log as root in the partition. This is a very important step that you install stuff on your newly created parition and not in the Live CD OS which will be removed when you log out.
# arch-chroot /mnt
Setup Locale
# nano /etc/locale.gen
Uncomment this:
en_AU.UTF-8 UTF-8
# locale-gen
# echo LANG=en_AU.UTF-8 > /etc/locale.conf
# export LANG=en_AU.UTF-8
Set up timezone
# ls /usr/share/zoneinfo/
# ln -s /usr/share/zoneinfo/Australia/Melbourne> /etc/localtime
You must adjust the country and city according to yours.
Set up Clock
# hwclock --systohc --utc
Prepare Users
Set your root password:
# passwd
Add a sudoer user. Change the last word with your username:
# useradd -m -g users -G wheel,storage,power -s /bin/bash linuxcircle
# passwd linuxcircle
Install Sudo
# pacman -S sudo
# pacman -Ss sudo
# EDITOR=nano visudo
Ucomment this line:
%wheel ALL=(ALL) ALL
Install Bootloader
# pacman -S grub
# grub-install --target=i386-pc --recheck /dev/sda
# pacman -S os-prober
# grub-mkconfig -o /boot/grub/grub.cfg
# pacman -S os-prober
Setup Network
If you are running eth cable.
# systemctl enable dhcpcd.service
# systemctl start dhcpcd.service
If you are running wifi
# pacman -S wireless_tools wpa_supplicant wpa_actiond dialog # wifi-menu
Chose your wifi access point, then enable it on boot.
# systemctl enable network-wireless@wlan0.service # systemctl start network-wireless@wlan0.service
Final Steps
# exit
Unmount the root, home and reboot the system:
# umount -R /mnt
# reboot