Page 2 of 2

Re: Defrag tool for Mint?

Posted: Tue Oct 30, 2012 3:41 pm
by jamael7
I just found defrag tool for Ubuntu: https://apps.ubuntu.com/cat/applications/hdd-ranger/

Maybe its also works with Mint, anyone tested it?

Re: Defrag tool for Mint?

Posted: Fri Nov 02, 2012 12:00 pm
by bimsebasse
$8 for something you don't need.

Re: Defrag tool for Mint?

Posted: Fri Nov 02, 2012 1:49 pm
by lexon
I have been using Linux since Dec. 2003. There is no need to defrag but everyone is entitled to their own version of reality.
L

Re: Defrag tool for Mint?

Posted: Tue Nov 06, 2012 2:16 am
by igor83
eanfrid wrote:I agree with DrHu. Defragmentation tools are not needed on modern file systems (and modern hardware). Fragmentation occurs though, but its impact is very negligible.

Indeed, unless your use any version of FAT or early releases of NTFS, you don't have to defrag anything because access times, read/write speeds, buffers and caches on today's devices and computers combined with modern file systems performances completely override the need for it.

Defrag tools are now just placebos, either on Windows or Linux.
Do you think it is faster for a r/w head to read sectors of a file from one contiguous location on the disk or from 99,000 random spots spread all over the disk platter? The head is going to have to physically move a greater distance resulting in what is known as "thrashing" which is audible on some drives (Hitatchi comes to mind) and yes, this does slow down the process of reading or writing regardless of the cache size. OF course on SSD this is a nonissue, but most users today still use mechanical drives and for large capacity, there isn't a cost-effective alternative yet.

Re: Defrag tool for Mint?

Posted: Tue Nov 06, 2012 3:46 am
by eanfrid
You take an example of absurdly high level of fragmentation, close to 100%, to make your point :) In the real life, this is no point: cache and buffers win the game the very most of the time. However, there is always a performance difference between reading/writing many small files in a row and reading/writing only one big file but this is an I/O performance, file system features and access time matter, not a single-file fragmentation matter, whatever are the OS and the underlying storage technology.

Re: Defrag tool for Mint?

Posted: Tue Nov 06, 2012 5:53 am
by webslave
As for defragging NTFS from Linux I haven't been able to find much. But with ext4 there is a program you can use. Just simple run

Code: Select all

e4defrag /location
I found a good article about it as I was wondering the same thing myself.
http://www.hecticgeek.com/2012/10/defra ... ag-ubuntu/

Re: Defrag tool for Mint?

Posted: Tue Nov 06, 2012 12:08 pm
by Flemur
"Still though, ex-Windows habits aside, I am finding it hard to accept that the Linux file-system is totally immune to fragmentation."

Don't worry, linux ext filesystems really do fragment. It's pretty much impossible not to do so to some extent.

And because of this, there's the e4defrag program, which will (rather crudely) take care of some of it.

Re: Defrag tool for Mint?

Posted: Tue Nov 06, 2012 12:38 pm
by igor83
eanfrid wrote:You take an example of absurdly high level of fragmentation, close to 100%, to make your point :) In the real life, this is no point: cache and buffers win the game the very most of the time. However, there is always a performance difference between reading/writing many small files in a row and reading/writing only one big file but this is an I/O performance, file system features and access time matter, not a single-file fragmentation matter, whatever are the OS and the underlying storage technology.
I have seen files with fragmentation levels on my own desktop in the tens of thousands and it is easy to imagine a large database file with continual reads and writes getting ~ 99,000 fragments. Depends on your OS whether this is going to be a big issue, but on Windows/NTFS it remains one. Out at work I had a friend who thought the same as you, swore up and down that fragmentation didn't matter anymore in our grand new modern era of generous hard drive caches. He reversed his opinion the next day after defragging his drive at home. For Linux I wouldn't worry too much about it but on a Windows system, particularly XP or earlier, then I would suggest performing a little experiment before drawing any conclusion based on cache size.

btw here is a good article on why defragmentation is a problem in Windows XP / NTFS but not in Linux. Personally I don't plan to ever defrag in Linux. Fragmentation Resistance is one of the eternal advantages Linux has enjoyed over Windows.

Re: Defrag tool for Mint?

Posted: Tue Nov 06, 2012 12:59 pm
by eanfrid
I was talking about OS/FS cache/buffers in RAM, not about drive cache :) Anyway talking about the need of a defragmention tool under any modern OS (sorry XP is far from modern) is like talking about religion. I understand your point.

As yours, my point is based on my own professional experience in IT. Most of the time, under mainstream use (desktop - gaming), defragmentation tools are not needed at all. For servers and users manipulating/editing huge files (architects, video editors and so on), fragmentation can indeed be a problem because the best friend of fragmentation is low available disk space. In either case, most of the issues are leveled with more RAM for caching and faster/bigger disks. But once again, it is not a common use of a modern desktop computer.

