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: 503
Joined: Wed Oct 17, 2012 7:28 pm
Location: England

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: 186
Joined: Mon Apr 23, 2012 11:44 pm

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: 647
Joined: Thu Sep 11, 2014 3:04 pm

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.

User avatar
raboof
Established Member
Posts: 1727
Joined: Tue Apr 08, 2008 11:58 am
Location: Deventer, NL
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: 503
Joined: Wed Oct 17, 2012 7:28 pm
Location: England

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: 183
Joined: Mon Sep 29, 2014 8:29 pm
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:
Check out my latest music album The girl with the stars in her eyes
https://totalchaos-music.bandcamp.com/a ... n-her-eyes

User avatar
English Guy
Established Member
Posts: 503
Joined: Wed Oct 17, 2012 7:28 pm
Location: England

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