Prevent ZFS rpool fragmentation

SlimmySlims

New Member
Mar 4, 2025
7
0
1
I have proxmox installed via a ZFS mirror on 2x Samsung 990 Pros. I also have a ZFS mirror for a media drive on 2x 18TB WD ultra stars that I have a single VM disk on that I just attach to my media server.

The media pool shows 0% fragmentation and has been running for about 6 months now. The rpool is a newer install of about a month with 6% fragmentation already. Is there a way to prevent rpool from fragmentating further?
 
I wouldn't worry much about fragmentation on SSDs. In comparison to HDDs, the access times are the same, no matter "where" the data is stored. Especially since with wear leveling, the logical and physical location of the data on the chips is always transparently remapped by the SSDs FTL (flash translation layer).
 
Although effects from fragmentation on an SSD are minimal, file contiguity can have an effect. Though probably, the small value gained from defragmentation / file contiguity , is probably outweighed by the negative wear levelling effect incurred.
 
Last edited:
You're overthinking this. ZFS "fragmentation" is reporting on the free space, not the used space.
I read about how it’s involving the free space, but saw some threads about people saying once you hit 80% range you start to have noticeable performance issues. I was mostly concerned because if it keeps moving at the rate it is now I’ll be at 80% in no time
 
I wouldn't worry much about fragmentation on SSDs. In comparison to HDDs, the access times are the same, no matter "where" the data is stored. Especially since with wear leveling, the logical and physical location of the data on the chips is always transparently remapped by the SSDs FTL (flash translation layer).
That makes sense, I was just concerned because of how some threads mentioned you have problems at 80% and the rate it’s moving now it seems like that would approach rather quickly.

Also, just curious but why do my HDDs not have any reported fragmentation?
 
some threads mentioned you have problems at 80%
I believe those threads are discussing, how full/used your pool is, not the fragmentation element.

Also, just curious but why do my HDDs not have any reported fragmentation?
I imagine that is since you only have one virtual disk in the HDD pool vs the NVMe pool that is running the complete PVE OS along with all VMs & LXCs. The OS itself will also be constantly writing small/differing writes such as logs etc.