bob/roles/filesystem/README.md
Marty Oehme bb9de502ce
feat: Set up filesystems
Automatically set up btrfs root and data filesystem, as well as external
HDD.

This automation change assumes a layout exactly as in current bob to
function by default, can be changed to any btrfs layout with the
`btrfs_mounts` configuration option, however.
2025-11-19 22:13:08 +01:00

1.3 KiB

filesystem

Mounts the filesystem(s) required for bob. Focused on correct btrfs layout and mounting, but also mounts an external ext4 HDD by default.

Requirements

This role requires a btrfs filesystem existing on any device that is targeted with the role (using the 'btrfs_mounts') configuration option. Optionally, an external HDD is required if the mount toggle is true.

Role Variables

btrfs_mounts can be used to set up the various (top-level) btrfs subvolumes, and their later mount points in the system. Define an entry by giving the uuid of the targeted btrfs filesystem (or device), give the name of the subvol you intend to give, and define the path where it should ultimately be mounted by fstab. You can additionally provide some opts which are given to fstab for the mount process as well.

Example:

btrfs_mounts:
  - path: "/home"
    subvol: "@home"
    uuid: "3204f33f-5fa7-4c11-bdd8-979c539fce91"
    opts: "defaults,ssd,noatime,compress=zstd:3,space_cache=v2"

  - path: "/srv/media"
    subvol: "@media"
    uuid: "2256bd23-7751-486a-bfc4-b216a6b0c4f4"
    opts: "defaults,noatime,compress=zstd:3,space_cache=v2"

should_mount_external_hdd can be toggled to automatically mount a USB-connected HDD on boot, or not.