ZFS pool fragmentation - plan to reduce?

Status
Not open for further replies.

Arwen

MVP
Joined
May 17, 2014
Messages
3,611
This is a general ZFS pool question, not specific to FreeNAS.

One of my root pools is badly fragmented. It's a 20GB mirrored pool with 72% fragmentation right
now, (but only 52% used).

Would a ZFS send & receive from existing root pool to a newly created pool reduce fragmentation?

Basically I can break off a mirror and use it for the destination. (And yes, I have excellent backups.)

Back story. This is my minture media server running Linux with ZFS. Originally built without space
on the 2TB spinning rust for a mirror of "/boot" or "swap". Thus, my backup, repartition and restore
of the Media on it, which reduced the fragmentation to 1% or so, down from 11%. (And now I have
room to mirror "/boot" and "swap".)
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
Would a ZFS send & receive from existing root pool to a newly created pool reduce fragmentation?
Most likely. I don't think there are any mechanisms to guarantee it, but an empty pool recving stuff will naturally try to fragment free space as little as possible.
 

rs225

Guru
Joined
Jun 28, 2014
Messages
878
It will(for a while). But if you actually need to do this for performance reasons, you should actually move that to SSD.

That's what I did next.
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,611
Well, it turns out my first few hours of re-loading the Media gave false indication of fragmentation.
After 2/3s of my Media has been restored, the fragmentation is now at 33%. That's 3 times higher
than before, which was 11%.

As for performance reasons, no, I am not doing it for performance reasons. I may just ignore the
root pool for a while, since it does not seem to cause any specific issues.

PS - My miniture media server has 1 x mSATA slot, (1TB installed), and 1 x 2.5" wide, 9mm high
disk slot, (2TB HDD installed). So I am mirroring from SSD to spinning rust. Not ideal, but it's just
a media server. I'd rather have the reliability of mirroring, than worry about bad blocks.
 

rs225

Guru
Joined
Jun 28, 2014
Messages
878
I think fragmentation(the value) doesn't mean what we think, because I also see numbers that make no sense. The use pattern and actual performance is what you have to watch.
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,611
I think fragmentation(the value) doesn't mean what we think, because I also see numbers that make no sense. The use pattern and actual performance is what you have to watch.
I am starting to agree.
 
Status
Not open for further replies.
Top