Re: [lxc-users] About creating a BTRFS file instead of a BTRFS partition
On Wed, Jun 4, 2014 at 5:49 PM, Marcel Sánchez Toledano marcelsanch...@gmail.com wrote: Hi all again, Recently I've been asked if it's possible to store LXC containers in a BTRFS filesystem. I know it is possible to do this creating a partition in BTRFS and setting the path in that partition. But what I need to know if it's possible to create the BTRFS filesystem inside a file (not a partition). I mean, an expandable file, which will be the path for LXC containers. from man lxc.container.conf: lxc.rootfs specify the root file system for the container. It can be an *image file*, a directory or a block device. Does that answer your question? -- Fajar ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users
Re: [lxc-users] About creating a BTRFS file instead of a BTRFS partition
Partially yes. Thanks for that. Maybe is a bit offtopic, but.. Do you know any manual or website where I can found information about creating a image file with BRTFS? I have tried with no luck... Thank you again, *Marcel Sánchez Toledano* 2014-06-04 12:58 GMT+02:00 Fajar A. Nugraha l...@fajar.net: On Wed, Jun 4, 2014 at 5:49 PM, Marcel Sánchez Toledano marcelsanch...@gmail.com wrote: Hi all again, Recently I've been asked if it's possible to store LXC containers in a BTRFS filesystem. I know it is possible to do this creating a partition in BTRFS and setting the path in that partition. But what I need to know if it's possible to create the BTRFS filesystem inside a file (not a partition). I mean, an expandable file, which will be the path for LXC containers. from man lxc.container.conf: lxc.rootfs specify the root file system for the container. It can be an *image file*, a directory or a block device. Does that answer your question? -- Fajar ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users
Re: [lxc-users] About creating a BTRFS file instead of a BTRFS partition
On Wed, Jun 4, 2014 at 6:04 PM, Marcel Sánchez Toledano marcelsanch...@gmail.com wrote: Partially yes. Thanks for that. Maybe is a bit offtopic, but.. Do you know any manual or website where I can found information about creating a image file with BRTFS? have you ever created an image file with ANY filesystem? I have tried with no luck... What have you tried? The generic method would be - create a file with appropriate size (truncate, dd, whatever) - mkfs (e.g mkfs.btrfs, mkfs.ext4, whatever) - mount -o loop ... - fill the mounted fs (debootstrap, rsync, whatever) If your question is how to create a rootfs image suitable for lxc, then the easiest method is to simply use lxc templates to create directory-backed container, and then copy the files to the image. -- Fajar ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users
Re: [lxc-users] About creating a BTRFS file instead of a BTRFS partition
Quoting Marcel Sánchez Toledano (marcelsanch...@gmail.com): Partially yes. Thanks for that. Maybe is a bit offtopic, but.. Do you know any manual or website where I can found information about creating a image file with BRTFS? I have tried with no luck... If you want a loopback file, you can just sudo lxc-create -t download -B loop -n loop1 -- -d ubuntu -r trusty -a amd64 (just tested, still works for me) You can specify the loopback size and fstype as well (see lxc-create(1)). ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users
Re: [lxc-users] About creating a BTRFS file instead of a BTRFS partition
I assume that: sudo lxc-create -t ubuntu -B loop --fstype btrfs -n loop1 Should be the same as creating a loopback filesystem (as specified here http://www.walkernews.net/2007/07/01/create-linux-loopback-file-system-on-disk-file/, but with btrfs instead of ext3) and then: lxc-create -n template -t ubuntu -B btrfs and specifing in lxc.rootfs the path mnt/vfs, for example. Is that correct? *Marcel Sánchez Toledano* 2014-06-04 15:15 GMT+02:00 Serge Hallyn serge.hal...@ubuntu.com: Quoting Marcel Sánchez Toledano (marcelsanch...@gmail.com): Partially yes. Thanks for that. Maybe is a bit offtopic, but.. Do you know any manual or website where I can found information about creating a image file with BRTFS? I have tried with no luck... If you want a loopback file, you can just sudo lxc-create -t download -B loop -n loop1 -- -d ubuntu -r trusty -a amd64 (just tested, still works for me) You can specify the loopback size and fstype as well (see lxc-create(1)). ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users
Re: [lxc-users] About creating a BTRFS file instead of a BTRFS partition
If I'm understanding you right, then yes. Quoting Marcel Sánchez Toledano (marcelsanch...@gmail.com): I assume that: sudo lxc-create -t ubuntu -B loop --fstype btrfs -n loop1 Should be the same as creating a loopback filesystem (as specified here http://www.walkernews.net/2007/07/01/create-linux-loopback-file-system-on-disk-file/, but with btrfs instead of ext3) and then: lxc-create -n template -t ubuntu -B btrfs and specifing in lxc.rootfs the path mnt/vfs, for example. Is that correct? *Marcel Sánchez Toledano* 2014-06-04 15:15 GMT+02:00 Serge Hallyn serge.hal...@ubuntu.com: Quoting Marcel Sánchez Toledano (marcelsanch...@gmail.com): Partially yes. Thanks for that. Maybe is a bit offtopic, but.. Do you know any manual or website where I can found information about creating a image file with BRTFS? I have tried with no luck... If you want a loopback file, you can just sudo lxc-create -t download -B loop -n loop1 -- -d ubuntu -r trusty -a amd64 (just tested, still works for me) You can specify the loopback size and fstype as well (see lxc-create(1)). ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users ___ lxc-users mailing list lxc-users@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-users