3 ms·
How does ext* move files around to reduce fragmentation if the disk is full? I'm glad you asked. Take a look at your filesystem properties: # tune2fs -l /de
by naner 14y ago
How does ext* move files around to reduce fragmentation if the disk is full? I'm glad you asked.
Take a look at your filesystem properties:
# tune2fs -l /dev/blah
In there you'll see a property called "Reserved Block Count". That is space reserved for kernel use to avoid fragmentation, continue logging, and for any other tasks the kernel/root user may need to do on a full filesystem. Users cannot write to this and your disk utilities will report your disk being full even if this reserved space is still available.
I believe it is typically 5% of the partition size. If your partition is hundreds of gigabytes then the reserved portion may be tens of gigabytes (multiply the reserved blocks by the block size to get total byte size).
You can change the percentage of this portion with the tune2fs -m flag. I have filled up a 500 GB backup drive with 0% reserved blocks (%5 reserved would have meant that 25GB was unusable) with no issues. Obviously, you probably don't want it set to 0% if you are constantly changing the contents of that partition.