How to set path when creating loop disk storage?

I am creating a loop disk storage, but the disk files are stored under /var/lib/lxd/disks, how to set it?
I tried specifying source=/mnt/test.img, but it doesn’t work.

# lxc storage create test btrfs source=/mnt/test.img
Error: Failed to run: btrfs subvolume create /mnt/test.img: exit status 1 (ERROR: not a btrfs filesystem: /mnt)

I tried truncate to create a loop disk

# truncate -s 5G /mnt/test.img
# lxc storage create test1 btrfs source=/mnt/test.img
Error: Provided path does not reside on a btrfs filesystem

Hi @antonchen, here is a post that mentioned the subject.
Regards.
https://discuss.linuxcontainers.org/t/noob-question-how-to-create-additional-storage-loop-file-based-dir-etc/5820/3

1 Like

thank you.