3

Among the new things in 16.04 is the remarkable ZFS file system. The wiki presents some interesting use cases (end of page) but another wiki page mentions that "A device can be added to a [ZFS virtual device], but cannot be removed from it."

So I can easily add drives and they will automagically enlarge the ZFS volume, but what happens when I run out of physical space/connectors in the machine? What can I do to remove/replace physical drives?

3
+25

You can replace a physical drive from a zpool. Take a look at this tutorial made by Oracle.

Replacing a Device in a ZFS Storage Pool

Howerver according to the zpool man page (snv_92):

 zpool remove pool device ...

     Removes the specified device from the pool. This command
     currently  only  supports  removing hot spares and cache
     devices. Devices that are part of a mirrored  configura-
     tion  can  be  removed using the "zpool detach" command.
     Non-redundant and raidz devices cannot be removed from a
     pool.

So if you accidentally add a device to a zpool you will need to back everything up and recreate the pool.

2

Answering to your last sentence and not the title question, since this seems to be the reason for it:

For zfs, the drives need to have the same size in an array for a meaningful combination. The size of the zpool is limited by the smallest disk in the array for raidzX modes.

If you want to enlarge a pool, you need to make sure that you replace your disks by larger disks one-by-one and let the pool resilver between each step. After you added the last disk, the pool automagically enlarges itself to the new maximum capacity. Sometimes, a export and reimport of the pool with zpool export tank followed by zpool import tank is needed to trigger the process.

I have done this several times now over the years, and it was always a sufficient solution. If you plan your pool from the start and max out your slots, the growth option available is similar to other filesystems, since you always need to replace disks.

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.