Solved Replacing zpool disks with larger disks

A few years ago I had to replace 3 disks in a raidz with larger disks. At the time I had to use some trickery that involved a sparse file that pretended to be the same size as one of my disks - I can't quite remember the process now and I can no longer find the article/blog post I read at the time.
Anyway, I'm needing to do this again and I've noticed there is now a 'autoexpand' attribute that can be set on a pool. Am I correct in thinking that if I set this to on, I can simply replace a disk at a time and let them resilver despite the fact that the disks are larger in size?


OK so I kind of answered part of my own question. The following should work.

Code:
# zpool create pool c0t0d0
# zpool list
NAME   SIZE   ALLOC  FREE    CAP   HEALTH  ALTROOT
pool   8.44G  76.5K  8.44G     0%  ONLINE  -
# zpool replace pool c0t0d0 c1t13d0
# zpool list
NAME   SIZE   ALLOC  FREE    CAP   HEALTH  ALTROOT
pool   8.44G  91.5K  8.44G     0%  ONLINE  -
# zpool set autoexpand=on pool
# zpool list
NAME   SIZE   ALLOC  FREE    CAP   HEALTH  ALTROOT
pool   16.8G   91.5K  16.8G    0%  ONLINE  -

However I don't have a free slot to put the new disk in and run 'zpool replace'. So will I be able to replace a disk if it is removed? I will test this in a virtual environment anyway but curious to hear if others have any experience.
 
So I created a pool mirror with 2x200M sparse files and replaced then one by one with 400M files simulating if the files/disks no longer exist. So far it seems to have worked but I'm unsure of this result after setting autoexpand on.

Code:
NAME   SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP  HEALTH  ALTROOT                                                                                      
tank   192M   122K   192M        -      192M     2%     0%  1.00x  ONLINE  -
The size of 192M hasn't change but there is also 192M in the EXPANDSZ column. Can anyone explain this?
 
A: Instead of setting auto expand, you can have the same result easier: "zpool online -e" expands the pool.

B: Regarding the expandsz field, read the man page for zpool:
Code:
    expandsize  Amount of uninitialized space within the pool or device that
                 can be used to increase the total capacity of the pool.
                 Uninitialized space consists of any space on an EFI labeled
                 vdev which has not been brought online (i.e. zpool online
                 -e).  This space occurs when a LUN is dynamically expanded.
 
Thanks. I just tried to use "zpool online -e" on just one of the disks and now it's showing the correct capacity.
 
Back
Top