If you need to run your databases in lxc, what happen to your data files? Do you have access to the data file on the host os? I guess the processes show up in the gust os process but who about the the files given that lxc has its own file system?

Any other consideration to run your db inside lxc?


LXC is similar to OpenVZ (OS level virtualization), in short LXC uses host OS file system directly. So the containers' file system (database data files) is accessible from the host anyway (Btrfs is recommended to take advantage of snapshot features).

If you consider using LXC, definitely take a look at Docker which is a nice wrapper for LXC (like Vagrant for VirtualBox) which makes it a lot easier and user-friendly. in addition, there are plenty of pre-built container templates ready for use.

  • Thanks. So if the container is stopped, the data disappear on the host os? – iCode Sep 21 '13 at 12:39
  • No, data will be on the host file system unless you destroy or remove the container. – Terry Wang Sep 22 '13 at 2:31
  • I'm wondering if could possibly bind mount DB data partition directly into underlying LXC filesystem using something like: lxc.mount.entry which will stick the mount into LXCs fstab and mount it on start ? – milosgajdos Oct 28 '13 at 0:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.