Good Article: How to defrag a Linux system.

Optimize your system for ultimate performance.

Moderators: MattKingUSA, khz

Post Reply
User avatar
English Guy
Established Member
Posts: 525
Joined: Wed Oct 17, 2012 7:28 pm
Location: England
Has thanked: 8 times
Been thanked: 7 times

Good Article: How to defrag a Linux system.

Post by English Guy »

Best article I have ever seen.

Explains how to work out if you need to, and if so how to do it using e4defrag which is already installed on many Linux systems.

https://www.howtoforge.com/tutorial/lin ... em-defrag/
User avatar
bhilmers
Established Member
Posts: 229
Joined: Mon Apr 23, 2012 11:44 pm
Has thanked: 5 times
Been thanked: 17 times

Re: Good Article: How to defrag a Linux system.

Post by bhilmers »

Wow, thanks for this. I do notice performance issues over time so I usually just do a full reinstall about every two years. This might save me some trouble.
asbak
Established Member
Posts: 897
Joined: Thu Sep 11, 2014 3:04 pm
Has thanked: 71 times
Been thanked: 64 times

Re: Good Article: How to defrag a Linux system.

Post by asbak »

As the article notes at the end, you don't want to be doing this if you have a SSD. It'll only reduce its lifespan.
Some Focal / 20.04 audio packages and resources https://midistudio.groups.io/g/linuxaudio
User avatar
raboof
Established Member
Posts: 1855
Joined: Tue Apr 08, 2008 11:58 am
Location: Deventer, NL
Has thanked: 50 times
Been thanked: 74 times
Contact:

Re: Good Article: How to defrag a Linux system.

Post by raboof »

Also, don't forget to use "sudo e4defrag -c /location or /dev/device" to check whether a defrag is at all useful - I wonder if that occurs a lot.
User avatar
English Guy
Established Member
Posts: 525
Joined: Wed Oct 17, 2012 7:28 pm
Location: England
Has thanked: 8 times
Been thanked: 7 times

Re: Good Article: How to defrag a Linux system.

Post by English Guy »

I actually did this on my office machine, which only has a 70GB hard drive which is constantly near full and has had the same install since 2013. A lot of files were fine but some of the larger files, music or ISO, were fragmented. In the end I just ran it on the entire system as being easier than checking individual files.

It has made it noticeably snappier when you open a file manager and I would consider doing it again in similar circumstances.
bazsound
Established Member
Posts: 480
Joined: Sat Aug 03, 2013 11:46 am

Re: Good Article: How to defrag a Linux system.

Post by bazsound »

As far as I understand it Linux file systems are designed not to fragment. Not like fat systems do.


There may be some fragmentation but its minimal.

Defraging and saying yeah its better isn't valid. Many things can be done and u tgjnk its better but its not.

Placebo.

I've ran my Linux system for more than 2 years with many upgrades added packages removed stuff and never noticed any slowdown. Even on a 40gb drive I filled till it was full.
User avatar
thetotalchaos
Established Member
Posts: 211
Joined: Mon Sep 29, 2014 8:29 pm
Has thanked: 53 times
Been thanked: 9 times
Contact:

Re: Good Article: How to defrag a Linux system.

Post by thetotalchaos »

e4defrag can be useful for highly loaded Linux servers that use ext4 file system. I don't think that should be a concern for the desktop users, even those on Debian or Ubuntu LTS that doesn't reinstall for years. Note however that ext3 doesn't need defragmentation tools, because while ext4 allows some minimal fragmentation ext3 doesn't. So i prefer to keep my data hard drive on ext3 partition, minding the fact that ext3 has also better and more mature recovery tools. But i am not afraid to use ext4 for my OS drive/partition, because its more likely to reinstall long before i ever need to defrag the system. Plus ext4 has its advantages :wink:
You can listen to my music at: https://totalchaos-music.bandcamp.com/

Take a journey to wonderland with The Butterfly Effect 2016
https://totalchaos-music.bandcamp.com/a ... fly-effect
User avatar
English Guy
Established Member
Posts: 525
Joined: Wed Oct 17, 2012 7:28 pm
Location: England
Has thanked: 8 times
Been thanked: 7 times

Re: Good Article: How to defrag a Linux system.

Post by English Guy »

bazsound wrote:As far as I understand it Linux file systems are designed not to fragment. Not like fat systems do.


There may be some fragmentation but its minimal.

Defraging and saying yeah its better isn't valid. Many things can be done and u tgjnk its better but its not.

Placebo.

I've ran my Linux system for more than 2 years with many upgrades added packages removed stuff and never noticed any slowdown. Even on a 40gb drive I filled till it was full.
Read the article and the previous comments before commenting please. The utility under discussion has the ability to measure fragmentation, imagination is not required.
Post Reply