# [ZFS] pool/dataset size problem after HDD upgrade (zpool replace)



## FormA (Mar 30, 2013)

Hi guys,

I have a question regarding pool expan*s*ion but I am not sure if it is even a problem or just a mi*s*understanding on my side.

Two days ago I upgraded my running raidz pool (tank-data0 / 4x 1TB HDDs). I had and still have two datasets in that pool - "david" and "storage0". Pool size was ~3,5TB.

One by one I exchanged all HHDs via `zpool replace` with 2TB HDDs and waited for resilvering to complete. After that I manually expanded the pool via `zpool online -e [...]` (because autoexpand and pool export/import wouldn't work). New size now is 7,25TB.

So far so good.

When I check the pool size via `zpool list` the new size is correct. But when I am using the `zfs list` command, pool and datasets still have the old size. See for yourself:


```
root@z:/usr/home/xyz # zpool list
NAME         SIZE  ALLOC   FREE    CAP  DEDUP  HEALTH  ALTROOT
[...]
tank-data0  [B]7.25T[/B]  2.49T  4.76T    34%  1.00x  ONLINE  -

root@z:/usr/home/xyz # zfs list
NAME                          USED  AVAIL  REFER  MOUNTPOINT
[...]
tank-data0                   [B]1.86T  3.48T[/B]  52.4K  /mnt/tank-data0
tank-data0/dataset-david     [B]65.4G  3.48T[/B]  65.4G  /mnt/tank-data0/dataset-david
tank-data0/dataset-storage0  [B]1.80T  3.48T[/B] 1.80T  /mnt/tank-data0/dataset-storage0
```

Even the numbers don't add up. `zpool list` tells me that ~2.5 TB are in use (ALLOC). But `zfs list` says that there are 1.86TB USED. FREE and AVAIL numbers do not match either.

Still, I am not sure if that is even a problem. But it looks to me like the pool expansion did not *a*ffect the dataset size, or am I getting it wrong?

Thx 4 Thanks for your help.

Regards 

David


----------



## Savagedlight (Mar 31, 2013)

`# zpool list` shows raw size, while `# zfs list` accounts for parity, and displays usable space.


----------



## FormA (Apr 1, 2013)

Hi,

If I understand you correctly, this would mean that in a RAIDZ with 4x 2TB HDDs I have total usable space of 1.86T + 3.48T = 5,34TB.

RAIDZ is said to be the equivalent of a RAID5 where 1/N (N = number of used discs) is used for parity/other stuff. From that point of view RAIDZ seems to be way more inefficient than a normal RAID5 (RAID5 = ~6TB usuable / RAIDZ = 5,34TB usable)

Am I getting it right?

Thank you.

Regards,

David


----------



## usdmatt (Apr 1, 2013)

A 2TB disk is not 2TB* in size, it's 2,000,000,000,000 bytes, which works out to 1,862GB. This is the same regardless of the make of a disk and has always been the case.

This gives a maximum possible size of 5,587GB for 3 disks without taking into account any space reserved by the controller. I'm not sure how much space you'd get using hardware RAID5 but the difference between RAID5 and RAIDZ will be nowhere near as much as you suggest.

*(well, technically they are 2TB, just not 2TiB, but that'll just confuse things)


----------



## Savagedlight (Apr 1, 2013)

Six 2TB drives would be roughly 1.82TiB * 6 = 7.28TiB of raw storage space, or roughly 1.82TiB * 3 =5.46TiB usable space.

Your zpool states it has 7.25 TiB raw storage space, which means it should have roughly 5.44TiB actual storage capacity.
tank-data0 has used 1.86TiB, and has 3.28TiB available to it. That's a total of 5.14TiB.

Considering these numbers are rounded, are they not as expected?

edit: Also keep in mind that metadata takes up space.


----------



## FormA (Apr 6, 2013)

Thank you for your support. I get it now 

Regards

David


----------

