Adding space to a LXC ZFS Pool

Adding space to a LXC ZFS Pool

If you’re using LXC with ZFS, and you happen to be using file virtual devices as your storage, you may come upon a time when you need to increase your Pool space.  For performance, I recommend you don’t let your pool go over 75% utilization.

So to add storage, it couldn’t be easier.

sudo dd if=/dev/zero of=/path/to/storage/diskname.img bs=1M count=10240
sudo zpool add -f YourPoolName /path/to/storage/diskname.img
sudo zpool status YourPoolName

First you create a new zfs file target by initializing a file using dd.  Make sure to specify your desired path and file name, in increments of 1024(1GB) for count.

Once that file is created, add it to your pool and check the status.  That’s it, you’re done!