Edit: BTW each time I try "e4defrag -c" on my machines, it never tells me I have to defrag anything :)

Re: Defrag tool for Mint?

Posted: Tue Nov 06, 2012 7:09 pm
by igor83
eanfrid wrote:I was talking about OS/FS cache/buffers in RAM, not about drive cache :) Anyway talking about the need of a defragmention tool under any modern OS (sorry XP is far from modern) is like talking about religion. I understand your point.

As yours, my point is based on my own professional experience in IT. Most of the time, under mainstream use (desktop - gaming), defragmentation tools are not needed at all. For servers and users manipulating/editing huge files (architects, video editors and so on), fragmentation can indeed be a problem because the best friend of fragmentation is low available disk space. In either case, most of the issues are leveled with more RAM for caching and faster/bigger disks. But once again, it is not a common use of a modern desktop computer.

Edit: BTW each time I try "e4defrag -c" on my machines, it never tells me I have to defrag anything :)
I think we're on the same page here. In regards to Windows XP I've still got two desktops running well with XP and no problems and some legacy software I don't want to discard. The main reason I moved a desktop to Linux was to get 64-bit support which allows partitioning a 2.5tb drive. Windows XP 32 bit couldn't handle it. And besides I think it's a good idea to diversify where operating systems are concerned. I'm not wild about the direction Microsoft is going and am curious about where Linux may be headed, so decided to catch a ride on this train.

btw sounds like you're a defragmentation agnostic based on running "e4defrag -c". Even I have not done that on my Linux box. I'm a defragmentation atheist where Linux is concerned.

The ext4 file system seems more robust than NTFS, although I'm curious to try btfrs (sp?) when it gains more acceptance, utilities, and stability and so on.

Re: Defrag tool for Mint?

Posted: Tue Nov 06, 2012 7:45 pm
by eanfrid
Regarding my own use, I exclusively run Linux - mostly Debian or Debian-based, plus some BSD machines however - since more than 10 years. I never had to use any defragmentation tool :) Since I dropped down the good old ext3 for ext4, I just ran e4defrag only a handful of times to check what it would do... exactly what I first guessed i.e nothing :lol:

Edit: NTFS is not as good as ext4 for maintaining a low level of fragmentation but recent Windows(tm) OS, starting from Vista, do a better job with NTFS than previous versions and then you can live with "no defrag" on a common Windows desktop too, as far as you avoid native NTFS file compression.

"Linux does not fragment files" a modern myth

Posted: Sat Jan 05, 2013 9:25 am
by andros
I have searched about this topic shortly and it was incredible to me, how this modern myth, that Linux systems don't need any defragmentation at all has spread.

Here is an good article about what is the Linux approach to prevent fragmentation:
Why doesn't Linux need defragmenting?

But, this article assumes that you just don't need any kind of defragmentation software on Linux at any given time.

I just can't believe how ignorant this message is, and how it has spread the word all over the Internet!?

On many occasions, (when you not a power user) this is maybe true, but on many other occasion this is just wrong.

It happens to me that i have to use my ext4 home partition a little bit extensively.
So i have for example an Thunderbird profile which is alone 21GB in size, and i am getting ~100MB of new mails on a daily basis. So my Thunderbird profile alone does a tremendous job of increasing and decreasing database files for all my Thunderbird folders. Which are also get sometimes compressed and therefore another time change their sizes.
And Thunderbird is only one thing that i have stored on this partition. There are some Video stuff i am working on, and so forth...

Last year i just didn't think about defragmenting for about 6 month. In the end pretty much every folder that i am used in Thunderbird became tremendously slow. So slow that when you clicked on one mail it took up to 5 to 12 seconds just to display it.

So what have i done?
I am using SHAKE do defragment Linux for some time no, so i defragmented my whole system with it.
Result is that every mail in Thunderbird now opens in 0.5 seconds instead of 12!

And this is only one example. The whole files system becomes very slow when you really use it and have many files that are copied over, back and forth or change in size regularly.
On my root partition with /etc /usr, /var, /bin, .. there is not much fragmentation going on, but on my big data partitions like /home there is allot going on!

I called shake like this "shake --old 0 --bigsize 0 --smallsize 0 -v ." to make sure it would defrag every thing.
With -v you can see if and how many fragments one file has. In my Thunderbird profile folder there were many files fragmented in to hundreds of parts.

So it is pretty much idiotic for me to say Linux does not fragment anything.

It does.

Linux is not some answer for everything. Linux is bound to the physical limitations in this universe as well as everything else is!

If there is not enough room for Linux to handle it "the Linux way", there is always the possibility that you have fragments on your HDD.

