Arch Linux Installation : Part 2
23 Oct 2020, 09:17pm TZ +05:30
Continuing where we left off in part 1
This is the Part 2 in the series. This part deals with configuration of Software Repositories, partitioning and formatting the disk.
Stage : Configure Repositories [CR] #
We have the internet and setup interface working fine. Now its time to get the software repositories correct. Here we would address the Secure from the beginning part.
CR Step-1. Update the NTP Clocks #
timedatectl set-ntp true # Enable NTP
hwclock --systohc --utc # Update Hardware Clock to UTC
This would help to make sure that the current system is correct. As well the Hardware clock is at UTC.
CR Step-2. Update the Repositories to Latest, Fastest and Secure servers #
We can use the
Reflector
command, which comes preinstalled in the ISO.
reflector --country India,'United States',Japan --age 6 \
--protocol https --sort rate \
--save /etc/pacman.d/mirrorlist
Wait for the command to complete. It takes some time
(or may be long time - depending on your internet connection)
to figure out the best mirrors.
Rest assured they will always be Secure https
repository mirrors.
You can check out the updated repository files here:
|
|
CR Step-3. Update Repositories #
This one is very simple. We have the good old pacman
to help us here.
pacman -Syyy
This would force update all the repositories, no upgrade would be initiated.
Stage : Disk Partitioning [DP] #
With our repositories in order, we are ready to jump into to the next stage. This is probably one of the most crucial stage. If we commit one mistake we have trouble ensued at a later date.
DP Step-1. Listing out the Partitions and Disks #
There are many options here. Based on what you might have installed there can be many different type of disk orientations.
In order to categorize we need to select some common ground.
Assumptions for Disk - Taken here
Note : These assumptions help me to explain the things easily. They should not be taken as the only configuration. Your PC might have different configuration than that mentioned here.
We Assume a 1TB Disk for all Pictures to be the Maximum Capacity
Command to Find out about Disks on Your PC #
lsblk
We use this command to list out all the partitions and disks connected on a given computer.
The Output of this command might look like this:
In this picture there are 3 important pieces of information:
Disk / Partition Name indicated by the
NAME
field. This is important to know when installing since we would need to partition the correct disk. If a wrong disk / partition is selected we might have problems.Size of the respective disk / partition indicted in the
SIZE
field. This is another indicator that helps us decide on which disk we need to make the installation. For example, in this picture we havevda
as the name of the actual disk on the PC. But we also have another USB drive attachedsda
that has57.3G or 64GB
size.Mount point for each of these as indicated in the
MOUNTPOINT
field. In order to perform installation we need to mount their respective partitions in correct locations or the Arch Linux installer would fail. In this picture we only ave CDROM containing the ARCH-ISO image mounted by default at/run/archiso/
.
DP Step-2. Partitioning for UEFI Systems (Recommended) #
Now we would look at how to partition a new disk.
!DANGER! Assumptions - Only one OS on Disk
This installation assumes that you would have only one operating system in your disk. If you wish to have more than one then you need to create the partitions accordingly.
Since we know that we have 1TB
Disk here are a few layout options:
- With Swap:
- EFI: 550MiB
- Swap: 8GiB (for a PC with 8GiB of Ram)
- Root: Rest of the space
- Without Swap:
- EFI: 550MiB
- Root: Rest of the space
Cleaning up existing Partitions #
sgdisk --zap-all /dev/sda
! DANGER ! Disk Wipe Risk
The above command will destroy or erase all data on disk. Use it at your on risk !
We assume that the disk is present at /dev/sda
and is a 1TB
Disk.
Creating Disk Partitions with Swap on UEFI Systems #
One single command to do all the work:
sgdisk --clear \
--new=1:0:+550MiB --typecode=1:ef00 --change-name=1:ArchEFI \
--new=2:0:+8GiB --typecode=2:8200 --change-name=2:ArchSwap \
--new=3:0:0 --typecode=3:8300 --change-name=3:ArchRoot \
/dev/sda
! DANGER ! Disk Damage Risk
The above command will destroy or erase all data on disk. Use it at your on risk !
The above command will create useful labels and partitions in a single command.
Note the --typecode
this specifies what type of partition is created.
Creating Disk Partitions Without Swap on UEFI Systems #
One single command to do all the work:
sgdisk --clear \
--new=1:0:+550MiB --typecode=1:ef00 --change-name=1:ArchEFI \
--new=3:0:0 --typecode=3:8300 --change-name=3:ArchRoot \
/dev/sda
! DANGER ! Disk Damage Risk
The above command will destroy or erase all data on disk. Use it at your on risk !
This one is as easy as removing one line.
Check the Created Partitions #
lsblk
DP Step-2. Partitioning for BIOS or MBR Systems (NOT Recommended) #
Though most of the devices are now UEFI but one might still have those old dusty PCs. Hence this one is for them.
Cleaning up existing Partitions #
sgdisk --zap-all /dev/sda
! DANGER ! Disk Wipe Risk
The above command will destroy or erase all data on disk. Use it at your on risk !
Creating Disk Partitions with Swap on BIOS / MBR Systems #
|
|
! DANGER ! Disk Damage Risk
The above command will destroy or erase all data on disk. Use it at your on risk !
Creating Disk Partitions Without Swap on BIOS / MBR Systems #
|
|
! DANGER ! Disk Damage Risk
The above command will destroy or erase all data on disk. Use it at your on risk !
Stage : Disk Mounting [DM] #
Our new disk with correct partitions is ready. We would need to format and mount these partitions to begin installation.
DM Step-1. Formatting Partitions #
First based on the type of partition we need to format if accordingly.
We would assume the same disk as the previous case.
Total capacity of the disk is 1TB
and it is present at /dev/sda
Format configuration with Swap on an UEFI System #
|
|
Notice how useful it is to do with Labels already configured during partitioning.
Format configuration with Swap on an BIOS / MBR Systems #
|
|
Here we don’t have labels and hence we are referring to the actual partition.
DM Step-2. Mounting Partitions #
After formatting the partitions we need to mount them correctly. This would allow us to initiate the Arch Linux installation and bootloader configuration.
Mounting Partitions for UEFI Systems #
If we have a swap partition then lets enable that:
swapon /dev/disk/by-partlabel/ArchSwap
Mount the Root partition at /mnt
.
mount /dev/disk/by-partlabel/ArchRoot /mnt
Next create the /boot
directory and mount the EFI partition.
|
|
Mounting Partitions for BIOS or MBR Systems #
For Swap:
swapon /dev/sda2
Mount the Root partition at /mnt
.
mount /dev/sda1 /mnt
Great ! You made strides of progress #
Now you have all the partitions ready, the software repository is configured and updated. Onwards to next stages of Arch Linux setup.
Hope to see you in the next parts.
This is the Part 2 in the series. This part deals with configuration of Software Repositories, partitioning and formatting the disk.
Notes #
|
|