Generic

BTRFS Support

  1. Grow FS via systemd on boot:

    Add x-systemd.growfs to /etc/fstab.

    Example:

    /dev/mapper/dmroot  /    ext4  defaults,discard,relatime,x-systemd.growfs  1  1
    /dev/xvdb           /rw  auto  noauto,defaults,discard,x-systemd.growfs    1  2

    Qubes has a built-in mechanism for resizing the FS on boot but it is limited to ext4.

  2. (Re)mount FS with discard=async:

    Create /etc/systemd/system/qubes-btrfs-remount@.service:

    [Unit]
    Description=Set custom mount options on BTRFS
    After=%i.mount
    Requisite=%i.mount
    ConditionKernelVersion=>=5.6
    
    [Service]
    ExecCondition=findmnt -t btrfs /%I
    ExecStart=mount -o remount,discard=async /%I
    
    [Install]
    WantedBy=multi-user.target
    

    Enable for /:

    systemctl enable qubes-btrfs-remount@-.service
    

    Enable for /rw/:

    systemctl enable qubes-btrfs-remount@rw.service