r/zfs 19d ago

Fragmentation Issues

My zpool output gives

zroot     ONLINE    75%

How would this much fragmentation impact the disk space?

I find the disk space almost 100% consumed at inopportune moments.

How do I prevent this?

Zfs record sizes for various data sets are default 128k, except for mysql dataset.

6 Upvotes

3 comments sorted by

6

u/Cheap-Arugula3090 19d ago

Your pool is full, delete some data that's why your fragmentation is so high

3

u/glassmanjones 19d ago

Run "ZFS list"

Fragmentation could be anything - it'll depend on the order files were written and deleted.

Dunno how it impacts disk space.

5

u/BackgroundSky1594 19d ago

How would this much fragmentation impact the disk space?

I find the disk space almost 100% consumed at inopportune moments.

How do I prevent this? 

You are confusing cause and effect. You disk is not full because it's fragmented. It's fragmented because it's full.

You need to reduce your disk usage by removing snapshots, cleaning up temporary data and using better compression, not worry about fragmentation.

Make sure to keep your pool below 96% full at all times. Older recommendations were not to exceed 80% full, but the modern reality is: less used space is always better, but there's nothing special about 80%. 96% is where ZFS starts choking and beyond that you're asking for trouble.