Like some nights when I can read info I stuck on these info on another linux-forum. Comparing the Linux Fragmentation Vs Windows fragmentation you'll note that it's almost nothing
but the fragmentation exists, lower but is there!
This perl script will show you the fragmentation in the directory you choose (you must use the script as root)
For testing I used it on my home dirCode:#!/usr/bin/perl -w #this script search for frag on a fs use strict; #number of files my $files = 0; #number of fragment my $fragments = 0; #number of fragmented files my $fragfiles = 0; #search fs for all file open (FILES, "find " . $ARGV[0] . " -xdev -type f -print0 |"); $/ = "\0"; while (defined (my $file = <FILES>)) { open (FRAG, "-|", "filefrag", $file); my $res = <FRAG>; if ($res =~ m/.*:\s+(\d+) extents? found/) { my $fragment = $1; $fragments += $fragment; if ($fragment > 1) { $fragfiles++; } $files++; } else { print ("$res : not understand for $file.\n"); } close (FRAG); } close (FILES); print ( $fragfiles / $files * 100 . "% non contiguous files, " . $fragments / $files . " average fragments.\n");So imagine my surpriseCode:root@rommiebox:~# ./fragm.pl /home/seyya 12.2209165687427% non contiguous files, 27.9980415197806 average fragments.and WTF!!
is happening here!! when I see the results. OK I didn't precisely take big care of my file system (reseirfs default) with bittorrents files, managing different images from posters desing to make-ups on photos with my digital camera, huge mp3 collection and fan of radios streammers...then what can i do to defrag my home dir?
Kolivas make a defrag script that is the anwer![]()
Please read the README carefully. Note if you use lilo as your loader and you defrag the partition containing your kernel you will need to rerun lilo before rebooting!Before defrag script: 12.2209165687427% non contiguous files, 27.9980415197806 average fragments
After defrag script: 2.31055414137458% non contiguous files, 1.18778147640493 average fragments
Honestly I don't notice any difference and if not for the script I wouldn't have know my fragment situation, I take this tip like 'It changes nothing except you know that theorically it works better now"
More information HERE
The script it's not mine, I put the information here for knoppix user who has a hd-install

Dell PowerEdge FX2s + 8x FC430 Blades 16x E5-2630v4 160 Cores Rails No PSU/RAM
$699.00
Dell PowerEdge FC430 Blade Server 2x Xeon E5-2630v4 20 Cores FX2 FX2s No RAM/HDD
$119.99
Dell PowerEdge M630 Blade Server 2x Xeon E5-2680 v4, 2F3MP , 4GDP5 ,R10KJ ,JVFVR
$140.00
Dell PowerEdge M620 Blade Server 2x Xeon E5-2680v2 2.8ghz 20-Cores | 128GB
$149.99
Dell Poweredge C6400 24x 2.5’’ 2x 2400W 4x C6420 Nodes H330 | 2x SFP | 8x Trays
$799.99
Cisco B200 M3 2x E5-2670V2 10 Core 8x 16GB-128GB Ram Blade Server VIC1240 14900R
$399.00
NETAPP HCI NAF-1701 SuperMicro Server 4X BLADE H410C 8X GOLD 5120 4 NODE SERVER
$1499.97
HP ProLiant BL460c Gen8 Blade Chassis w/2x Xeon E5-2630L 2.0GHz, 32GB RAM, No H
$144.99
Dell PowerEdge M640 Blade Barebone Server Dell P/N: HHB006 Tested Working
$149.99
Dell PowerEdge M620 Blade Server 2x Xeon E5-2680v2 256GB DDR3 RAM NO HDD
$349.99