{"status":200,"posts":[{"_id":"657c39e7ff2f6d170be6510b","file":{"text":"\n<ul>\n<li>I am using a single hard drive.</li>\n<li>The swap partition needs to be greater than or equal to the RAM installed on your computer (32G in my case).</li>\n<li>I live in Europe/Paris, I use a US keyboard and speak US english</li>\n</ul>\n<h3>1. Check your BIOS settings and enable UEFI</h3>\n<h3>2. Boot on the latest Arch Linux ISO.</h3>\n<h3>3. Check that boot mode is EFI</h3>\n<pre><code class=\"hljs language-bash\"><span class=\"hljs-built_in\">ls</span> /sys/firmware/efi/efivars\n</code></pre><p>If 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 mode.</p>\n<h3>4. Check that the network interfaces are recognized &amp;&amp; internet is working</h3>\n<pre><code class=\"hljs language-bash\">ip <span class=\"hljs-built_in\">link</span>\nping google.com\n</code></pre><h3>5. Update the system clock &amp;&amp; check UTC is selectioned</h3>\n<pre><code class=\"hljs language-bash\">timedatectl set-ntp <span class=\"hljs-literal\">true</span>\ntimedatectl status\n</code></pre><h3>6. Partitions</h3>\n<h4>1. List your disks with <code>fdisk</code></h4>\n<pre><code class=\"hljs language-bash\">fdisk -l\n</code></pre><h4>2. Run <code>fdisk</code> on the disk you want to Arch to be installed</h4>\n<pre><code class=\"hljs language-bash\">fdisk /dev/sda\n</code></pre><h4>3. Create a new GPT partition table</h4>\n<pre><code class=\"hljs language-bash\">In fdisk, <span class=\"hljs-string\">\"g\"</span> <span class=\"hljs-keyword\">for</span> GPT partitions table\n</code></pre><h4>4. Create the following partitions:</h4>\n<table>\n    <thead>\n        <tr>\n            <th>Partition</th>\n            <th>First sector</th>\n            <th>Last sector</th>\n            <th>Type</th>\n        </tr>\n    </thead>\n    <tbody>\n        <tr>\n            <td>/dev/sda1</td>\n            <td>default</td>\n            <td>+550M</td>\n            <td>EFI System (1)</td>\n        </tr>\n        <tr>\n            <td>/dev/sda2</td>\n            <td>default</td>\n            <td>+33G</td>\n            <td>swap (19)</td>\n        </tr>\n        <tr>\n            <td>/dev/sda3</td>\n            <td>default</td>\n            <td>default</td>\n            <td>Linux filesystem (20)</td>\n        </tr>\n    </tbody>\n</table>\n\n<pre><code class=\"hljs language-bash\">In fdisk, <span class=\"hljs-string\">\"n\"</span> <span class=\"hljs-keyword\">for</span> add new partition\nIn fdisk, <span class=\"hljs-string\">\"p\"</span> <span class=\"hljs-keyword\">for</span> primary partition (<span class=\"hljs-keyword\">if</span> using MBR instead of GPT)\nIn fdisk, <span class=\"hljs-string\">\"t\"</span> to change partition <span class=\"hljs-built_in\">type</span>\n</code></pre><h4>5. Write the table to the disk</h4>\n<pre><code class=\"hljs language-bash\">In fdisk, <span class=\"hljs-string\">\"w\"</span> (write table to disk)\n</code></pre><h3>7. Format the partitions</h3>\n<h4>1. Format the EFI boot partition to Fat32</h4>\n<pre><code class=\"hljs language-bash\">mkfs.fat -F32 /dev/sda1\n</code></pre><h4>2. Format the swap partition to swap and enable it</h4>\n<pre><code class=\"hljs language-bash\">mkswap /dev/sda2\nswapon /dev/sda2\n</code></pre><h4>3. Format the root partition to XFS</h4>\n<pre><code class=\"hljs language-bash\">mkfs.xfs /dev/sda3\n</code></pre><h3>8. Mount the partitions</h3>\n<pre><code class=\"hljs language-bash\">mount /dev/sda3 /mnt (mount the root partition)\n\n<span class=\"hljs-built_in\">mkdir</span> /mnt/boot\nmount /dev/sda1 /mnt/boot (mount the boot partition)\n</code></pre><h3>9. Install Arch with base and important packages</h3>\n<pre><code class=\"hljs language-bash\">pacstrap /mnt base base-devel linux linux-firmware amd-ucode efibootmgr dosfstools os-prober mtools pipewire pipewire-pulse xf86-video-amdgpu xorg neovim\n</code></pre><p>Note:</p>\n<ul>\n<li><code>amd-ucode</code> is the microcode package for my AMD Ryzen 7 4800H, use another one if your are not using an AMD cpu.</li>\n<li><code>pipewire</code> &amp; <code>pipewire-pulse</code> are optional. I want to use Pipewire instead of PulseAudio.</li>\n<li><code>xf86-video-amdgpu</code> is the graphic driver for my APU. Change it to the one you need.</li>\n<li><code>xorg</code> is required to install KDE, any other DE or WM once Arch is installed.</li>\n<li><code>neovim</code> is my editor of choice, but pick the one you like.</li>\n</ul>\n<h3>10. Generate an fstab file</h3>\n<p>Configure the system</p>\n<pre><code class=\"hljs language-bash\">genfstab -U /mnt &gt;&gt; /mnt/etc/fstab\n</code></pre><h3>11. Change root into the new system</h3>\n<pre><code class=\"hljs language-bash\">arch-chroot /mnt\n</code></pre><h3>12. Time zone, clock and localization setup</h3>\n<h4>1. Time zone</h4>\n<pre><code class=\"hljs language-bash\"><span class=\"hljs-built_in\">ln</span> -sf /usr/share/zoneinfo/Europe/Paris /etc/localtime\nhwclock --systohc (generates /etc/adjtime)\n</code></pre><h4>2. Localization</h4>\n<ul>\n<li>Edit <code>/etc/locale.gen</code> and uncomment <code>en_US.UTF-8 UTF-8</code>.</li>\n</ul>\n<pre><code class=\"hljs language-bash\">nvim /etc/locale.gen\n</code></pre><ul>\n<li>Generate the locales by running.</li>\n</ul>\n<pre><code class=\"hljs language-bash\">locale-gen\n</code></pre><ul>\n<li>Create the <code>/etc/locale.conf</code> file, and set the <code>LANG</code> variable accordingly:</li>\n</ul>\n<pre><code class=\"hljs language-bash\">LANG=en_US.UTF-8\n</code></pre><h3>12. Network configuration</h3>\n<h4>1. Set the hostname:</h4>\n<pre><code class=\"hljs language-bash\"><span class=\"hljs-built_in\">echo</span> <span class=\"hljs-string\">\"axel-laptop\"</span> &gt;&gt; /etc/hostname\n</code></pre><h4>2. Set the hosts:</h4>\n<pre><code class=\"hljs language-bash\"><span class=\"hljs-built_in\">echo</span> <span class=\"hljs-string\">\"127.0.0.1    localhost\"</span> &gt;&gt; /etc/hosts\n<span class=\"hljs-built_in\">echo</span> <span class=\"hljs-string\">\"::1          localhost\"</span> &gt;&gt; /etc/hosts\n<span class=\"hljs-built_in\">echo</span> <span class=\"hljs-string\">\"127.0.1.1\t   axel-laptop.localdomain axel-laptop\"</span> &gt;&gt; /etc/hosts\n</code></pre><h4>3. Install and enable NetworkManager</h4>\n<pre><code class=\"hljs language-bash\">pacman -S networkmanager\nsystemctl <span class=\"hljs-built_in\">enable</span> NetworkManager\n</code></pre><h3>13. Users, passwords and privileges</h3>\n<h4>1. Set the password and create a new user</h4>\n<pre><code class=\"hljs language-bash\">passwd (sets root pass)\nuseradd -m axelz (makes another user)\npasswd axelz (sets that user\\'s password)\nusermod -aG wheel,audio,video,optical,storage axelz\n</code></pre><h4>2. Install sudo, edit the sudo config and uncomment <code>%wheel ALL=(ALL) ALL</code>.</h4>\n<pre><code class=\"hljs language-bash\">pacman -S sudo\nEDITOR=nvim visudo\n</code></pre><h3>14. Bootloader</h3>\n<h4>1. Install systemd-boot</h4>\n<pre><code class=\"hljs language-bash\">bootctl --path=/boot install\n</code></pre><h4>2. Edit <code>/boot/loader/loader.conf</code> and write <code>default arch.conf</code></h4>\n<h4>3. Edit <code>/boot/loader/entries/arch.conf</code> and write the following:</h4>\n<pre><code class=\"hljs language-bash\">title Arch Linux\nlinux /vmlinuz-linux\ninitrd /amd-ucode.img\ninitrd /initramfs-linux.img\noptions root=PARTUUID=&lt;find the PARTUUID of the root partition&gt; rw\n</code></pre><ul>\n<li><code>initrd /amd-ucode.img</code> is specific to my platform (AMD cpu)</li>\n<li>use <code>blkid -s PARTUUID -o value /dev/sda3 &gt;&gt; /boot/loader/entries/arch.conf</code> to find the right PARTUUID</li>\n</ul>\n<h3>15. Unmount, exit and reboot</h3>\n<pre><code class=\"hljs language-bash\"><span class=\"hljs-built_in\">exit</span>\numount -R /mnt\nreboot\n</code></pre><h3>16. Install KDE</h3>\n<p>App to install: \n<code>5 13 14 21 35 44 46 58 106 124 139 142 145 154 170</code></p>\n<pre><code class=\"hljs language-bash\">sudo pacman -S plasma-meta kde-applications\nsudo systemctl <span class=\"hljs-built_in\">enable</span> sddm\nreboot\n</code></pre><h3>17. Add bluetooth</h3>\n<pre><code class=\"hljs language-bash\">sudo pacman -S bluez bluez-utils\n</code></pre><h3>18. Enable TRIM on SSD</h3>\n<p>Enables TRIM for SSD. TRIM will be executed every week, starting when you run the following command.</p>\n<pre><code class=\"hljs language-bash\">systemctl <span class=\"hljs-built_in\">enable</span> fstrim.timer\n</code></pre>","name":"ArchInstall.md"},"date":"2021-08-25","title":"Install instructions for Arch Linux on EFI systems with XFS and swap partitions + systemd-boot + KDE Plasma"}]}