I have never seen an file system, which can avoid the problem of fragmentation completely.

Re: Defrag tool for Mint?

Posted: Sun Jan 06, 2013 6:34 am
by eanfrid
Fragmentation is inherent to any file-system activity. Whatever OS you use. But native Linux file-systems handle file fragmentation in a better way than Windows ever did. Fragmentation is generally kept to an insignificant value under Linux and does not hamper normal operations. So, if fragmentation gets unnoticed, why bother with a defrag tool ? (this is what this poll means, indeed).

As I said before, there are always exceptions, on databases servers, on very large files operations or before resizing a partition for example, where a defrag tool can sometimes be useful. But the true responsible for file fragmentation is the lack of disk space: the more your HDD partition gets filled, the more your files will get fragmented, beginning with the bigger ones. Compared to HDD, SSD are clearly the winners on this part, too.

Re: Defrag tool for Mint?

Posted: Sun Jan 06, 2013 7:46 am
by andros
Fragmentation is inherent to any file-system activity. Whatever OS you use. But native Linux file-systems handle file fragmentation in a better way than Windows ever did.
Exactly because of that i am using SHAKE. Please read what SHAKE does:
Shake is a defragmenter that runs in userspace, without the need of patching the kernel and while the system is used (for now, on GNU/Linux only).
There is nothing magic in that : it just works by rewriting fragmented files. But it has some heuristics that could make it more efficient than other tools, including defrag and, maybe, xfs_fsr.
It just does it job by coping the files again. Because of what you described above, this is enough to defragment the files in most cases, because of the file system behavior. As explained in the article i have linked to before.
.
Fragmentation is generally kept to an insignificant value under Linux and does not hamper normal operations.
So, if fragmentation gets unnoticed, why bother with a defrag tool ? (this is what this poll means, indeed).
This is not true, it gets noticed, it depends how much you use the system! On windows systems it is the same, it depends also on the use case. The only difference is, that Linux file systems act more intelligent from the beginning on.
As I said before, there are always exceptions, on databases servers, on very large files operations or before resizing a partition for example, where a defrag tool can sometimes be useful. But the true responsible for file fragmentation is the lack of disk space: the more your HDD partition gets filled, the more your files will get fragmented, beginning with the bigger ones. Compared to HDD, SSD are clearly the winners on this part, too.
So, you say it your self. When disk space gets low, it is impossible to operate on files without to fragment them.

But what amount of space is low?

Think for your self, when Linux is trying to order the files all over the free space on a partition, you get relatively fast on he edges of physics when you have enough files who change in size.

My home partition for example has 30 % free space left.

But it WAS extremely fragmented which was a big performance impact.

What do you think: When i can not use more than 50 % of my disk to avoid fragmenting, who failed her, me or Linux?

Or should i copy over the whole disk to another disk with the same size and back to to defragment it?

Or should i just use SHAKE?

Re: Defrag tool for Mint?

Posted: Sun Jan 06, 2013 3:14 pm
by eanfrid
So i have for example an Thunderbird profile which is alone 21GB in size
:shock: Thunderbird is not a parangon of optimized performance and such a huge profile size is playing with fire, for sure.

Whichever OS you run, low disk space is the best friend of fragmentation. Linux or not. Regarding performance, Linux file-systems can cope with lower available disk space than Windows does but Linux is not a magical device. Further if the available RAM you have for system disk caching on your computer gets too low, you will also notice performance drops long before anything due to file fragmentation.

Re: Defrag tool for Mint?

Posted: Sun Jan 06, 2013 3:39 pm
by andros
Thunderbird is not a parangon of optimized performance, for sure.
Yeap here we are again.

Yes you are right, and in the same oucasion my grand ma is not a circulator turbine.

Re: Defrag tool for Mint?

Posted: Thu Jan 18, 2018 8:17 pm
by drewhenry58
The defrag commands are:
sudo e4defrag -c /home/<username>
sudo e4defrag -v /home/<username>

Re: Defrag tool for Mint?

Posted: Thu Jan 18, 2018 11:17 pm
by Jim Hauser
I always keep at least 20% free space on all of my drives (4 local with 1 offsite). My system runs on a striped LVM with ext 4 using all 4 local drives. I also use another striped LVM using the same 4 local drives for a small torrent farm. All of my remaining drive space is used for backups, archives, rebuilding files and dual booting other distros.

In 4 years this system has never been defragmented.

In 4 years this system has never experienced any slowdown due to disk access.

For me, defragging is just an old Windows habit.

Perhaps one day I might have to defrag my drives... perhaps.

Until then Linux Mint Rules! :-)

Re: Defrag tool for Mint?

Posted: Fri Jan 19, 2018 4:44 am
by Moem
This topic is old as dirt, and should be allowed to rest in peace now. Closing up.