Open Atemu opened 5 years ago
How does that have to do with defragging the drive?
Like many other "basic" filesystem features, defragmenting works a bit differently on BTRFS.
AFAIK all the btrfs filesystem defragment
command does is rewrite an entire file in-place which causes the file's blocks to be put through the BTRFS write pipeline again.
The blocks are read from the file sequentially which means that they'll also be written sequentially and since a file is fragmented when the files's blocks aren't sequential, it's no longer fragmented when it's rewritten sequentially.
When a file's blocks are rewritten, they're also recompressed and the btrfs filesystem defragment
command allows you to choose which algorithm should be used for that on Linux (e.g. -czstd
).
This is currently the only way to change the compression algorithm on an already written file on Linux BTRFS and it'd be helpful if that were possible on WinBTRFS aswell.
That makes sense after you explained it.
Since all compression algorithms of mainline Linux are supported now, being able to switch between them would be awesome.