Expanding storage the ZFS way


I had a mirrored ZFS pool fill up on me this week, which required me to add additional storage to ensure that my application kept functioning correctly. Since expanding storage is a trivial process with ZFS, I decided to increase the available pool storage by replacing the 36GB disks in the pool with 72GB disks. Here is the original configuration:

$ df -h netbackup

Filesystem size used avail capacity Mounted on netbackup 33G 32G 1G 96% /opt/openv

$ zpool status -v netbackup

pool: netbackup state: ONLINE scrub: none requested config:

NAME STATE READ WRITE CKSUM netbackup ONLINE 0 0 0 mirror ONLINE 0 0 0 c1t2d0 ONLINE 0 0 0 c1t3d0 ONLINE 0 0 0

errors: No known data errors

To expand the available storage, I replaced the disk c1t2d0 with a 72GB disk, and then used the zpool “replace” option to replace the old disk with the new one:

$ zpool replace netbackup c1t2d0

Once the pool finished resilvering (you can run `zpool status -v’ to monitor the progress), I replaced the disk c1t3d0 with a 72GB disk, and used the zpool “replace” option to replace the old disk with the new one:

$ zpool replace netbackup c1t3d0

Once the pool finished resilvering, I had an extra 36GB of disk space available:

$ df -h netbackup

Filesystem size used avail capacity Mounted on netbackup 67G 32G 35G 47% /opt/openv

This is pretty powerful, and it’s nice not to have to run another utility to extend volumes and file systems once new storage is available. There is also the added benefit that ZFS resilvers at the object level, and not at the block level. Giddie up!

This article was posted by Matty on 2007-08-18 11:33:00 -0400 -0400