I use btrfs on my system and have created an LXC container with Xubuntu on it. Now I'd like to use that as a base for other containers. Since it's a btrfs, I can use cp --reflink to create a copy-on-write copy of a file or folder. This seems kind of ideal in my use case, but I was wondering if lxc-clone will make use of that or create full copies when I use a directory backing rather than btrfs?


You can always bedup later. It is blazingly fast (incremental run takes only seconds to finish), thanks to the advanced features of btrfs, so you can put as an upstart job.

It's not an answer, but rather a walkaround.

  • It is a very welcome suggestion. I didn't know about bedup. That makes things a lot easier. It means I might as well use directory backing on btrfs. – Jo-Erlend Schinstad Jul 26 '14 at 11:18

Yes, lxc-clone will utilize btrfs capability of making COW copies as it's noted in Stephane Graber's blog entry in the paragraph "Cloning containers" if you use switch "-s" or have set up btrfs as your backing store.

UPD. I am very sorry, but it seems that I haven't read the question to the very end. If you use directory backing storage rather than btrfs, lxc-clone will NOT make COW copies.

  • Welcome to Ask Ubuntu! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. – Parto Jul 15 '14 at 16:15
  • Thank you for taking the time to update your answer. I suspected this to be the case. – Jo-Erlend Schinstad Jul 26 '14 at 11:16

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.