Abstract
So I want to show you how to install Arch Linux with btrfs dual booting with Windows. You can read about Arch here: Arch Wiki - Arch Linux.
Prerequisite
- A USB drive for Arch ISO (8 GB recommended)
- Arch ISO (Get it here)
- x86_64 device
- UEFI
- Minimum 512 MB of RAM (more than 2 GB recommended)
- 20-30 GB free disk space (60 GB upwards recommended)
- Internet connection
Installation Process
Even tho I’ll show you how-to, Arch Wiki itself has substantial informations regarding the installation. Be sure to check out the official wiki for reference while also following this guide: Arch Wiki - Installation Guide.
Preparing installation medium
At this step, I assume you already have the Arch ISO and know how to burn ISO files to USB. Now, burn the ISO to your USB using Etcher, Rufus, or any tools that you like. I recommend Ventoy as you only need to copy the ISO to your flashdisk.
Make sure to shrink your Windows partition and then create 3 empty partitions from Windows Partition Manager (or something like that idk) consisting of:
- 512 MB empty partition (EFI partition)
- 20-30 GB or more empty partition (root partition)
- 4 GB or more empty partition (Swap partition)
Keymapping (Optional)
Note: If you use standard QWERTY layout, skip this step.
Check the list of keymaps available using:
Then set your preferred keymap by using:
Connecting to the internet
Arch uses iwctl
for connecting to the internet via Wifi. If you’re using USB tethering or Ethernet, skip this step.
Run iwctl
by issuing:
First, if you do not know your wireless device name, list all Wi-Fi devices:
Then, to scan for networks:
You can then list all available networks:
Finally, to connect to a network:
You can check your network by just:
Set time
Use timedatectl
to ensure the system clock is accurate:
Partitioning
Since we’ve already created 3 partitions in Windows, we can just jump on to formatting the partitions. But first, you must check which partitions are going to be used.
The command is:
For example, my layout looks like this:
- /dev/nvme0n1p6 | 512 MB => This is going to be the EFI partition.
- /dev/nvme0n1p7 | 4 GB => This will be the swap partition.
- /dev/nvme0n1p8 | 71.7 GB => This is going to be the root partition.
Yours might look different, but the concept is the same.
Then we format our partitions using mkfs
and mkswap
.
For the EFI boot entry:
For the swap partition, we need to make and also activate it:
For the root partition, we need to format it as btrfs:
Mounting the partitions
Now that we have formatted the partitions, we need to mount it (exception for swap).
Mounting the root partition
To mount the root partition, issue the command:
Creating and mounting btrfs subvolumes
Since we’ve mounted the root partition, we can proceed into creating btrfs subvolumes.
We’ll create 6 different subvolumes:
- @ => root directory.
- @home => home directory. Contains all your personal data.
- @var => var directory. Contains logs, etc.
- @opt => opt directory. Contains third party products.
- @tmp => tmp directory. Contains temp files, etc.
- @.snapshot => snapshot directory. Contains btrfs snapshots. (Can be excluded if you want to use Timeshift)
Create the subvolumes:
Now to mount them:
A little review about the options:
- noatime: No access time. Improves performance by not writing time when the file was accessed.
- commit: Perodic interval (in seconds) in which data is synchronized to permanent storage.
- compress-force: Activating forced compression and choosing the algorithm for compression. (Believe me, this is good, no joke)
- discard=async: Frees unused block from an SSD drive supporting the command. With discard=async, freed extents are not discarded immediately, but grouped together and trimmed later by a separate worker thread, improving commit latency. You can opt out of this if you use HDD.
- space_cache: Enables kernel to know where block of free space is on a disk to enable it to write data immediately after file creation.
- subvol: Choosing the subvolume to mount.
Mounting the EFI (boot) partition
To mount it, just issue:
Verify if you are doing it correctly
To check what is being mounted, issue:
Base system installation
For AMD CPUs:
For Intel CPUs:
Generating fstab
After the base system installation is done, now we need to generate the fstab to define what and how partitions should be mounted.
Generate it by issuing:
Verify it by issuing:
Chroot into the root partition
Now enter your Arch install:
Setting up timezone
Before you set up timezone, you might want to check which timezones are available by issuing:
Press ‘q’ to quit the list.
Now set up your timezone by using:
Sync hardware and system clock
Issue this command:
Generating system locale
Issue this command to edit the locale.gen:
Scroll and uncomment your language. Most people would prefer US English so scroll down and uncomment this line:
Save the file by using CTRL + S and exit it with CTRL + X.
Now generate locale:
Set the locale in locale.conf file:
Change en_US.UTF-8 to your preferred language (if true).
Setting keymap
Note: This is only if you use keymaps other than the standard QWERTY.
Replace [keymap] with the ones you choose before.
Setting network configuration
Set your hostname with:
Replace the example
with anything you want.
Now for the hostfile:
Reffering to Arch Wiki, the format should look like this:
Save the file by using CTRL + S and exit it with CTRL + X.
Setting up the root user
Set up password for the root user with:
Note: Visual feedbacks are disabled by default in Linux because of security reasons.
Installing remaining essentials
These are some basic sets of packages you will need if you plan to use Arch in the long run. I would recommend that you google all packages to understand what they do. After entering the command, press Enter to select all of the base-devel packages to install. Then wait for the installation to finish.
Modifying mkinitcpio
Add btrfs into MODULES so that it looks like:
Save the file by using CTRL + S and exit it with CTRL + X.
Installing GRUB
To install GRUB into the /boot partition, issue these commands:
Creating a user
Issue this command to create a new user:
Above command creates a user with name example
and adds the user to the wheel
group (for sudo privileges). Replace example
with whatever name you want.
Then create the password for the user:
Giving user sudo permission
Uncomment the line %wheel ALL=(ALL) ALL
Enabling NetworkManager
Finishing and restarting
Issue these commands to finish installation:
Post Installation
Ah yes, the pain is gone ultimately. You’ve installed Arch Linux successfully! Go ahead and install some DE or WM on top.
For some post install recommendations:
Arch Wiki - General Recommendations
As always, thank you for your time!