Skip to content

Instantly share code, notes, and snippets.

@pfaffman
Forked from mifix/resize.sh
Last active August 12, 2018 17:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pfaffman/af2cc1588b47560cac6d8973e29755f1 to your computer and use it in GitHub Desktop.
Save pfaffman/af2cc1588b47560cac6d8973e29755f1 to your computer and use it in GitHub Desktop.
LXD - ZFS - resize
#!/usr/bin/env bash
# make sure zfs autoexpand is enabled (only needed once)
sudo zpool set autoexpand=on lxd
sudo truncate -s 20G /var/lib/lxd/zfs.img
# Make zfs realize the fact that partition has been changed and make zpool
# use the new partition which is actually the same one
sudo zpool online -e lxd /var/lib/lxd/zfs.img /var/lib/lxd/zfs.img
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment