{"id":16166416,"url":"https://github.com/eromatiya/a-personal-arch-installation-guide","last_synced_at":"2025-04-07T05:37:30.021Z","repository":{"id":43551883,"uuid":"215211323","full_name":"eromatiya/A-Personal-Arch-Installation-Guide","owner":"eromatiya","description":"A Personal Arch Installation Guide In Case of Amnesia","archived":false,"fork":false,"pushed_at":"2023-03-08T10:35:41.000Z","size":83,"stargazers_count":103,"open_issues_count":0,"forks_count":21,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-13T09:49:06.490Z","etag":null,"topics":["arch-linux","archlinux","gpt","guide","installation-guides","systemd-boot"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eromatiya.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-10-15T05:07:17.000Z","updated_at":"2024-12-25T19:22:11.000Z","dependencies_parsed_at":"2023-01-21T11:46:45.412Z","dependency_job_id":"b385c2f5-98f7-4753-9815-dde16a107f64","html_url":"https://github.com/eromatiya/A-Personal-Arch-Installation-Guide","commit_stats":null,"previous_names":["eromatiya/a-personal-arch-installation-guide"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eromatiya%2FA-Personal-Arch-Installation-Guide","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eromatiya%2FA-Personal-Arch-Installation-Guide/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eromatiya%2FA-Personal-Arch-Installation-Guide/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eromatiya%2FA-Personal-Arch-Installation-Guide/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eromatiya","download_url":"https://codeload.github.com/eromatiya/A-Personal-Arch-Installation-Guide/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247601489,"owners_count":20964862,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arch-linux","archlinux","gpt","guide","installation-guides","systemd-boot"],"created_at":"2024-10-10T02:54:06.477Z","updated_at":"2025-04-07T05:37:24.988Z","avatar_url":"https://github.com/eromatiya.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# A Personal Arch Installation Guide\n\nThis is a personal guide so if you are lost and just found this guide from somewhere, I recommend you to read the official [`wiki`](https://wiki.archlinux.org/index.php/Installation_guide)!  This guide will focus on `systemd-boot`, `UEFI` and a guide if you want to encrypt your partition with `LUKS/LVM`. This guide exists so that I can remember a bunch of things when reinstalling `Archlinux`.\n\n## Pre-installation\n\nBefore installing, make sure to:\n\n+ Read the [official wiki](https://wiki.archlinux.org/index.php/installation_guide). It is advisable to read that instead. I wrote this guide for myself.\n+ Acquire an installation image from [here](https://www.archlinux.org/download/).\n+ Verify signature.\n+ Prepare an installation medium.\n+ Boot the live environment.\n\n## Set the keyboard layout\n\nThe default console keymap is US. Available layouts can be listed with:\n\n```\n# ls /usr/share/kbd/keymaps/**/*.map.gz\n```\n\nTo modify the layout, append a corresponding file name to loadkeys, omitting path and file extension. For example, to set a US keyboard layout:  \n\n```\n# loadkeys us\n```\n\n## Verify the boot mode\n\nIf UEFI mode is enabled on an UEFI motherboard, Archiso will boot Arch Linux accordingly via systemd-boot. To verify this, list the efivars directory:  \n\n```\n# ls /sys/firmware/efi/efivars\n```\n\nIf the command shows the directory without error, then the system is booted in UEFI mode. If the directory does not exist, the system may be booted in **BIOS** (or **CSM**) mode.\n\n## Connect to the internet\n\nWe need to make sure that we are connected to the internet to be able to install Arch Linux `base` and `linux` packages. Let’s see the names of our interfaces.\n\n```\n# ip link\n```\n\nYou should see something like this:\n\n```\n1: lo: \u003cLOOPBACK,UP,LOWER_UP\u003e mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000\n\t\tlink/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00\n2: enp0s0: \u003cNO-CARRIER,BROADCAST,MULTICAST,UP\u003e mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000\n\t\tlink/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff\n3: wlan0: \u003cBROADCAST,MULTICAST,UP,LOWER_UP\u003e mtu 1500 qdisc mq state UP mode DORMANT group default qlen 1000\n\t\tlink/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff permaddr 00:00:00:00:00:00\n```\n\n+ `enp0s0` is the wired interface  \n+ `wlan0` is the wireless interface  \n\n### Wired Connection\n\nIf you are on a wired connection, you can enable your wired interface by systemctl start `dhcpcd@\u003cinterface\u003e`.  \n\n```\n# systemctl start dhcpcd@enp0s0\n```\n\n### Wireless Connection\n\nIf you are on a laptop, you can connect to a wireless access point using `iwctl` command from `iwd`. Note that it's already enabled by default. Also make sure the wireless card is not blocked with `rfkill`.\n\nScan for network.\n\n```\n# iwctl station wlan0 scan\n```\n\nGet the list of scanned networks by:\n\n```\n# iwctl station wlan0 get-networks\n```\n\nConnect to your network.\n\n```\n# iwctl -P \"PASSPHRASE\" station wlan0 connect \"NETWORKNAME\"\n```\n\nPing archlinux website to make sure we are online:\n\n```\n# ping archlinux.org\n``` \n\nIf you receive Unknown host or Destination host unreachable response, means you are not online yet. Review your network configuration and redo the steps above.\n\n## Update the system clock\n\nUse `timedatectl` to ensure the system clock is accurate:\n\n```\n# timedatectl set-ntp true\n```\n\nTo check the service status, use `timedatectl status`.\n\n## Partition the disks\n\nWhen recognized by the live system, disks are assigned to a block device such as `/dev/sda`, `/dev/nvme0n1` or `/dev/mmcblk0`. To identify these devices, use lsblk or fdisk.  The most common main drive is **sda**.\n\n```\n# lsblk\n```\n\nResults ending in `rom`, `loop` or `airoot` may be ignored.\n\nIn this guide, I'll create a two different ways to partition a drive. One for a normal installation, the other one is setting up with an encryption(LUKS/LVM). Let's start with the unecrypted one:\n\n### Unencrypted filesystem\n\n+ Let’s clean up our main drive to create new partitions for our installation. And yeah, in this guide, we will use `/dev/sda` as our disk.\n\n\t```\n\t# gdisk /dev/sda\n\t```\n\n+ Press \u003ckbd\u003ex\u003c/kbd\u003e to enter **expert mode**. Then press \u003ckbd\u003ez\u003c/kbd\u003e to *zap* our drive. Then hit \u003ckbd\u003ey\u003c/kbd\u003e when prompted about wiping out GPT and blanking out MBR. Note that this will ***zap*** your entire drive so your data will be gone - reduced to atoms after doing this. THIS. CANNOT. BE. UNDONE.\n\n+ Open `cgdisk` to start partitioning our filesystem\n\n\t```\n\t# cgdisk /dev/sda\n\t```\n\n+ Press \u003ckbd\u003eReturn\u003c/kbd\u003e when warned about damaged GPT.\n\n\tNow we should be presented with our main drive showing the partition number, partition size, partition type, and partition name. If you see list of partitions, delete all those first.\n\n+ Create the `boot` partition\n\n\t- Hit New from the options at the bottom.\n\t- Just hit enter to select the default option for the first sector.\n\t- Now the partion size - Arch wiki recommends 200-300 MB for the boot + size. Let’s make 1GiB in case we need to add more OS to our machine. I’m gonna assign mine with 1024MiB. Hit enter.\n\t- Set GUID to `EF00`. Hit enter.\n\t- Set name to `boot`. Hit enter.\n\t- Now you should see the new partition in the partitions list with a partition type of EFI System and a partition name of boot. You will also notice there is 1007KB above the created partition. That is the MBR. Don’t worry about that and just leave it there.\n\n+ Create the `root` partition\n\n\t- Hit New again.\n\t- Hit enter to select the default option for the first sector.\n\t- Hit enter again to input your root size.\n\t- Also hit enter for the GUID to select default(`8300`).\n\t- Then set name of the partition to `root`.\n\n+ Create the `root` partition\n\n\t- Hit New again.\n\t- Hit enter to select the default option for the first sector.\n\t- Hit enter again to use the remainder of the disk.\n\t- Also hit enter for the GUID to select default.\n\t- Then set name of the partition to `home`.\n\n+ Lastly, hit `Write` at the bottom of the patitions list to *write the changes* to the disk. Type `yes` to *confirm* the write command. Now we are done partitioning the disk. Hit `Quit` *to exit cgdisk*. Go to the [next section](#formatting-partitions).\n\n### Encrypted filesystem with `LUKS/LVM`\n\n+ Let’s clean up our main drive to create new partitions for our installation. And yeah, in this guide, we will use `/dev/sda` as our disk.\n\n\t```\n\t# gdisk /dev/sda\n\t```\n\n+ Press \u003ckbd\u003ex\u003c/kbd\u003e to enter **expert mode**. Then press \u003ckbd\u003ez\u003c/kbd\u003e to *zap* our drive. Then hit \u003ckbd\u003ey\u003c/kbd\u003e when prompted about wiping out GPT and blanking out MBR. Note that this will ***zap*** your entire drive so your data will be gone - reduced to atoms after doing this. THIS. CANNOT. BE. UNDONE.\n\n+ Create our partitions by running `cgdisk /dev/sda`\n\n\t```\n\t# cgdisk /dev/sda\n\t```\n\n+ Just press \u003ckbd\u003eReturn\u003c/kbd\u003e when warned about damaged GPT.\n\n\tNow we should be presented with our main drive showing the partition number, partition size, partition type, and partition name. If you see list of partitions, delete all those first.\n\n+ Create the `boot` partition\n\n\t- Hit New from the options at the bottom.\n\t- Just hit enter to select the default option for the first sector.\n\t- Now the partion size - Arch wiki recommends 200-300 MB for the boot + size. Let’s make 1GiB in case we need to add more OS to our machine. I’m gonna assign mine with 1024MiB. Hit enter.\n\t- Set GUID to `EF00`. Hit enter.\n\t- Set name to `boot`. Hit enter.\n\t- Now you should see the new partition in the partitions list with a partition type of EFI System and a partition name of boot.\n\n+ Create the `LVM` partition\n\n\t- Hit New again.\n\t- Hit enter to select the default option for the first sector.\n\t- Hit enter again to use the remainder of the disk.\n\t- Set GUID to `8e00`. Hit enter.\n\t- Set name to `lvm`. Hit enter.\n\n+ Lastly, hit `Write` at the bottom of the patitions list to *write the changes* to the disk. Type `yes` to *confirm* the write command. Now we are done partitioning the disk. Hit `Quit` *to exit cgdisk*. Go to the [next section](#formatting-partitions).\n\n\n## Verifying the partitions\n\nUse `lsblk` again to check the partitions we created. *We? I thought I'm doing this guide for myself lol*\n\n```\n# lsblk\n```\n\nYou should see *something like this*:\n\n### Unencrypted filesystem\n\n| NAME | MAJ:MIN | RM | SIZE | RO | TYPE | MOUNTPOINT |\n| --- | --- | --- | --- | --- | --- | --- |\n| sda | 8:0 | 0 | 477G | 0 |   |   |\n| sda1 | 8:1 | 0 | 1 | 0 | part |   |\n| sda2 | 8:2 | 0 | 1 | 0 | part |   |\n| sda3 | 8:3 | 0 | 175G | 0 | part |   |\n\n**`sda`** is the main disk  \n**`sda1`** is the boot partition  \n**`sda2`** is the swap partition  \n**`sda3`** is the home partition  \n\n### Encrypted filesystem\n\n| NAME | MAJ:MIN | RM | SIZE | RO | TYPE | MOUNTPOINT |\n| --- | --- | --- | --- | --- | --- | --- |\n| sda | 8:0 | 0 | 477G | 0 | disk |   |\n| sda1 | 8:1 | 0 | 1 | 0 | part |   |\n| sda2 | 8:2 | 0 | 1 | 0 | part |   |\n\n**`sda`** is the main disk  \n**`sda1`** is the boot partition  \n**`sda2`** is the LVM partition\n\n**Surprise! Surprise!** We will **not** encrypt the `/boot` partition.\n\n## Format the partitions\n\n### Unencrypted filesystem\n\n+ Format `/dev/sda1` partition as `FAT32`. This will be our `/boot`.\n\n\t```\n\t# mkfs.fat -F32 /dev/sda1\n\t```\n\n+ Format `/dev/sda3` and `/dev/sda4` partition as `EXT4`. This will be our `root` and `home`  partition.\n\n\t```\n\t# mkfs.ext4 /dev/sda3\n\t# mkfs.ext4 /dev/sda4\n\t```\n\n### Encrypted filesystem\n\n+ Format `/dev/sda1` partition as `FAT32`. This will be our `/boot`.\n\n\t```\n\t# mkfs.fat -F32 /dev/sda1\n\t```\n\n+ Create the LUKS encrypted container.\n\n\t```\n\t# cryptsetup luksFormat /dev/sda2\n\t```\n\n+ Enter your passphrase twice. Don't forget this!\n\n+ Open the created container and name it whatever you want. In this guide I'll just use `cryptlvm`.\n\n\t```\n\t# cryptsetup open --type luks /dev/sda2 cryptlvm\n\t```\n\n+ Enter your passphrase and verify it.\n\n+ The decrypted container is now available at `/dev/mapper/cryptlvm`.\n\n+ Create a physical volume on top of the opened LUKS container:\n\n\t```\n\t# pvcreate /dev/mapper/cryptlvm\n\t```\n\n+ Create the volume group and name it `volume` (or whatever you want), adding the previously created physical volume to it:\n\n\tIn this guide, I'll just use `volume` as the volume group name.\n\n\t```\n\t# vgcreate volume /dev/mapper/cryptlvm\n\t```\n\n+ Create all your needed logical volumes on the volume group. We will create `root` and `home` logical volumes. Note that the `volume` is the name of the volume we just created.\n\n\t- Create our `root`. In this guide, I'll use 100GB.\n\n\t\t```\n\t\t# lvcreate -L 100G volume -n root\n\t\t```\n\n\t\tThis will create `/dev/mapper/volume-root`.\n\n\t- Create our home sweet `home`. I'll just assign the remaining space to it.\n\n\t\t```\n\t\t# lvcreate -l 100%FREE volume -n home\n\t\t```\n\n\tThis will create `/dev/mapper/volume-home`.\n\n+ Format the logical partitions under the LVM volume.\n\n\t- Format our `root` and `home` partitions.\n\n\t\t```\n\t\t# mkfs.ext4 /dev/mapper/volume-root\n\t\t# mkfs.ext4 /dev/mapper/volume-home\n\t\t```\n\n## Mount the filesystems\n\n### Unencryped partition\n\n+ Mount the `/dev/sda` partition to `/mnt`. This is our `/`:\n\n\t```\n\t# mount /dev/sda3 /mnt\n\t```\n\n+ Create a `/boot` mountpoint:\n\n\t```\n\t# mkdir /mnt/boot  \n\t```\n\n+ Mount `/dev/sda1` to `/mnt/boot` partition. This is will be our `/boot`:\n\n\t```\n\t# mount /dev/sda1 /mnt/boot\n\t```\n\n+ Create a `/home` mountpoint:\n\n\t```\n\t# mkdir /mnt/home  \n\t```\n\n+ Mount `/dev/sda4` to `/mnt/home` partition. This is will be our `/home`:\n\n\t```\n\t# mount /dev/sda1 /mnt/home\n\t```\n\n### Encrypted partition\n\n+ Mount the `/dev/mapper/volume-root` partition to `/mnt`. This is our `/`:\n\n\t```\n\t# mount /dev/mapper/volume-root /mnt\n\t```\n\n+ Create a `/boot` mountpoint:\n\n\t```\n\t# mkdir /mnt/boot  \n\t```\n\n+ Mount `/dev/sda1` to `/mnt/boot` partition. This is will be our `/boot`:\n\n\t```\n\t# mount /dev/sda1 /mnt/boot\n\t```\n\n+ Create a `/home` mountpoint:\n\n\t```\n\t# mkdir /mnt/home  \n\t```\n\n+ Mount `/dev/mapper/volume-home` to `/mnt/home` partition. This is will be our `/home`:\n\n\t```\n\t# mount /dev/mapper/volume-home /mnt/home\n\t```\n\n\t We don’t need to mount `swap` since it is already enabled.\n\n## Installation\n\nNow let’s go ahead and install `base`, `linux`, `linux-firmware`, and `base-devel` packages into our system. \n\n```\n# pacstrap /mnt base base-devel linux linux-zen linux-firmware\n```\n\nI will install `linux-zen` since it has necessary modules for gaming.\n\nThe `base` package does not include all tools from the live installation, so installing other packages may be necessary for a fully functional base system. In particular, consider installing: \n\n+ software necessary for networking,\n\n\t- `dhcpcd`: RFC2131 compliant DHCP client daemon\n\t- `iwd`: Internet Wireless Daemon\n\t- `inetutils`: A collection of common network programs\n\t- `iputils`: Network monitoring tools, including `ping`\n\n+ utilities for accessing `RAID` or `LVM` partitions,\n\n\t- `lvm2`: Logical Volume Manager 2 utilities (*if you are setting up an encrypted filesystem with LUKS/LVM, include this on pacstrap*)\n\n+ Zram\n\n\t- `zram-generator`\n\n+ a text editor(s),\n\n\t- `nano`\n\t- `vim`\n\t- `vi`\n\n+ packages for accessing documentation in man and info pages,\n\n\t- `man-db`\n\t- `man-pages`\n\n+ Microcode\n\n\t- `intel-ucode`/`amd-ucode`\n\n+ tools:\n\n\t- `git`: the fast distributed version control system\n\t- `tmux`: A terminal multiplexer\n\t- `less`: A terminal based program for viewing text files\n\t- `usbutils`: USB Device Utilities\n\t- `bash-completion`: Programmable completion for the bash shell\n\n+ userspace utilities for the management of file systems that will be used on the system,\n\t\n\t- `ntfs-3g`: NTFS filesystem driver and utilities\n\t- `unrar`: The RAR uncompression program\n\t- `unzip`: For extracting and viewing files in `.zip` archives\n\t- `p7zip`: Command-line file archiver with high compression ratio\n\t- `unarchiver`: `unar` and `lsar`: Objective-C tools for uncompressing archive files\n\t- `gvfs-mtp`: Virtual filesystem implementation for `GIO` (`MTP` backend; Android, media player)\n\t- `libmtp`: Library implementation of the Media Transfer Protocol\n\t- `android-udev`: Udev rules to connect Android devices to your linux box\n\t- `mtpfs`: A FUSE filesystem that supports reading and writing from any MTP devic\n\t- `xdg-user-dirs`: Manage user directories like `~/Desktop` and `~/Music`\n\nThese tools will be useful later. So **future me**, install these.\n\n## Generating the fstab\n\n```\n# genfstab -U /mnt \u003e\u003e /mnt/etc/fstab\n```\n\nCheck the resulting `/mnt/etc/fstab` file, and edit it in case of errors. \n\n## Chroot\n\nNow, change root into the newly installed system  \n\n```\n# arch-chroot /mnt /bin/bash\n```\n\n## Time zone\n\nA selection of timezones can be found under `/usr/share/zoneinfo/`. Since I am in the Philippines, I will be using `/usr/share/zoneinfo/Asia/Manila`. Select the appropriate timezone for your country:\n\n```\n# ln -sf /usr/share/zoneinfo/Asia/Manila /etc/localtime\n```\n\nRun `hwclock` to generate `/etc/adjtime`: \n\n```\n# hwclock --systohc\n```\n\nThis command assumes the hardware clock is set to UTC.\n\n## Localization\n\nThe `locale` defines which language the system uses, and other regional considerations such as currency denomination, numerology, and character sets. Possible values are listed in `/etc/locale.gen`. Uncomment `en_US.UTF-8`, as well as other needed localisations.\n\n**Uncomment** `en_US.UTF-8 UTF-8` and other needed locales in `/etc/locale.gen`, **save**, and generate them with:  \n\n```\n# locale-gen\n```\n\nCreate the `locale.conf` file, and set the LANG variable accordingly:  \n\n```\n# locale \u003e /etc/locale.conf\n```\n\nIf you set the keyboard layout earlier, make the changes persistent in `vconsole.conf`:\n\n```\n# echo \"KEYMAP=us\" \u003e /etc/vconsole.conf\n```\n\nNot using `us` layout? Replace it, stoopid.\n\n## Network configuration\n\nCreate the hostname file. In this guide I'll just use `MYHOSTNAME` as hostname. Hostname is the host name of the host. Every 60 seconds, a minute passes in Africa.\n\n```\n# echo \"MYHOSTNAME\" \u003e /etc/hostname\n```\n\nOpen `/etc/hosts` to add matching entries to `hosts`:\n\n```\n127.0.0.1    localhost  \n::1          localhost  \n127.0.1.1    MYHOSTNAME.localdomain\t  MYHOSTNAME\n```\n\nIf the system has a permanent IP address, it should be used instead of `127.0.1.1`.\n\n## Initramfs  \n\nCreating a new initramfs is usually not required, because mkinitcpio was run on installation of the kernel package with pacstrap. **This is important** if you are setting up a system with encryption!\n\n### Unencrypted filesystem\n\n\t```\n\t# mkinitcpio -P\n\t```\n\n\tDO NOT FORGET TO RUN THIS BEFORE REBOOTING YOUR SYSTEM!\n\n### Encrypted filesystem with LVM/LUKS\n\n+ Open `/etc/mkinitcpio.conf` with an editor:\n\n+ In this guide, there are two ways to setting up initramfs, `udev` (default) and `systemd`. If you are planning to use `plymouth`(splashcreen), it is advisable to use a `systemd`-based initramfs.\n\n\t- udev-based initramfs (default).\n\n\t\tFind the `HOOKS` array, then change it to something like this:\n\n\t\t```\n\t\tHOOKS=(base udev autodetect keyboard modconf block encrypt lvm2 filesystems fsck)\n\t\t```\n\n\t- systemd-based initramfs.\n\n\t\tFind the `HOOKS` array, then change it to something like this:\n\n\t\t```\n\t\tHOOKS=(base systemd autodetect keyboard sd-vconsole modconf block sd-encrypt lvm2 filesystems fsck)\n\t\t```\n\n\t- Regenerate initramfs image:\n\n\t\t```\n\t\t# mkinitcpio -P\n\t\t```\n\n\t\tDO NOT FORGET TO RUN THIS BEFORE REBOOTING YOUR SYSTEM!\n\n### Making Swap File and ZSwap\n\n#### Time to create a swap file! I'll make two gigabytes swap file.\n\n```\n# dd if=/dev/zero of=/swapfile bs=1M count=2048 status=progress\n```\n\nSet the right permissions\n```\n# chmod 0600 /swapfile\n```\n\nAfter creating the correctly sized file, format it to swap:\n```\n# mkswap -U clear /swapfile\n```\n\nActivate the swap file\n```\n# swapon /swapfile\n```\n\nFinally, edit the fstab configuration to add an entry for the swap file in `/etc/fstab`:\n```\n/swapfile none swap defaults,pri=10 0 0\n```\n\n#### Install zram-generator:\n\n```\n# pacman -S zram-generator\n```\n\nLet's make a config file at `/etc/systemd/zram-generator.conf\n!` I prefer having HALF of my TOTAL RAM as zswap size. My laptop have 4 cores, so I'll distribute it to FOUR zram devices. So I'll uthis config :\n\n```\n[zram0]\nzram-size = ram/8\ncompression-algorithm = zstd\nswap-priority = 100\n\n[zram1]\nzram-size = ram/8\ncompression-algorithm = zstd\nswap-priority = 100\n\n[zram2]\nzram-size = ram/8\ncompression-algorithm = zstd\nswap-priority = 100\n\n[zram3]\nzram-size = ram/8\ncompression-algorithm = zstd\nswap-priority = 100\n```\n\nNo need to enable/start anything, it will automatically initialize zram devices! Just reboot and run `swapon -s` to check the swap you have.\n\n## Adding Repositories - `multilib` and `AUR`\n\nEnable multilib and AUR repositories in `/etc/pacman.conf`. Open it with your editor of choice:\n\n### Adding multilib repository\n\nUncomment `multilib` (remove # from the beginning of the lines). It should look like this:  \n\n```\n[multilib]\nInclude = /etc/pacman.d/mirrorlist\n```\n\n### Adding the AUR repository\n\nAdd the following lines at the end of your `/etc/pacman.conf` to enable the AUR repo:  \n\n```\n[archlinuxfr]\nSigLevel = Never\nServer = http://repo.archlinux.fr/$arch\n```\n\n### `pacman` goodies\n\nYou can enable the \"easter-eggs\" and goodies in `pacman`, the package manager of archlinux.\n\nOpen `/etc/pacman.conf`, then find `# Misc options`. \n\nTo add colors to `pacman`, uncomment `Color`. Then add `Pac-Man` to `pacman` by adding `ILoveCandy` under the `Color` string. To enable parallel downloads, uncomment it too:\n\n```\nColor\nILoveCandy\nParallelDownloads = 3\n```\n\n### Update repositories and packages\n\nTo check if you successfully added the repositories and enable the easter-eggs, run:\n\n```\n# pacman -Syu\n```\n\nIf updating returns an error, open the `pacman.conf` again and check for human errors. Yes, you f'ed up big time.\n\n## Root password\n\nSet the `root` password:  \n\n```\n# passwd\n```\n\n## Add a user account\n\nAdd a new user account. In this guide, I'll just use `MYUSERNAME` as the username of the new user aside from `root` account. (My phrasing seems redundant, eh?) Of course, change the example username with your own:  \n\n```\n# useradd -m -g users -G wheel,storage,power,video,audio,rfkill,input -s /bin/bash MYUSERNAME\n```\n\nThis will create a new user and its `home` folder.\n\nSet the password of user `MYUSERNAME`:  \n\n```\n# passwd MYUSERNAME\n```\n\n## Add the new user to sudoers:\n\nIf you want a root privilege in the future by using the `sudo` command, you should grant one yourself:\n\n```\n# EDITOR=vim visudo\n```\n\nUncomment the line (Remove #):\n\n```\n# %wheel ALL=(ALL) ALL\n```\n\n## Install the boot loader\n\nYeah, this is where we install the bootloader. We will be using `systemd-boot`, so no need for `grub2`. \n\n+ Install bootloader:\n\t\n\tWe will install it in `/boot` mountpoint (`/dev/sda1` partition).\n\n\t```\n\t# bootctl --path=/boot install\n\t```\n\n+ Create a boot entry `/boot/loader/entries/arch.conf`, then add these lines:\n\n### Unencrypted filesystem\n\n\t```\n\ttitle Arch Linux  \n\tlinux /vmlinuz-linux  \n\tinitrd  /initramfs-linux.img  \n\toptions root=/dev/sda3 rw\n\t```\n\n\tIf your `/` is not in `/dev/sda3`, make sure to change it. \n\n\tSave and exit.\n\n### Encrypted filesystem\n\nRemember the two-types of initramfs earlier? Each type needs a specific kernel parameters. So there's also a two type of entries here. Remember that `volume` is the volume group name and `/dev/mapper/volume-root` is the path to `/`.\n\n+ udev-based initramfs\n\n\t```\n\ttitle Arch Linux  \n\tlinux /vmlinuz-linux  \n\tinitrd  /initramfs-linux.img  \n\toptions cryptdevice=UUID=/DEV/SDA2/UUID/HERE:volume root=/dev/mapper/volume-root rw\n\t```\n\n\tReplace `/DEV/SDA2/UUID/HERE` with the UUID of your `LVM` partition. You can check it by running `blkid /dev/sda2`. Note that `cryptdevice` parameter  is unsupported by plymouth so it's advisable to use systemd-based initramfs if you are planning to use it.\n\n\tTip: If you are using `vim`, you can write the UUID easier by typing `:read ! blkid /dev/sda2` then hit enter. Then manipulate the output by using visual mode.\n\n+ systemd-based initramfs\n\n\t```\n\ttitle Arch Linux\n\tlinux /vmlinuz-linux\n\tinitrd /intel-ucode.img\n\tinitrd /initramfs-linux.img\n\toptions rd.luks.name=/DEV/SDA2/UUID/HERE=volume root=/dev/mapper/volume-root rw\n\t```\n\n\tReplace `/DEV/SDA2/UUID/HERE` with the UUID of your `LVM` partition. You can check it by running `blkid /dev/sda2`.\n\n\tTip: If you are using `vim`, you can write the UUID easier by typing `:read ! blkid /dev/sda2` then hit enter. Then manipulate the output by using visual mode.\n\n### Update boot loader configuration\n\nUpdate bootloader configuration\n\n```\n# vim /boot/loader/loader.conf\n```\n\nDelete all of its content, then replaced it by:\n\n```\ndefault arch.conf\ntimeout 0\nconsole-mode max\neditor no\n```\n\n#### Microcode\n\nProcessor manufacturers release stability and security updates to the processor microcode. These updates provide bug fixes that can be critical to the stability of your system. Without them, you may experience spurious crashes or unexpected system halts that can be difficult to track down. \n\nIf you didn't install it using pacstrap, install microcode by:\n\nFor AMD processors:\n\n```\n# pacman -S amd-ucode\n```\n\nFor Intel processors:\n\n```\n# pacman -S intel-ucode\n```\n\nIf your Arch installation is on a removable drive that needs to have microcode for both manufacturer processors, install both packages. \n\nLoad  microcode. For `systemd-boot`, use the `initrd` option to load the microcode, **before** the initial ramdisk, as follows:\n\n```\n# sudoedit /boot/loader/entries/entry.conf\n```\n\n```\ntitle   Arch Linux\nlinux   /vmlinuz-linux\ninitrd  /CPU_MANUFACTURER-ucode.img\ninitrd  /initramfs-linux.img\n...\n```\n\nReplace `CPU_MANUFACTURER` with either `amd` or `intel` depending on your processor.\n\n## Enable internet connection for the next boot\n\nTo enable the network daemons on your next reboot, you need to enable `dhcpcd.service` for wired connection and `iwd.service` for a wireless one.\n\n```\n# systemctl enable dhcpcd iwd\n```\n\n## Exit chroot and reboot:  \n\nExit the chroot environment by typing `exit` or pressing \u003ckbd\u003eCtrl + d\u003c/kbd\u003e. You can also unmount all mounted partition after this. \n\nFinally, `reboot`.\n\n##  Finale\n\nIf your installation is a success, then ***yay!!!*** If not, you should start questioning your own existence. Are your parents proud of you? \n\n## [[POST INSTALLATION]](./POST.md)\t\t[[EXTRAS]](./EXTRAS.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feromatiya%2Fa-personal-arch-installation-guide","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feromatiya%2Fa-personal-arch-installation-guide","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feromatiya%2Fa-personal-arch-installation-guide/lists"}