-
Defrag for linux?? Oh Yeah!
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)
Code:
#!/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");
For testing I used it on my home dir
Code:
root@rommiebox:~# ./fragm.pl /home/seyya
12.2209165687427% non contiguous files, 27.9980415197806 average fragments.
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?
Kolivas make a defrag script that is the anwer
Before defrag script: 12.2209165687427% non contiguous files, 27.9980415197806 average fragments
After defrag script: 2.31055414137458% non contiguous files, 1.18778147640493 average fragments
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!
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
Similar Threads
-
By blokk.m in forum Hdd Install / Debian / Apt
Replies: 9
Last Post: 10-01-2009, 03:17 AM
-
By Jonah in forum Hdd Install / Debian / Apt
Replies: 2
Last Post: 05-27-2009, 05:55 PM
-
By Jakykong in forum The Lounge
Replies: 2
Last Post: 12-14-2005, 08:36 AM
-
By bob58 in forum General Support
Replies: 0
Last Post: 04-02-2004, 04:46 AM
-
By thewretchedbeaver in forum Customising & Remastering
Replies: 7
Last Post: 02-05-2003, 01:36 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules

Dell Precision T5820 Workstation 3.70GHz W-2135 No RAM/ GPU/ HDD/ OS
$179.98

Dell Precision Tower 7810 Xeon E5-2630 v3 @ 2.40GHz , 32GB Ram, NO HDD, NO OS
$239.99

Dell Precision T7820 2x Xeon Silver 4114 2.20GHz 950W No RAM GPU HDD 4x SATA
$350.48

Lenovo ThinkServer TS460 Part Number: 70TS-S01U00
$279.00

INTEL XEON E5-2680V4 SR2N7 2.40GHZ CPU
$11.00

Intel Xeon E5-2699 V4 2.20GHz 55M 22-CORES LGA2011-3 Server Processor 145W SR2JS
$84.49

DELL Precision 5820 Workstation Xeon W-2123 3.6ghz/NO RAM/NO SSD/P400 Vid
$139.99

Intel Xeon W-2255 SRGV8 3.7GHz 10-Core LGA2066 Server CPU Processor
$249.99

Dell EMC PowerEdge R440 Xeon silver 4215 2.5GHz 16 GB ram 2x 550W PSU No HDD
$275.00

Dell PowerEdge FX2s + 8x FC430 Blades 16x E5-2630v4 160 Cores Rails No PSU/RAM
$699.00