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 surprise 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?Code:root@rommiebox:~# ./fragm.pl /home/seyya 12.2209165687427% non contiguous files, 27.9980415197806 average fragments.
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
Knoppix 9.1 Live Linux GNU Bootable USB Flash Drive USA
$19.99
$8.50
Knoppix Live GNU Linux System 9.1 on Bootable CD / DVD / USB Flash Drive
$9.99
New Knoppix 9.2 Pro Bootable Live OS x86 64Bit DVD Linux
$9.97
Linux Knoppix 4.0.2 Installation Disc
$39.99
$12.00
Knoppix Linux Bootable OS v8.6 "Original Live Operating System" 32G USB Stick
$20.30
KNOPPIX 9.1 LINUX INSTALL & LIVE DVD
$9.99
Acer Aspire One 9 inch Netbook ZG5 512MB RAM 8GB SSD HD Knoppix Linux WiFi VGA
$79.99
Knoppix Linux Bootable OS v8.6 "Original Live Operating System" 16G USB Stick
$19.95