Using the Btrfs backing store
The B-tree filesystem (Btrfs) is a COW filesystem that provides modern features such as dynamic inode allocation, compression, and online filesystem defragmentation - and most importantly for the purposes of this book, writable and read-only snapshots.
Without going into much detail about the design of Btrfs, the following diagram shows the main components of the filesystem:
Each Btrfs filesystem consists of a Btrfs Root Tree, which records the root block for the Extent Tree and Subvolume Tree. The root block pointers are updated with each transaction, to point to the new roots created by the transaction. The Extent Tree shown in the preceding diagram manages disk space and contains information about the blocks on the device. The Subvolume Tree record snapshots, which are subvolumes.
Note that subvolumes are different than the LVs in the LVM, in the sense that the Btrfs subvolume is not an actual block device.
Let's look at a few examples on how to use the...