I couldn't find this described anywhere in a single post and have pieced it together from documentation (mostly the FreeBSD Handbook and zpool man page).
I have an existing pool (zdata) that is a mirror made up of two physical disks. I would like to upgrade this pool by replacing both drives with larger drives. I would like to do so without taking the pool offline at any time during the process. I think I can do so as follows:
My existing mirror is made up of da0 and da1 (raw devices, no partitioning), of 2TB each.
I wish to replace these with two new devices of 5TB each. (da2 and da3)
1) Add a new disk to the existing pool, creating a 3-way mirror. (1)
This triggers a resilver(3). So we wait several hours and come back when it is done.
2) Split the pool by moving an old disk to a new pool as backup and export it. (2)
You can now safely remove the da0 disk (assuming you have hot-swap drives).
3) Add the other new disk to once again have a 3-way mirror.
And again wait for the resilver to complete before removing the last remaining old disk from the pool.
It is now safe to remove the other old drive.
4) Expand the new pool to take up the new expanded available space.
Did I miss anything?
(sept 1: updated to reflect the actual process I used following SirDice's advice.)
Footnotes:
(1) I don't have enough ports to have all 4 disks attached at the same time. If I did, I would have either made a 7TB pool of two mirrors, or put 4 disks in one mirror, then removed the old disk.
(2) You could split the existing pool first, export the new pool and remove that disk to free a port for the first new drive if you don't have enough room to add a new drive before removing the old ones.
(3) In my case zpool estimated 2 hours and 11 minutes to resilver but it actually took about 4 hours and 40 minutes. However, the system was running (and in-use) at the time.
I have an existing pool (zdata) that is a mirror made up of two physical disks. I would like to upgrade this pool by replacing both drives with larger drives. I would like to do so without taking the pool offline at any time during the process. I think I can do so as follows:
My existing mirror is made up of da0 and da1 (raw devices, no partitioning), of 2TB each.
I wish to replace these with two new devices of 5TB each. (da2 and da3)
1) Add a new disk to the existing pool, creating a 3-way mirror. (1)
Code:
zpool attach zdata da0 da2
This triggers a resilver(3). So we wait several hours and come back when it is done.
2) Split the pool by moving an old disk to a new pool as backup and export it. (2)
Code:
zpool split zdata olddata da0
zpool export olddata
You can now safely remove the da0 disk (assuming you have hot-swap drives).
3) Add the other new disk to once again have a 3-way mirror.
Code:
zpool attach zdata da1 da3
And again wait for the resilver to complete before removing the last remaining old disk from the pool.
Code:
zpool split zdata olddata2 da1
zpool export olddata2
It is now safe to remove the other old drive.
4) Expand the new pool to take up the new expanded available space.
Code:
zpool online -e zdata da2 da3
Did I miss anything?
(sept 1: updated to reflect the actual process I used following SirDice's advice.)
Footnotes:
(1) I don't have enough ports to have all 4 disks attached at the same time. If I did, I would have either made a 7TB pool of two mirrors, or put 4 disks in one mirror, then removed the old disk.
(2) You could split the existing pool first, export the new pool and remove that disk to free a port for the first new drive if you don't have enough room to add a new drive before removing the old ones.
(3) In my case zpool estimated 2 hours and 11 minutes to resilver but it actually took about 4 hours and 40 minutes. However, the system was running (and in-use) at the time.