installing-alpine-linux.html (4360B)
1 <!DOCTYPE html> 2 <html lang="en"> 3 <head> 4 <meta charset="utf-8"> 5 <title>Notes on Installing Alpine Linux | Riaz's Website</title> 6 <link rel="stylesheet" href="/style.css"> 7 <link rel="icon" href="data:,"> 8 <meta name="description" content="Notes on boot partitions, PipeWire, window managers, and recovering deleted partitions on Alpine Linux"> 9 <meta name="viewport" content="width=device-width, initial-scale=1"> 10 </head> 11 <body> 12 <h1>Notes on Installing Alpine Linux</h1> 13 <hr> 14 <article> 15 <p>After using Alpine, I still recommend Arch/Artix for desktop usage. For use on servers, Alpine is worth a try, as it uses less memory and space.</p> 16 <p>With more effort required to get audio working with PipeWire, partition scheming issues, and at times, unclear documentation, Alpine falls short for desktop usage. Arch has the AUR and extensive documentation.</p> 17 <h2>Partition Scheme</h2> 18 <p>Alpine's wiki says that only a root partition is required. Despite this, all example partition schemes mention a boot partition. I could not get it to start without one.</p> 19 <p>Even when I was able to boot, that partition never seemed to get mounted, and errors were shown.</p> 20 <p>Format your drive and reboot before doing the rest of the installation, as the new partitions might not be shown until rebooting.</p> 21 <h2>Using a Window Manager</h2> 22 <p>If your mouse and keyboard do nothing when starting a WM, run the following commands:</p> 23 <pre> 24 adduser $USER input 25 adduser $USER video</pre> 26 <p>If startx results in an error saying that it is "giving up" and a display server cannot be found, running startx with root permissions might work. A better solution is to delete the .Xauthority and .xinitrc files and recreate them as a non-root user.</p> 27 <h2>Recovering Nuked Partitions</h2> 28 <p>I deleted and recovered my home partition twice while I was trying to get the installation to work. In this case, run <code>apk add testdisk</code>. After starting testdisk, select "Proceed" and "Analyze" on the deleted partition.</p> 29 <h2>Resources</h2> 30 <ul> 31 <li><a href="https://docs.alpinelinux.org/user-handbook/0.1a/Installing/manual.html">Installation with manual partitioning</a></li> 32 <li><a href="https://wiki.alpinelinux.org/wiki/Wi-Fi">Connecting to Wi-Fi during installation</a></li> 33 <li><a href="https://wiki.alpinelinux.org/wiki/Filesystems">File system tools for formatting</a></li> 34 <li><a href="https://wiki.alpinelinux.org/wiki/PipeWire">Setting up PipeWire</a></li> 35 <li><a href="https://wiki.alpinelinux.org/wiki/Dwm">Setting up dwm</a></li> 36 </ul> 37 <h2>Update: 2025 Jan 4th</h2> 38 <p>I installed Alpine without overwriting my home partition by doing the following instead of following the <a href="https://docs.alpinelinux.org/user-handbook/0.1a/Installing/manual.html">manual installation guide</a> that is linked above:</p> 39 <pre> 40 fdisk /dev/sda 41 reboot 42 apk add e2fsprogs 43 mkfs.ext4 /dev/sdaX # repeat for new partitions, with X being the number of the partition 44 setup-alpine # answer "none" when asked where to install 45 mount -t ext4 /dev/sda3 /mnt # replace 3 with the number of the root partition 46 mkdir /mnt/boot 47 mount -t ext4 /dev/sda1 /mnt/boot # replace 1 with the number of the boot partition 48 mkdir /mnt/home 49 mount -t ext4 /dev/sda2 /mnt/home # replace 2 with the number of the home partition 50 setup-disk -m sys /mnt 51 reboot</pre> 52 <p>When mounting the boot partition, there were no errors. I double-checked by rebooting and, again, found no errors.</p> 53 <p>However, after compiling dwm and st and rebooting, the files in the /boot folder were removed. I got the same errors with the boot partition as before.</p> 54 <p>Having more steps to set up PipeWire is not as big of a problem as what I mentioned. Since Alpine is minimal, it is expected that adding programs would require more configuration. Running <code>apk add alsa-utils alsaconf</code> is enough to get working audio with <a href="https://wiki.alpinelinux.org/wiki/ALSA">ALSA</a>, assuming that the user is in the audio group.</p> 55 <p>When I reinstalled Artix, I decided on <s>only using ALSA without PipeWire and</s> using dinit instead of OpenRC. It starts up a lot faster than OpenRC, but there is less documentation for it since it is newer.</p> 56 <p>I switched back to using PipeWire after I had trouble recording with my microphone.</p> 57 </article> 58 <footer> 59 <hr> 60 <a href="/">Home Page</a></footer> 61 </body> 62 </html>