Skip to content

Draft: main/postmarketos-base: btrfs subvol on /tmp if not tmpfs and rootfs is btrfs

Administrator requested to merge btrfs-on-tmp into master

Why

When the root filesystem is btrfs, we don't want temporary files and such to get snapshotted as part of the root subvolume. Btrfs snapshots can't include different filesystems (tmpfs) or subvolumes, so this isn't a problem if /tmp is mounted as tmpfs or is a subvolume. Not all devices have /tmp mounted as tmpfs by default, and it's also something the user can change between boots in /etc/deviceinfo.

What

By always creating a separate @tmp subvol in pmbootstrap when rootfs is btrfs (part of a MR I'll open in a day or two), and only mounting it on /tmp if the rootfs is btrfs and /tmp isn't tmpfs (this MR), we cover our bases.

Caveats

This change doesn't address the people who're already running btrfs, and don't have a @tmp subvol. It won't crash, but they won't get the benefits of clean snapshots. A solution would be a bit heavy for a startup script that would run every boot, me thinks. Maybe I'll make a script that converts the various generations of btrfs layouts to the final one, once everything stabilizes. The btrfs MR I've got cooking for pmbootstrap has great improvements, so ppl may just want to backup their device (btrfs send | receive), reflash, copy back and clean up.

Edited by Administrator

Merge request reports

Loading