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

Vintage Intel i860 A80860XP-40 SX582 RISC CPU Ceramic RARE SSpec Retro Computing
$178.46
Title:Rare Vintage Magnetic Core Memory Board Plane – Retro Computing Collectibl
$2000.00
Vintage eMate 300 Computer System Rare Kids Laptop Newton Operating System
$349.99
Vintage Laptop Lot With IDE Laptop Drives Lot Of 5 Laptops
$300.00
Intel GRAMPA BURST 168-pin 486 CPU Interposer/Testing Adapter Board Vintage
$289.99
Vintage Intel i486 KU80486SX-25 Q864 Embedded ES CPU NOS Retro Computing
$107.06
Vintage Intel i860 A80860XR-33 SX349 RISC CPU Ceramic RARE SSpec Retro Computing
$142.76
Vintage APPLE Computer Keyboard M0110 and Mouse LOT M0100 & Desktop Bus
$129.00
Vintage 2006 17” iMac w/ Apple Keyboard - It Works
$79.99
VINTAGE UMPC Fujitsu Lifebook P1120 8.9" Touchscreen Crusoe 800MHz - Windows XP
$349.95