Pop!_OS 22.04 with btrfs, luks encryption, automatic system snapshots with Timeshift & rollback demo
Channel: Willi Mutschler
Date: 2022-05-29

All commands and the written guide: https://mutschler.dev/linux/pop-os-btrfs-22-04/
If you want to support the creation of such videos: https://buymeacoff.ee/mutschler

---------------------------------------------- 
In this video we'll install Pop!_OS 22.04 with the following structure:
- an encrypted btrfs partition (with LVM) for the root filesystem
  - the btrfs logical volume contains a subvolume `@` for `/` and a subvolume `@home` for `/home`. Note that the Pop!_OS installer does not create btrfs subvolumes by default, so we need to do this manually.
- an encrypted swap partition which works with hibernation
- an unencrypted EFI partition for the systemd bootloader
- an unencrypted partition for the Pop!_OS recovery system
- automatic system snapshots and easy rollback using:
  - [timeshift](https://github.com/teejee2008/timeshift) which will regularly take (almost instant) snapshots of the system
  - [timeshift-autosnap-apt](https://github.com/wmutschl/timeshift-autosnap-apt) which creates btrfs snapshot with timeshift on any system update with apt

---------------------------------------------- 
Contents
00:00 - Intro
00:44 - Boot into live system (I use Ventoy for that)
01:54 - Choose Language, Region and Keyboard Layout
02:08 - Create Partition Layout by simply doing a clean install (without btrfs first)
04:27 - (Optional) Understand default partition layout, i.e. how luks and LVM are used by POP!_OS
10:23 - Do the second and actual Install with BTRFS as the filesystem inside encrypted LUKS partition
13:26 - Why we need post-installation steps when using BTRFS in POP!_OS
15:13 - Unlock luks partition
15:28 - Mount top level root of btrfs partition to /mnt using optimized mount options
18:05 - Create btrfs subvolumes @ and @home and move files into the subvolumes
21:08 - Make changes to fstab
23:24 - Crypttab: see encrypted swap and make discard work
24:01 - Add rootflags to kernelstub
25:08 - Mount EFI partition to add rootflags to systemd bootloader conf files (and optional timeout)
26:26 - Chroot into your system and update the initramfs
29:03 - Reboot
30:45 - Some checks whether everything is set up correctly
31:52 - Enable fstrim timer and check lvm.conf file for issue_discards=1
32:43 - Update and upgrade your system
33:36 - Install and set up timeshift for btrfs
36:52 - Install and set up timeshift-autosnap-apt
40:24 - Some details on automatic timeshift snapshots and where they can be found on the disk
42:29 - Demo how to restore system to a certain snapshot using Timeshift from the Recovery system
47:10 - Outro

---------------------------------------------- 
IMPORTANT NOTES AND CORRECTIONS
-

If you want to support the creation of such videos: https://buymeacoff.ee/mutschler