How to increase the size of a ZFS Pool / Add drive to ZFS Pool

Today we’ll look at how to increase the size of a ZFS pool. We’ll do this by adding a new drive to the ZFS pool. ZFS makes this incredibly easy and you can do all this without destroying your data on the pool.

Rule of thumb: Always backup your data before attempting any kind modification to a filesystem/partition. No matter how much I or anyone else on the internet assures you otherwise, it’s always a good idea to be safe.

Start off by querying your system to list the drives attached. Issue the following at the terminal

The system should return a list of all the drives attached to your system, similar to below:

You can make out this machine has three 10TB Toshiba drives and one 120GB Zotac SSD.

Next, list the drive composition of your ZFS pool or zpool, issue the following at the terminal:

The system will return something like the following:

From the output above we can tell that we have one zpool called mainpool and two out of three drives are part of it (sda and sdb). That leaves one 10TB drive available for the expansion (sdc). You can make this out from the information we pulled with lshw.

Now for the fun part, issue the following to add your unused drive to the pool. Let’s do a dry run first, add -n to the command

This looks fine, remove -n from the command and issue it again.

Look at the size of your pool to verify if it went through, issue this:

zpool partition size

That’s it, you’re done.