LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Closed Thread
  Search this Thread
Old 04-13-2007, 10:16 PM   #1
tmcco
Member
 
Registered: May 2003
Location: Unknown
Distribution: Unknown
Posts: 59

Rep: Reputation: 15
A file-system defragmentation tool on Linux


A file-system defragmentation tool on Linux, please look at here:

1, http://sourceforge.net/projects/defragfs
2, http://defragfs.sourceforge.net
 
Old 04-14-2007, 05:22 AM   #2
Okie
Senior Member
 
Registered: Mar 2002
Location: Oklahoma
Posts: 1,154

Rep: Reputation: 187Reputation: 187
i been using Linux since 2000 and never had to defrag it...

from what i hear Linux does not make a mess out of its file system like windows does...
 
Old 04-14-2007, 06:03 AM   #3
nirmaltom
Member
 
Registered: Jun 2005
Location: India
Distribution: Redhat,Fedora,DSL,Ubuntu
Posts: 238

Rep: Reputation: 30
hi,
there is no need to defrag as we use extents.It simply allocates standard size for each file.So when new file is created , it is done on a new extent and not in the remaining space of other file's extent.when the file is modified or appended it is done on the same or its last extent.So no need to defrag

regards,
Nirmal Tom.
 
Old 04-14-2007, 07:51 AM   #4
tmcco
Member
 
Registered: May 2003
Location: Unknown
Distribution: Unknown
Posts: 59

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by nirmaltom
hi,
there is no need to defrag as we use extents.It simply allocates standard size for each file.So when new file is created , it is done on a new extent and not in the remaining space of other file's extent.when the file is modified or appended it is done on the same or its last extent.So no need to defrag

regards,
Nirmal Tom.
May be you are incorrect.

1, ext2/3 does not use extent on space allocation, ext4dev may add this on the future.

2, Even if you are using a extent-based file system(JFS/XFS/Reiser3,4), have you ever thought on the "Create/Delete/Create..." situation? Something like:
. . . . . . . . . . (10free blocks, each 4KB)
1 1 2 2 3 3 3 4 5 . (you've 5 files allocated "extent", left 1 block)
1 1 . . 3 3 3 . 5 . (delete 2 and 4)
1 1 6 6 3 3 3 6 5 6 (a new file "6" allocates 4 blocks, which does not continuously(3 frags)

3, You may argue that in the upper example, if you've more free space, the file system could allocate the "free-and-continuous" space, which is false. please read here: http://defragfs.sourceforge.net/theory.html
 
Old 04-14-2007, 07:58 AM   #5
makix
LQ Newbie
 
Registered: Apr 2005
Distribution: fedora
Posts: 16

Rep: Reputation: 0
Thanks for the info and link, i did not know about that situation
 
Old 04-14-2007, 08:21 AM   #6
nirmaltom
Member
 
Registered: Jun 2005
Location: India
Distribution: Redhat,Fedora,DSL,Ubuntu
Posts: 238

Rep: Reputation: 30
hi,
nice infn, ya i thought of reiser(ext4 contains it).Even lvm2 uses extents.since extents reduce the amount of fragmentation, i generally and many dont care about it.i will try it and see performance difference.i think it contain some perl scripts for that too.

thanks and regards,
Nirmal Tom.
 
Old 04-14-2007, 08:22 AM   #7
Jaqui
Member
 
Registered: Jan 2006
Location: Vancouver BC
Distribution: LFS, SLak, Gentoo, Debian
Posts: 291

Rep: Reputation: 36
tmcco,
it's a nice idea, to have a user space fs defrag tool, but I personally don't see a need for it.
1) with *x filesystems being nonfragmenting, there isn't a need to regularly defragment a filesystem.
crashes that cause a hard power off and on to reboot, or power failure are just about the only cause of filesystem fragmentation on *x systems.
2) it has always been recommended to completely rebuild your filesystem every 6 months, so that the .6% fragmentation that may occur in that time gets cleaned up when following recommended procedure.
I know, people just coming to *x from MS' offerings will not know the recommended procedure, they will see a need for and want it, but they will also be rebuilding their system at least monthly until they learn more about *x, so they don't need it either. When they stop rebilding it that often, they will also know it is BEST to actually rebuild the system every six months, problems arising from failure to do so will be their own fault.
[ problems not really likely, I have had systems running various flavours of *x for three years without a single update or issue. ]
 
Old 04-14-2007, 08:56 AM   #8
tmcco
Member
 
Registered: May 2003
Location: Unknown
Distribution: Unknown
Posts: 59

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Jaqui
tmcco,
it's a nice idea, to have a user space fs defrag tool, but I personally don't see a need for it.
1) with *x filesystems being nonfragmenting, there isn't a need to regularly defragment a filesystem.
crashes that cause a hard power off and on to reboot, or power failure are just about the only cause of filesystem fragmentation on *x systems.
2) it has always been recommended to completely rebuild your filesystem every 6 months, so that the .6% fragmentation that may occur in that time gets cleaned up when following recommended procedure.
I know, people just coming to *x from MS' offerings will not know the recommended procedure, they will see a need for and want it, but they will also be rebuilding their system at least monthly until they learn more about *x, so they don't need it either. When they stop rebilding it that often, they will also know it is BEST to actually rebuild the system every six months, problems arising from failure to do so will be their own fault.
[ problems not really likely, I have had systems running various flavours of *x for three years without a single update or issue. ]
1, You said "*x filesystems being nonfragmenting", which I think no one would believe, just look at the example I mentioned before.

