How to Setup Ubuntu 26.04 with Btrfs
| Niladic Podcast
How to Setup Ubuntu 26.04 with Btrfs
Posted by Cody on 2026-05-23
Ubuntu 26.04 LTS was released a month ago and it comes with Linux kernel version 7.0 which was also release a month ago. https://en.wikipedia.org/wiki/Linux_kernel_version_history
Let's evaluate if Ubuntu is a good recommendation for someone looking for an alternative to Windows.
On paper it is a great recommendation:
Data corruption repair (Btrfs/ZFS)
Immune to Windows malware
Immune to phone scams
Can't install three different antiviruses at the same time and make the computer slow
No forced disruptive updates (ex. Copilot all the things)
No long waits for Windows to update
I'm using a Dell Latitude 5520 laptop from 2021, so there shouldn't be any drivers missing or any issues for 5 year old hardware.
My goal is simple, install Ubuntu 26.04 and use Btrfs with local snapshots as backups on a 5 year old laptop.
Since you can't create Btrfs subvolumes in the Installer this is a guide to create Btrfs subvolumes, configure hibernate to work with them and improve the suspend battery usage.
Installation Wizard
The installation wizard doesn't have an option for Btrfs but it does have an option for ZFS. Btrfs has been around for several years, it should be an options like ZFS.
That's okay I'll just manually create a partition with a Btrfs filesystem and some Btrfs subvolumes.
The partition manager in the wizard is clunky. First I tried to create a FAT32 boot partition but there is no FAT32 filesystem option.
Curiously ZFS is not an option even though it was one of the filesystems you could pick if you didn't select manual partitions.
I selected VFAT and /boot mount point.
But it didn't like that:
/boot is not a supported filesystem for VFAT.
The partition step in the installation wizard will let you create a Btrfs partition but it won't let you create a subvolume. That's not ideal since you won't be able to use Timeshift which will automatically create snapshots (backups) that you can use to restore your filesystem. Timeshift takes snapshots of a subvolume and stores them in a subvolume.
Alright I'll create two Btrfs partitions for now and I'll move the files into subvolumes later. I created a Btrfs partition for /home which is nvme0n1p1 and it automatically creates a boot partition labeled nvme0n1p2. I would like the boot partition to be the first partition but since you can't create a FAT32 partition and you can't change the partition name of the boot partition it automatically created, the first partition can't be the first partition. I'm not a perfectionist so this isn't a big deal.
I created another Btrfs partition for / which is nvme0n1p3.
Curiously when I ran the installer again it to get the steps down it showed the boot partition which was previously FAT32 as VFAT, which is confusing.
Creating Btrfs Subvolumes
This is how I moved the files in the partition into a new Btrfs subvolume in the partition so I could use Timeshift. I also enabled zstd compression while I was at it.
I booted back into the live environment of the installation media and ran the following commands.
I opened a terminal with ctrl+alt+t and ran:
sudo mkdir -p /mnt/home<br>sudo mount /dev/nvme0n1p1 /mnt/home<br>sudo btrfs subvolume create /mnt/home/@home<br>sudo mv /mnt/home/* /mnt/home/@home/
Ignore this error.
mv: cannot move '/mnt/home/@home' to a subdirectory of itself, '/mnt/home/@home/@home'
There is definitely a better command but that works.
While the subvolume is mounted we can compress the files.
sudo btrfs filesystem defragment -r -v -czstd /mnt/home/@home
Unmount /home partition
sudo umount /mnt/home<br>sudo rmdir /mnt/home
Move files in / partition to new @ Btrfs subvolume
sudo mount /dev/nvme0n1p3 /mnt<br>sudo btrfs subvolume create /mnt/@<br>cd /mnt/<br>sudo mv boot dev lib64 proc run snap sys usr bin cdrom etc lib media opt root sbin srv tmp var -t @<br>sudo rmdir home mnt<br>cd
sudo vi /mnt/@/etc/fstab
Find defaults for both of the Btrfs partitions and add the subvol and compress so future files will be compressed.
defaults,subvol=@,compress=zstd:3<br>defaults,subvol=@home,compress=zstd:3
Curiously the pass value which is the last value on the line is 1 when it should be 0 for Btrfs.
Why wasn't it set when the filesystem was set to Btrfs?
Here is what my /etc/fstab contains
# / was on /dev/nvme0n1p3 during curtin installation<br>/dev/disk/by-uuid/8026ffff-0d1a-4f2c-9afa-901d6d34763a / btrfs defaults,subvol=@,compress=zstd:3 0 0<br># /home was on /dev/nvme0n1p1 during curtin installation<br>/dev/disk/by-uuid/b6a801ac-fbe1-437c-bd76-107333946ef2 /home btrfs defaults,subvol=@home,compress=zstd:3 0 0<br># /boot/efi was on /dev/nvme0n1p2 during curtin installation<br>/dev/disk/by-uuid/E019-C652 /boot/efi vfat defaults 0 1
Now that we modified /etc/fstab we an compress all of the files.
sudo btrfs filesystem defragment -r -v -czstd /mnt/@
Unmount
sudo umount /mnt
Now there are two options to fix...