Skip to content

Instantly share code, notes, and snippets.

@ThomasLeister
Created March 6, 2018 07:44
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ThomasLeister/0a348035f337c0ca0b976b904fd3aa4b to your computer and use it in GitHub Desktop.
Save ThomasLeister/0a348035f337c0ca0b976b904fd3aa4b to your computer and use it in GitHub Desktop.
Grow LXD ZFS pool file (LXD snap package)
According to: "Growing a loop backed ZFS pool" on https://lxd.readthedocs.io/en/latest/storage/
For LXD via Snap package:
- The default pool is located at /var/snap/lxd/common/lxd/disks/default.img
- and is named "default".
### To increase the pool size by 20 GiB do this:
>>> Stop all your containers! <<<
truncate -s +20G /var/snap/lxd/common/lxd/disks/default.img
zpool set autoexpand=on default
zpool online -e default /var/snap/lxd/common/lxd/disks/default.img
zpool set autoexpand=off default
... and turn your containers back on.
DONE! 🎉
@HW-Siew
Copy link

HW-Siew commented Mar 13, 2018

Hi, any idea why i cannot find my default.img under the path /var/snap/lxd/common/lxd/disks/ ? By the way, I am using lxd via snap with zfs pool 'default' created. Everything works fine, but i want to grow my the disk size using this method.

Thanks for your advise. ;)

@Mohamedemad4
Copy link

@HW-Siew,Hey a bit late to the party ik. But default here references the name of your storage pool. you can check the name of your storage pool and some info about them using lxc storage list and lxc storage info <poolName>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment