New Installation: BTRFS and Snapshots

Hello Forum,

as my new laptop is still not here I read a lot do installations - in my mind.

I found this blog https://www.lorenzobettini.it/2023/03/snapper-and-grub-btrfs-in-arch-linux/ here which covers more or less all, what I would like to do (There are several others).

  1. As I understand, booting from BTRFS-snapshots is only possible with Grub (plus Grub-btrfs), right? SystemD-Boot does not work? I think, it is generally not a problem - I used Grub some time ago (atm with the my “old” laptop it is efistub)
  2. is booting from snapshot also possible with encrypted/LUKS (EFI not encrypted, rest of SSD encrypted formatted with BTRFS with /, /home, /.snapshots … SWAP as subvolumes)? I would like to have the system encrypted as a laptop can get lost somehow.
  3. read about subvolumes: @/ and @/home are minimum; I also found @/var, @/log and @cache and others … I am not sure, if all of these are required. So, I will make up my mind with that.
  4. I also think about SWAP being put as single partition besides EFI and LUKS - so not part of the LUKS (with fstab entry to use SWAP encrypted - some years back I used this, but I have to look up how to configure); any advantage?
  5. is suspend-to-disk (to SWAP) possible for 2. and 3.? (but I am still not sure if I want to spend 64 GB+ for that)

That is what all the read information condensed to. Any comment is welcome.

Ciao,
Photor

PS: When this new machine arrives I will use the pre-installed Linux (Ubuntu-based) to try out the new setup in a virtual machine - which will then replace the system on this particular machine :smirk:.
PPS: still reading here in the forum anyway.

1 Like

Yes, it is better to use grub for this.

Yes, grub decrypts the volume and then boots the snapshot. This is not an issue.

You should not create @var on an Arch-based distro. Pacman keeps some files there that should not be separated from root.

The installer will create @, @home, @cache and @log by default.

The installer will do this for you if you create a swap partition and check the box to encrypt it.

Yes.

1 Like

um …, that’s not so, my newly installed Btrfs-EOS (using Calamares default setup) has created this:

  • @/.snapshots is created by snapper.
  • @/var/lib/machines and @/var/lib/portables are created by systemd IIRC.
  • @swap is only created if you request swap
2 Likes

I requested “Swap with hibernation” during the installation. Why I don’t see that on my subvolume list? Only if you use Swap file or something?

1 Like

Yes, exactly.

2 Likes

Hello,

thank you all for the input. That makes the picture in my mind clearer; the learnings are:

  • I will trust in Endeavour-Installer in general; looks like, that it covers several questions I have with useful defaults (I have still ArchLinux in my mind, sorry)
  • generally I do not want to have too many subvolumes (but there is no hard reason to avoid them as all of them can grow - no fixed partition size); / and /home would be OK for me
  • snapshots is new - but going with the defaults should work (see above)

Now, only the new laptop is missing to dive into all this. Waiting …

Ciao,
Photor

2 Likes