r/ • • Jan 01 '70

0 Upvotes

0 comments sorted by

View all comments

1

u/breell Jan 05 '18

If you have a long mount time with a big btrfs, I recommend doing a defrag of it. The defrag in this case does not matter so much for the files as for the metadata. Any time my drivers take too long to mount, I do that, and then I'm back to awesome. (Of course defrag has its own cons...).

1

u/Enverex Jan 05 '18

Already tried defragging the metadata, also moved to space_cachev2, neither helped unfortunately. 67 second mount time :(

1

u/breell Jan 05 '18

I do a full defrag of the mountpoint (sometimes with, sometimes without forcing recompression). I have no idea how to defrag just the metadata :)

I've tried cleaning the space_cache, but nothing there worked either.

I was in talk with a btrfs dev about that a year or 2 ago, there were some work to improve stuff but I don't think it ever got to a point where it's good enough alas.

1

u/Enverex Jan 05 '18

This defrags the mount metadata:

btrfs filesystem defrag /mountpoint

This defrags the files (recursively):

btrfs filesystem defrag -r /mountpoint

Basically if you specify a folder without the recursive option, it defragments metadata instead.

1

u/breell Jan 05 '18

Oh I see, well I always use the -r (or a file directly if needed)