Moving LXC container to USB

@ajsicek: Maybe Foris 3.10 might be an easier solution for you (not tested by me).

Anyway:

  1. 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
  1. Replace /srv on local storage with external storage

  2. 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
  1. Profit!

This link may be useful:

1 Like