2, How do you measure the ".6% fragmentation"? By "guessing"? How could you assure that every *x filesystems would only got ".6% fragmentation" in 6 months?

3, Rebuild is always the best way, I agree.
 
Old 04-15-2007, 03:03 AM   #9
tmcco
Member
 
Registered: May 2003
Location: Unknown
Distribution: Unknown
Posts: 59

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Okie
i been using Linux since 2000 and never had to defrag it...

from what i hear Linux does not make a mess out of its file system like windows does...
1, You've never defrag your fs since 2000 does not means that your fs will not fragment.

2, You heard a myth about Linux. How would you evaluate "a mess"? Would a aged ext3 with 23% fragmented files and performance degrade to 60% "a mess"?
 
Old 04-16-2007, 08:18 AM   #10
fotoguy
Senior Member
 
Registered: Mar 2003
Location: Brisbane Queensland Australia
Distribution: Custom Debian Live ISO's
Posts: 1,291

Rep: Reputation: 62
Although I do not know anything about the filesystems themselves I must admit I have had no need to defrag any of my filesystems, even after months of hard use (and abuse), some of my machines haven't had a reformat for atleast 2 or 3 years, they still seem to perform the same as they did when they were first installed.
 
Old 04-16-2007, 11:38 AM   #11
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
It's often stated that *nix file systems do not fragment the way that Windows file systems do. For some reason people take this to mean the *nix file systems don't fragment at all.. In truth they do just to a lesser extent as the file system does a much better job preventing fragmentation.

http://www2.lut.fi/~ilonen/ext3_fragmentation.html
http://www.itworld.com/Comp/3380/nls...929/index.html
 
Old 04-16-2007, 01:10 PM   #12
nirmaltom
Member
 
Registered: Jun 2005
Location: India
Distribution: Redhat,Fedora,DSL,Ubuntu
Posts: 238

Rep: Reputation: 30
hi,
nice link farslayer and it shows

Quote:
The ext2 and ext3 file systems most often used on Linux systems also attempt to keep fragmentation at a minimum. These file systems keep all blocks in a file close together. How they do this is by preallocating disk data blocks to regular files before they are actually used. Because of this, when a file increases in size, several adjacent blocks are already reserved, reducing file fragmentation. It is, therefore, seldom necessary to analyze the amount of fragmentation on a Linux system, never mind actually run a defragment command. An exception exists for files that are constantly appended to as the reserved blocks will only last so long.
regards,
Nirmal Tom
 
Old 04-17-2007, 12:28 AM   #13
tmcco
Member
 
Registered: May 2003
Location: Unknown
Distribution: Unknown
Posts: 59

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by fotoguy
Although I do not know anything about the filesystems themselves I must admit I have had no need to defrag any of my filesystems, even after months of hard use (and abuse), some of my machines haven't had a reformat for atleast 2 or 3 years, they still seem to perform the same as they did when they were first installed.
"they still SEEM to perform the same as they did when they were first installed"

You may need some data to make your thoughts more persuasively. For example, the output of defragfs.
 
Old 04-17-2007, 02:23 AM   #14
Jaqui
Member
 
Registered: Jan 2006
Location: Vancouver BC
Distribution: LFS, SLak, Gentoo, Debian
Posts: 291

Rep: Reputation: 36
tmcco,
try running e2fsk* on your e2fs, or reboot 20 to 30 times, your distro will run it automatically, the messages output will tell you how fragmented the particular filesystem is.

*e2fsk is for the ex2fs, ex3fs has a different call to implement it.
just as every other filesystem available for use in any *x can have the filesystem checked and fragmentation amount reported.

the .6% fragmented is the amount my heavily used home partition has shown regularly, throughout the time I have been using linux, even when I did not rebuild the filesystem for 3 years. My minimally altered / partition generally shows a 0.01% fragmentation after a 6 month period, which is the exact same fragmentation level it showed right after the filesytem was created.
 
Old 04-17-2007, 04:01 AM   #15
tmcco
Member
 
Registered: May 2003
Location: Unknown
Distribution: Unknown
Posts: 59

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Jaqui
tmcco,
try running e2fsk* on your e2fs, or reboot 20 to 30 times, your distro will run it automatically, the messages output will tell you how fragmented the particular filesystem is.

*e2fsk is for the ex2fs, ex3fs has a different call to implement it.
just as every other filesystem available for use in any *x can have the filesystem checked and fragmentation amount reported.

the .6% fragmented is the amount my heavily used home partition has shown regularly, throughout the time I have been using linux, even when I did not rebuild the filesystem for 3 years. My minimally altered / partition generally shows a 0.01% fragmentation after a 6 month period, which is the exact same fragmentation level it showed right after the filesytem was created.
Good.

Could you please run "defragfs" on your fs and paste the result?
 
  


Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
defragmentation tool czezz Linux - Software 1 02-04-2005 09:35 AM
is there any tool for cracking ext2 encrypted file system gadekar Linux - Security 1 08-18-2003 11:52 PM
HDD Defragmentation tool ? membrax Linux - Software 3 01-22-2003 04:30 AM
Defragmentation of File System mikeshn Linux - General 2 04-19-2002 09:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration