0

I am using zfs on some of my lxc containers at start when I was configuring I allocated 500GB

my zpool list

NAME   SIZE  ALLOC   FREE  EXPANDSZ   FRAG    CAP  DEDUP  HEALTH  ALTROOT
lxd    496G   247G   249G         -    44%    49%  1.00x  ONLINE  

my zfs listNAME

    USED  AVAIL  REFER  MOUNTPOINT
lxd                                                                                   247G   234G    19K  none
lxd/containers                                                                        246G   234G    19K  none
lxd/containers/container1                                                             36.6G   234G  36.9G /var/lib/lxd/containers/container1.zfs
lxd/containers/container2                                                             210G   234G   210G  /var/lib/lxd/containers/container2.zfs
lxd/deleted                                                                           304M   234G    19K  none
lxd/deleted/images                                                                    304M   234G    19K  none
lxd/deleted/images/b5f3a547289fabf26d90250605dc3067f1863ee46c802f004aa97954cc852c33   304M   234G   304M  none
lxd/images                                                                            304M   234G    19K  none
lxd/images/be7cec7c948958adfbb9bc7dbd292762d2388cc883466815fc2b6bc06bf06f5a           304M   234G   304M  /var/lib/lxd/images/be7cec7c948958adfbb9bc7dbd292762d2388cc883466815fc2b6bc06bf06f5a.zfs

I do not understand Now I want to crate a 3rd container for which I only need 10GB of space but all containers seems to allocate 500GB/250GB space

How do I create a new container with 10GB size ?

1

Your zpool is 500GB.

By the look of it, when you create a container it just creates a ZFS filesystem (dataset) for it. ZFS filesystems all share the space of the pool, so they will all show the same total size and available space.

If you want to specifically restrict a container to only 10GB you can set a quota on the relevant dataset, although I see little benefit in doing this.

  • If I create 4 containers on a 2TB HDD then doesn't that limit to only 4 containers ? – Fara Apr 12 '18 at 13:03
  • 1
    To be honest, when combined with ZFS, I don't see what the 500GB setting on your container is doing - it's basically just creating a folder for each one. I'd expect you to be able to create as many containers as you want and each will just fill the amount of disk space they are actually using. – USD Matt Apr 13 '18 at 14:27

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.