This is a classic question, which most of us say ext* filesystems or
"Linux/Unix" filesystems never fragment, but it's actually far from
true. Some of these systems also defragment themselves at start up which
keeps you from having to run fsck manually to defrag your system.

I use reiserfs which is supposedly "better" at combating fragmentation,
but it fragments like all other systems do over time.

If you don't think these systems fragment ask Theodore Tso(the great
Tso) and he'll suggest you try filefrag, which he wrote. filefrag will
show you fragmentation of a single file of several files:

ls -lh .bash_history
-rw------- 1 bryan bryan 14K 2010-02-05 05:38 .bash_history

sudo filefrag -v .bash_history
Checking .bash_history
Filesystem type is: 52654973
Filesystem cylinder groups is approximately 176
Blocksize of file .bash_history is 4096
File size of .bash_history is 14317 (4 blocks)
First block: 34841
Last block: 35784
Discontinuity: Block 1 is at 35777 (was 34841)
Discontinuity: Block 2 is at 35783 (was 35777)
bash_history: 3 extents found


Read this forum post and run the script against your mounted filesystems

http://forums.gentoo.org/viewtopic-p-3081971.html

sudo fragchk /extra
0.372067770627405% non contiguous files, 1.04685179566613 average fragments.

My /extra partition is reiserfs at 6 GB and probably 4 days old. I use
or my http cache and apt-cache so it's fairly new.

Run the script on your root and you'll definitely be surprised. This is
from an 20GB ext3 /(which I don't use) partition on a 6 month old system.

 sudo ./fragchk /
34.9861153639042% non contiguous files, 1.36551964438438 average fragments.

How about people run the script and paste their findings in this thread!

Bryan

JTF wrote:
> I see this question frequently.
> 
> For some non-technical explanation, go here
> http://geekblog.oneandoneis2.org/index.php/2006/08/17/why_doesn_t_linux_need_defragmenting
> 
> On Feb 5, 12:55 pm, "Cavan D. Mejias" <[email protected]> wrote:
>> On 5 February 2010 13:40, harryos <[email protected]> wrote:> hi guys
>>> Previously im my windows machine I used to defragment the hard disk
>>> once in a while. Then I installed ubuntu and am wondering how to do
>>> the defragmentation in linux..I have been downloading some movies and
>>> copying them to DVDs  because of which I am afraid there may be junk
>>> files in the system.Can someone tell me how to do the cleanup and
>>> defragmentation  ?
>>> harry
>>           Hey,
>> For cleaning the browser cache, deleting unused localizations, etc,
>> try bleachbit. Its in Debian.  Apparently 'nix file systems don't need
>> defragmentation (Better things to do?).
>>
>>          Cheers.
>> --
>> I enjoy the massacre of ads. This sentence will slaughter ads without
>> a messy bloodbath.
> 

-- 
A healthy diet includes Linux, Linux and more Linux.

-- 
You received this message because you are subscribed to the Linux Users Group.
To post a message, send email to [email protected]
To unsubscribe, send email to [email protected]
For more options, visit our group at 
http://groups.google.com/group/linuxusersgroup

Reply via email to