LXD Container using Storage Pool on External Hard Drive


(Мэтью Смит) #1

Greetings:

I created a Storage Pool of about 10GB to get to know LXD. Well I created a container to run a HumHub instance and it was a success. Unfortunately with the nature of HumHub I can see running out of space relatively quickly. Is there a way to migrate the container to an external hard drive? Thank you!


#2

You can create an additional storage with lxc storage create
then you can use

lxc copy <mycontainer>  -s <mynewstorage> <mycontainer-2>

you need lxd 3.2 for that.
after you can rename the origin to -bak and the new to the original name (using lxc move)

You have of course to deal with the possibility the lxd service could start before the external disk is mounted. If necessary you could disable automatic starting of lxd service by disabling the snap


(Мэтью Смит) #3

Thank you, that worked perfectly