Hi everyone,
I’ve encountered a massive, unexplained loss of available space immediately after expanding a RAIDZ2 vdev from 4 to 5 disks. The physical space allocated (ALLOC) is now almost exactly double the logical data size (USED), and I’ve worked through and ruled out all of the usual culprits.
The key detail is that the pool’s capacity reporting was perfectly normal and correct before the expansion began.
The Setup
- Pool: A single
raidz2-0vdev with aspecialvdev for metadata. - Initial State:
raidz2-0with 4 x 20TB HDDs. - Goal: Expand the vdev to 8 disks by adding the 4 new disks one at a time using
zpool attach. - Data: 10.3 TB, mostly large media files.
The Problem: Before vs. After
1. Before Expansion (4-Disk RAIDZ2 - All Normal)
With 4 disks, the math was correct.
- Total Usable Capacity:
(4 disks - 2 parity) * 18.2 TiB/disk = 36.4 TiB - Used Space: 10.3 TiB
- Available Space:
36.4 TiB - 10.3 TiB = ~26.1 TiB. The output ofzfs listcorrectly reflected this available space. Everything was as expected.
2. After Adding the 5th Disk (The Problem Appears)
I initiated the expansion with sudo zpool attach mediapool raidz2-0 /path/to/5th-disk. After the resilver finished, the numbers were drastically wrong.
- Expected Usable Capacity:
(5 disks - 2 parity) * 18.2 TiB/disk = 54.6 TiB - Expected Available Space:
54.6 TiB - 10.3 TiB = ~44.3 TiB - Actual Available Space: The
zfs listcommand now shows only 33.9 TiB available—a loss of over 10 TiB.
~ $ zfs list
NAME USED AVAIL REFER MOUNTPOINT
mediapool 10.3T 33.9T 118K /mediapool
mediapool/media 10.3T 33.9T 10.0T /mediapool/media
~ $ sudo zpool list -v mediapool
[sudo] password for utk:
NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
mediapool 92.8T 20.7T 72.1T - - 0% 22% 1.00x ONLINE -
raidz2-0 90.9T 20.7T 70.3T - - 0% 22.7% - ONLINE
ata-ST20000NE000-3G5101_WVT 18.2T - - - - - - - ONLINE
ata-ST20000NE000-3G5101_WVT 18.2T - - - - - - - ONLINE
ata-ST20000NE000-3G5101_WVT 18.2T - - - - - - - ONLINE
ata-ST20000NE000-3G5101_WVT 18.2T - - - - - - - ONLINE
ata-ST20000NE000-3G5101_WV 18.2T - - - - - - - ONLINE
ata-ST20000NE000-3G5101_WVT 18.2T - - - - - - - ONLINE
special - - - - - - - - -
mirror-1 1.81T 7.66G 1.81T - - 0% 0.41% - ONLINE
ata-Samsung_SSD_870_EVO_2TB_S 1.82T - - - - - - - ONLINE
ata-Samsung_SSD_870_EVO_2TB_S 1.82T - - - - - - - ONLINE
The Investigation & What’s Been Ruled Out
The zpool list -v output, which shows the raidz2-0 vdev has 20.7 TiB allocated physically for only 10.3 TiB of logical data. This is a 2x overhead that appeared during the expansion.
Here is everything we have checked and ruled out:
ashiftMismatch: Confirmed correct.
~ $ zdb -C | grep ashift
ashift: 12
ashift: 12
- Small
recordsize: Confirmed it’s the default
~ $ zfs get recordsize mediapool/media
NAME PROPERTY VALUE SOURCE
mediapool/media recordsize 128K default
copies=2: Confirmed it is the default of1.
~ $ zfs get copies mediapool/media
NAME PROPERTY VALUE SOURCE
mediapool/media copies 1 default
- Logical vs Used Space: Confirmed there are no discrepancies from compression or copies.`
~ $ zfs get logicalused mediapool/media
NAME PROPERTY VALUE SOURCE
mediapool/media logicalused 10.3T -
specialvdev: Confirmed it’s barely used and not the cause.`
~ $ zpool list -v mediapool
NAME SIZE ALLOC FREE
...
special
mirror-1 1.81T 7.66G 1.81T
The Question
Has anyone ever seen behavior where a raidz2 expansion (zpool attach) triggers a massive, uniform 2x storage overhead? The fact that everything was normal before the expansion makes me think this could be a bug or a very obscure calculation related to the resilvering/rebalancing process itself.
Any ideas or insights would be hugely appreciated. Thank you!