Arch Linux with BTRFS and raid
25 Sep 2023 • ~800 words • ~4 minute read
Following on from my previous post about installing Arch Linux on an old unused laptop, I decided to refresh my main daily driver desktop. When I put Linux on it back in 2019 or thereabouts, I nicked a smallish portion of space (70GB or something - more than enough for a Linux distro to function) from the main drive which runs Windows, as at the time I was just exploring and had no idea I would end up sticking to Linux full time.
The issue over time was that I kept running out of space, so I would do the usual purge of things I wasn't needing, etc. I occasionally freed up more space in a separate partition. But none of this was ideal, so I recently spent a bit of money on adding a new SSD and HDD to the tower.
I've now got two SSDs, two HDDs and more than enough storage space! I decided to install Arch afresh and make a few fun changes to my setup!
Device partitions
With this massive expansion, I can now leave the used Windows partitions alone! I literally boot into Windows once in a blue moon, but have so much stuff that gathered over the years that I would not want to massively reduce/change how/where things are being stored without a bit more planning and preparation.
- Each SSD (one 500GB, one 1TB) now has a 100GB partition for my root stuff (
/
) - Each HDD (both 2TB) has a 500GB partition for my home stuff (
/home
) - The 1TB SSD has a dedicated 500GB partition for
/music
and another 300GB partition for misc stuff - The smaller SSD has a 16GB SWAP partition
FSTAB and Bootloader
I use to just mount devices manually as and when I need them, but I decided to simplify my life a bit and add most of my partitions to my file system table. So all the desired devices are just mounted as part of my file system from the get go. Much easier!
I also configured my GRUB to read my Windows boot too, so from the GRUB menu I can boot into my Windows installation. This saves me having to hit F2 for ages and going into the mobo menu at startup. Again, much easier!
Raiding with BTRFS!
As indicated in the first two bullet points above, I've done /
and /home
partitions twice. I've configured these in RAID1 using the BTRFS filesystem. So all data and metadata is duplicated on both devices, and the amount of storage space available is half of their combined sizes.
This gives me the peace of mind that there is redundancy across my entire installation and all my files. If one device fails, I can swap in a new one and execute a btrfs balance
command.
From what I have read, it's very easy to expand BTRFS raids and I have plenty of unpartitioned space on one of these drives.
Snapshots with BTRFS!
One of the main selling points with the BTRFS file system is its ability to create and manage file system snapshots quickly and easily.
I've set my system up to manage these with Timeshift. Whenever I update the system or install a package, Timeshift creates a snapshot of the system before changes are added. I also have one or two of my own; markers of the system once I've got something setup/working.
This has given me peace of mind to move onto the main Arch Linux kernal (I used to use LTS as it was more stable), as it means if I install anything problematic, I can just boot into the latest snapshot and restore my system.
I have actually already used this feature once and it was quick, painless and super simple!
Summary
So, for very little effort I've managed to really round out a resilient and easily maintainable installation of Arch Linux. The only reason I didn't do this sooner was because I thought it would be a faff (and I didn't have the storage available). But it was easy as pie!
I've been running the system with these improvements for about 6 weeks now and am pretty happy with it! The next project I've been putting off is implementing a proper backup policy.
In honour of these improvements, I've also been running Hyprland as my window manager, but that can be an update for another day!