Manjaro-arm-tools Raspberry Pi 4 BTRFS

I try to create a Raspberry Pi 4 images with BTRFS with more subvolumes then only the home subvolume. And I want to prepare it for snapper. How can I achieve this? I tried it with buildarming but I think that is the wrong tool.

I cannot vouch for this being the easiest route, but following the Arch Linux Installation Guide (from, say, a minimal Manjaro ARM image) should work; note that due to the nature of RPI booting, /boot needs to be a separate FAT partition.

1 Like

The Manjaro ARM Tools set a specific subvolume layout (/ and /home), but can easily be modified by modifying the scripts.

But as @robg mentioned above, your best bet is probably to follow the Arch guides on how to set up a system with btrfs, if the defaults does not fit you. If that is too much work, then the defaults should fit you fine.

How can get a system on the Raspberry Pi where I can modify the btrfs layout? Is the best option to modify a rootfs, or must I simply create an image for a Raspberry Pi with btrf support and modify that? I can find all the information I want for an x86_64 architecture booting with a ISO, but how can I accomplice that on a Raspberry Pi?

I don’t know how easy it is to modify an already existing setup, so I think your best bet, is to modify the tools to create the layout you want and then create the image and test it.

Use the manjaro-arm-installer to make a btrfs installation, then boot and configure it.

With sudo, edit /etc/fstab, make an entry similar to the following, using your UUID and preferred mount options:

UUID=0fcf1e2a-0aa7-4e66-b3e2-30f261738470 /.btrfs        btrfs   defaults,noatime,space_cache,subvolid=5         0 2

Then make the mount point:
sudo mkdir /.btrfs

And finally mount it:
sudo mount /.btrfs

Then run the following to see what you have:
ls -l /.btrfs

drwxr-xr-x 1 root root 410 Aug  5 09:23 @
drwxr-xr-x 1 root root 130 Aug  2 12:25 @cache
drwxr-xr-x 1 root root  14 Jul 30 12:40 @home
drwxr-xr-x 1 root root 232 Sep  1 00:00 @log

You should see something like the above. You can then cd /.btrfs and make whatever btrfs subvolume adjustments you would prefer. Then modify your /etc/fstab to mount them.

Edit: I use the following for snapper to keep my snapshots off of the @ subvolume, but your goals may be different:

UUID=0fcf1e2a-0aa7-4e66-b3e2-30f261738470 /.snapshots    btrfs   defaults,noatime,space_cache,subvol=/@snapshots 0 2