One of the obvious things to do with a ZFS storage pool is to increase the size of the disks in it – after all disks get bigger and cheaper over time. Not that it is a very difficult thing to do, but it is always worth doing a quick search to find out what others have done before setting forth. And if nobody blogs their own experience, there’s nothing for anybody to find!
So I started off with four 2Tbyte drives configured as two vdevs each of which was a mirror. And I had two 3Tbyte disks to swap in. So I was going to be swapping one of the vdevs (consisting of two 2Tbyte drives) with the 3Tbyte drives.
In the details below, I have a storage pool called zroot and the two disks being replaced are gpt/disk3 and gpt/disk2. As you will notice, I am growing the storage pool I boot off; however the disks I am using do not contain a boot partition with the boot code.
The first job was to swap out one of the 2Tbyte drives. This was done by :-
- Take disk to be swapped out offline: zpool offline zroot gpt/disk3
- Shut down the server and take the selected drive out. Swap over the disk caddy onto a new 3Tbyte drive, and swap that back in.
- Power on the server.
- Create an EFI partition table: gpart create -s gpt ada3
- Optionally create a swap partition: gpart add -t freebsd-swap -s 4G -l swap3 ada3
- Create a ZFS partion: gpart add -t freebsd-zfs -l disk3 ada3
- Replace the device: zpool replace zroot gpt/disk3
Now is the time to wait for the resilvering process to complete. Once that has finished, the steps above can be repeated for the other drive in the vdev. Once the resilvering for that replacement has finished, you may want to check the size of the pool.
If the size has not increased, you may need to do: zpool online -e zroot gpt/disk2 gpt/disk3.