My goal is to make easy and sustainable snapshotting available in Calamares for a future manjaro release. On the roadmap there following subtasks:
- Make the calamares swapfile generation work with btrfs ([WIP] Btrfs swapfile handling by Chrysostomus · Pull Request #1597 · calamares/calamares · GitHub)
- without its own subvolume with disabled cow, swapfile can lead to file system corruption
- Enable distro configurable subvolume layout in calamares so we can have more sophisticated layout
- Current layout wastes space by snapshotting rapidly changing low value data like pacman cache, and restoring snapshots also loses the log files.
- Automatically install grub-btrfs, timeshift-autosnap and btrfs-maintenance if btrfs is chosen
- Btrfs-maintenance is needed to free up space from accumulating metadata. Regular users should not need to worry about this manually. Timeshift-autosnap and grub-btrfs provide easy bootable snapshots on every update.
- Let users choose the filesystem (Allow selecting the FS from GUI · Issue #847 · calamares/calamares · GitHub)
- Patch timeshift to preserve the subvolume layout when restoring a snapshot (Preserve default subvolume name in snapshot restoration · Issue #694 · teejee2008/timeshift · GitHub)
This topic is for discussing what would be the best default subvolume layout for btrfs systems.
- @ for / and @home for /home are required for timeshift to work.
- Should @home use nodatacow by default? Cow causes abysmal performance for virtual machines and databases, which are commonly stored under /home directory. Datacow can be disabled on smaller scale too, but virtual machine directories don’t yet exist at install time. You lose some nifty features like reflink copies, but it might be easier for new users.
- @log for /var/log would preserve log files between snapshot restorations. On the other hand, the system state would no longer be reflected in the logs. Pacman log might show you installed a package, but that package is no longer installed because you restored a snapshot.
- @cache for /var/cache would prevent the differences between snapshots from growing too much, saving a lot of space.
- @tmp for /var/tmp, same reason as cache subvolume
- @mt for /var/lib/manjaro-tools would keep manjaro-tools from blocking automatic snapshot deletation. Not too interesting for most users, but very useful for developers
- Some distros use a subvolume for /srv, but we are not a server distro so I don’t think that matters.
Does anyone have any other suggestions for btrfs support in manjaro? @eugen-b?