Does Replacing Disks in a RAIDZ Array Consolidate Free Space?

bollar

Patron
Joined
Oct 28, 2012
Messages
411
I'm curious if anyone can point me to a technical discussion of what ZFS does during the resilver process when a hard drive is replaced.

I am currently replacing drives in a four VDEV by eight HD array (thirty-two drives in all) with larger drives. Three VDEVs are complete and took about 12 hours per drive to replace. This fourth VDEV is taking much longer -- about a day & a half per drive. This may be expected. This VDEV has the rattiest drives (there are some 5400 RPM and Green drives in there) and this VDEV was filled with archival data when the array was very full -- probably more than 95% and may be heavily fragmented.

I'm curious if this disk replacement will do anything that may improve performance, like make files contiguous, consolidate free space or something else.

Code:
NAME           SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP  HEALTH  ALTROOT
tank           160T  67.4T  92.2T        -         -    19%    42%  1.00x  ONLINE  /mnt


Although my question is more general than specific system related, the system details are in my signature.
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
This VDEV has the rattiest drives (there are some 5400 RPM and Green drives in there) and this VDEV was filled with archival data when the array was very full -- probably more than 95% and may be heavily fragmented.
This sounds like two things. First, the old drives will have less performance and make the vdev slower. Second, if this vdev was 95% full, it is still very full and has a lot of data to be transferred onto the new drive.
Generally speaking, there is no way to really defragment the pool.
I'm curious if this disk replacement will do anything that may improve performance
The newer drives will likely have better performance to the old drives, so it can improve performance. The thing that will likely have more effect is if you copy the data to a different directory and then delete the original file. The process of moving the data in this manner (by copy followed by delete) will have the effect of spreading the data across all available vdevs instead of having the data on one vdev only.
like make files contiguous, consolidate free space or something else.
Copying the data will also, to some degree, make the file more contiguous.
 
Top