[SOLVED] Implication of ZFS 'copies=2' for fdisk

wbk

Active Member
Oct 27, 2019
195
24
38
Hi all,

I just started with Proxmox and the forum.

My hardware is a lot simpler than most things I read about on the forum, still it manages to puzzle me.

On initial installation I got a single SSD, on which I put ZFS in RAID0, ie., a single disk pool. I set copies=2, and had a root partition of 15GB in mind. 15GB + copies = 2 I mused, needs a partition of 30GB so that each item can be written twice while retaining an effective 15GB.

What I actually see, is:
  • Bare sectors, fdisk: 61863937 * 512 ~ 29,5 GB
  • At 'datacenter' level: 2.2GB of 54.0GB used
  • At node level: 2.2GB of 28.0GB used
  • Two storage objects:
    • local: 2.2GB of 28.0GB used
    • local-ZFS: 0 of 25.8GB used
I can see the relation between 28 and 54, and between 28 and 25.8, but not between 54GB on the datacenter and 29.5GB actual usage on disk. It crossed my mind that the single node might actually be virtualised itself, so that running fdisk from there would show me the result the offered partitioning from the host, but then the total disk would have been 20-something GB, while that is the actual 930GB.

What I had expected to see is:
  • Bare sectors, fdisk: 61863937 * 512 ~ 29,5 GB
  • At 'datacenter' level: 2.2GB of 28.0GB used
  • At node level: 2.2GB of 14.0GB used
  • Two storage objects:
    • local: 2.2GB of 14.0GB used
    • local-ZFS: 0 of 11.8GB used
Could you give a pointer for me to find out how copies=2 actually impacts disk usage?
 
Could you give a pointer for me to find out how copies=2 actually impacts disk usage?

copies=2 will always exactly halve the available disk space, since every block is written twice.

Your two storage objects both refer to the same backing storage, there's no fixed resource allocation happening by default on ZFS - which is why they both show the full ~30 GB allocated to your rpool.

This is also the reason why it is shown twice in the Datacenter overview, check this bug report for more information and a workaround.
 
Hi Stefan,

Thanks a lot for the clear explanation, and sorry for not posting back any earlier.

With the information in the bug report I understand why the space is calculated more than once, and why it is difficult to make the system solve the puzzle.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!