@Hagen,
I finally got around to documenting my installation. I’ll step through the main setup and highlight key changes that I have made from your above posts regarding installation.
I used Manjaro Architect to install the base OS. Key installation related items:
- LUKS Encryption: I decided to use one large encrypted partition
- BTRFS layout: default installer layout
@
→ /
@home
→ /home
@cache
→ /var/cache
(note that this had to be manually added to /etc/fstab
)
- Grub bootloader so I could use grub-btrfs, as in your guide.
Post-installation, I set up Snapper the same was you recommended above: delete Snapper .snapshots
subvolumes under @
and @home
, replace with directory, create @snapshots
root subvolume with @snapshots/root
and @snapshots/home
subvolumes mounted to /.snapshots
and /home/.snapshots
, respectively. I also installed snap-pac
and snap-sync
.
For grub-btrfs, I discovered a reasonably elegant way to work with read-only snapshots without requiring /var
to be writeable on the filesystem. It uses the overlayfs hook as per instructions at grub-btrfs github. From the repo:
Booting on a snapshot in read-only mode can be tricky.
An elegant way is to boot this snapshot using overlayfs (included in the kernel ≥ 3.18).
Using overlayfs, the booted snapshot will behave like a live-cd in non-persistent mode.
The snapshot will not be modified, the system will be able to boot correctly, because a writeable folder will be included in the ram.
(no more problems due to /var
not open for writing)
Any changes in this system thus started will be lost when the system is rebooted/shutdown.
wget https://github.com/Antynea/grub-btrfs/raw/master/initramfs/Arch%20Linux/overlay_snap_ro-hook
wget https://github.com/Antynea/grub-btrfs/raw/master/initramfs/Arch%20Linux/overlay_snap_ro-install
mv overlay_snap_ro-hook /etc/initcpio/hooks/grub-btrfs-overlayfs
mv overlay_snap_ro-install /etc/initcpio/install/grub-btrfs-overlayfs
Re-generate initramfs:
mkinitcpio -P
With this, I realize I’m likely resulting in a bit of write amplification on /var
since it’s part of the COW root filesystem, but I like that its all contained and issues with booting into the DE are resolved by having a writeable upper dir in the overlayfs.
I’ve tested out rebooting into snapshots and it seems to work flawlessly. Thanks a lot for the wealth of information in this thread for me to have built on.
As an aside, I haven’t yet gotten around to needing Docker or libvirt on this machine, but when I do, I’ll just create systemd mount definitions for their respective subvolumes to ensure that their mounted prior to those services starting. This isn’t a huge priority right now.