So here is the situation. I have installe Debian lxc container on my omnia a installed an Unifi controller to have better control over my Unifi APs.
Now to protect the Omnia internal memory I would like to move the entire container to a USB dongle or to a LAN NAS (I have 3 - two WD and a Seagate Black Armor).
First thing I intended to do was to copy the entire /srv/lxc/Debian folder on the mounted USB stick and change the links in config files but that does not work.
Is there any other option apart from creating new container and istalling that one directly to the USB Drive?
And then there is second question and that is how to mount a NAS drive in the network so the Omnia would be able to see it.
Move whatever you want 1:1 to new location and create symlink in original location referring to new location. Then you donāt need to care about configs or possible rewrites of them after updates etc.
I canāt remember this problem while moving my lxc from internal storage to SSD. Maybe in case of USB itās different.
Just to make sure: this is needed when moving to another file system or it is just needed when moving from one system to another (move lxc from one machine to another).
Thank youā¦
And I say it works! I didnāt use the symlink, just updated the path to /mnt/sda1 in the LXC container config file. So now the statistic and Unify controller remains on the USB stick. Its not slower, than it was before!
I am trying to do the same as āsubjectā. And I am not sure i can follow the solution provided.
Could you ( @vit or @dbonnes ) please summarize all the steps necessary to do to move the container from omnia internal memory to usb attached.
Thanks a lot
@ajsicek: Maybe Foris 3.10 might be an easier solution for you (not tested by me).
Anyway:
For each LXC:
for NAME in guacd nginx home mysql tomcat; do
lxc-stop -n ${NAME}
cd /srv/lxc/${NAME}/
tar --numeric-owner -czvf /tmp/run/mountd/sdb1/lxc-${NAME}.tar.gz ./*
done
Replace /srv on local storage with external storage
For each LXC:
for NAME in guacd nginx home mysql tomcat; do
mkdir -p /srv/lxc/${NAME}/
cd /srv/lxc/${NAME}/
tar --numeric-owner -xzvf /tmp/run/mountd/sdb1/lxc-${NAME}.tar.gz .
done