Btrfs is a filesystem and the one that I’m currently using on my T480 laptop. It has modern features but also has some features that were unstable as of time of writing (2022).
Btrfs is a modern copy on write (CoW) filesystem for Linux aimed at implementing advanced features while also focusing on fault tolerance, repair and easy administration.
As usual, head to the Arch Wiki for a good summary of working with btrfs.
Btrfs - ArchWiki
Subvolumes
Commands
Creating a subvolume
To create a subvolume:
btrfs subvolume create /path/to/subvolumeListing subvolumes
To see a list of current subvolumes and their ids under path:
btrfs subvolume list -p pathDeleting a subvolume
To delete a subvolume:
btrfs subvolume delete /path/to/subvolumeSince Linux 4.18, one can also delete a subvolume like a regular directory (rm -r, rmdir). Mounting subvolumes
Mounting a subvolume
Subvolumes can be mounted like file system partitions using the subvol=/path/to/subvolume
Displaying filesystem used/free space
General linux userspace tools such as df(1) will inaccurately report free space on a Btrfs partition. It is recommended to use btrfs filesystem usage to query Btrfs partitions. For example, for a full breakdown of device allocation and usage stats:
btrfs filesystem usage /Snapshots
“A snapshot is simply a subvolume that shares its data (and metadata) with some other subvolume, using btrfs’s COW capabilities.”
To create a snapshot:
btrfs subvolume snapshot source [dest/]nameTo create a readonly snapshot add the -r flag. To create writable version of a readonly snapshot, simply create a snapshot of it.
Note: It is possible for a snapshot to be converted in-place from readonly to writeable. However, this is not recommended because it causes issues with any future incremental send/receive. Making a new writeable snapshot prevents such issues. Snapshots are not recursive. Every nested subvolume will be an empty directory inside the snapshot.
Snapper
Snapper is a tool created by openSUSE’s Arvin Schnell that helps with managing snapshots of Btrfs subvolumes and thin-provisioned LVM volumes. It can create and compare snapshots, revert between snapshots, and supports automatic snapshots timelines. Snapper - ArchWiki
Booting into Snapshots
In order to boot into a snapshot, the same procedure applies as for mounting a subvolume as your root partition, as given in section mounting a subvolume as your root partition, because snapshots can be mounted like subvolumes.
If using GRUB you can automatically populate your boot menu with btrfs snapshots when regenerating the configuration file with the help of grub-btrfs or grub-btrfs-gitAUR. If using rEFInd you can automatically populate your boot menu with btrfs snapshots with the help of refind-btrfsAUR, after enabling refind-btrfs.service.