Attach Additional, LVM-backed Volume

This can be useful when more storage is needed temporarily or when certain directories should be excluded from backups.

  1. Create logical volume:

    lvcreate -V ${SIZE} --thinpool vm-pool qubes_dom0 --name ${VOLUME_NAME}

    Set SIZE size to the virtual size of the disk (e.g. 50GiB).

  2. Find device ID:

    $ qvm-block
    ${DEVICE_ID}   qubes_dom0-${VOLUME_NAME}
  3. Attach to Qube:

    qvm-block attach ${QUBE_NAME} ${DEVICE_ID} -o frontend-dev=xvdl


    --persistent cannot be used as ${DEVICE_ID} is not persistent across reboots.

BTRFS subvolumes offer an easy way to move multiple directories onto an additional volume:

  1. Format filesystem. See Create FS.

  2. Mount filesystem:

    mount /dev/xvdl /mnt
  3. Create subvolumes for every directory:

    btrfs subvolume create /mnt/@volume1
    btrfs subvolume create /mnt/@volume2
  4. Move files

  5. Umount FS:

    umount /mnt
  6. Mount individual volumes:

    mount /dev/xvdl ~user/volume1 -t btrfs -o discard=async,noatime,subvol=@volume1
    mount /dev/xvdl /var/lib/volume2 -t btrfs -o discard=async,noatime,subvol=@volume2

Resize Additional, LVM-backed Volume

  1. (dom0) Resize volume by ${N} GiB:

    lvresize --size +${N}GiB qubes_dom0/${VOLUME_NAME}

    Or resize volume to ${N} GiB:

    lvresize --size ${N}GiB qubes_dom0/${VOLUME_NAME}
  2. (Qube) Resize filesystem:

    btrfs filesystem resize max ${MOUNT_POINT}