Hey, I defragmented my first Linux system today!
Posted: 17 Feb 2015, 13:14
Linux does not need defragmentation - at least it has not so far. With the btrfs filesystem we do get the option to defragment though.
I am not sure if this is because data get more fragmented with btrfs or if the small fragmentations that do occur can be eliminated.
So I decided to defrag OpenSuse that comes with Btrfs.
I chose the entire enchilada with / at the end. It checked out the lot and came up with this message at the bottom
Yeah ... right eh is that good or bad?
I decided to only defrag my home like this
and that came up with a clean
so no errors there and it was blistering fast.
The btrfs command allows to control important portions of your system.
I wish I could find a log somewhere regarding those 80 defrag failures though
Checking /usr reveals that most of the errors are there:
There were 75 errors.
Checking /usr/bin came up with 18 failures but this cannot be the way to do it - there must be a log somewhere that provides an overview of the defragment failures.
My proceedings above will only defragment files; the excellent Arch wiki told me that I could do this to directory metadata with:
It works and comes up with no errors.
In any case I feel good because I have defragmented my first Linux system
(Edit: It does seem to be the case Btrfs can fragment more than Ext4 so hence the defrag possibilities)
I am not sure if this is because data get more fragmented with btrfs or if the small fragmentations that do occur can be eliminated.
So I decided to defrag OpenSuse that comes with Btrfs.
Code: Select all
sudo btrfs filesystem defragment -v -r /I chose the entire enchilada with / at the end. It checked out the lot and came up with this message at the bottom
Code: Select all
Btrfs v3.16.2+20141003
total 80 failuresYeah ... right eh is that good or bad?
I decided to only defrag my home like this
Code: Select all
sudo btrfs filesystem defragment -v -r /home/vikingand that came up with a clean
Code: Select all
Btrfs v3.16.2+20141003The btrfs command allows to control important portions of your system.
I wish I could find a log somewhere regarding those 80 defrag failures though
Checking /usr reveals that most of the errors are there:
Code: Select all
sudo btrfs filesystem defragment -v -r /usrThere were 75 errors.
Checking /usr/bin came up with 18 failures but this cannot be the way to do it - there must be a log somewhere that provides an overview of the defragment failures.
My proceedings above will only defragment files; the excellent Arch wiki told me that I could do this to directory metadata with:
Code: Select all
sudo find / -xdev -type d -print -exec btrfs filesystem defragment '{}' \;It works and comes up with no errors.
In any case I feel good because I have defragmented my first Linux system
(Edit: It does seem to be the case Btrfs can fragment more than Ext4 so hence the defrag possibilities)