Don’t forget to defragment /home if you’re using BTRFS

As root: (as a regular user it just won’t work) –

btrfs filesystem defragment /home -r

You probably want to run that weekly.

I eventually noticed Thunderbird and phpStorm were being really slow and laggy … at which point I realised the cron job I had (as my non-root user) wasn’t working.

(using filefrag /path/to/file you can see the change in the number of extents change after defragmenting)


Posted

in

by

Comments

2 responses to “Don’t forget to defragment /home if you’re using BTRFS”

  1. Duncan Avatar
    Duncan

    Defragmentation, for when you miss the days of looking like a genius to clueless windows 95 users.

  2. David Goodwin Avatar

    Quite 🙂

    There is some sort of auto defrag mount option but it seems it’s not enabled by default –

    https://btrfs.readthedocs.io/en/latest/Administration.html

    https://btrfs.readthedocs.io/en/latest/Defragmentation.html

Leave a Reply

Your email address will not be published. Required fields are marked *