LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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


Reply
  Search this Thread
Old 12-27-2003, 04:00 PM   #1
ttilt
Member
 
Registered: Dec 2003
Location: Campinas, Brasil
Distribution: slackware 10
Posts: 150

Rep: Reputation: 15
defragmenting


I searched for defradmentation options on Linux, but only found one post on that topic and people said it's not necessary to defragment the disk on linux. So I was just wodering if that's really the case. How can Linux not need to be defragmented? And how can one defragment the HD on linux?

Thanks!

Great site this linuxquestiosn.org, I just found it yesterday!
 
Old 12-27-2003, 04:14 PM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 234Reputation: 234Reputation: 234
Like the post you found stated, no need to defrag your drive in linux. I'm suprised it only turned up one post for you, this is asked all the time.

Regards.
 
Old 12-27-2003, 04:35 PM   #3
merlin371
Member
 
Registered: Jul 2003
Location: Italy
Distribution: Ubuntu/Fedora
Posts: 152

Rep: Reputation: 30
but why do you not need it?
 
Old 12-27-2003, 04:39 PM   #4
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 234Reputation: 234Reputation: 234
Quote:
Originally posted by merlin371
but why do you not need it?
You only defrag a filesystem when its fragmented, which in Linux you don't need to, cause it doesn't get fragmented. Its the way they designed the filesystem, which is superior to Windows type filesystems.

Try searching, there are better explanations out there already on this topic.
 
Old 12-27-2003, 06:39 PM   #5
Mega Man X
LQ Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 64
Roughly saying, it's because the file systems are a conjunct of blocks of the same size. Files are allocated into those blocks, but the files are not of the same size of the blocks. This will generate a lot of blocks with wasted/empty space.

Linux, in another hand, tries to preallocate data in blocks of 8 units (ext2 and 3, no idea about the other file systems for Linux...). If a file is not in use or deleted, it reallocate the block, so no space is wasted.

That's why in Windows (FAT16/32, I have no idea how NTFS works...) you lose a huge amount of space after a while with half-used blocks. This is bad for performance as well, since it takes longer time to the OS access these blocks. Running a defrag fix it though, it frees space, make the system faster and so on...

I've heard of some tools to defrag Linux partitions, never tried any of them either (looks tough to use, cannot be used under mounted partitions and so on). It's not a matter that you don't need to defrag a Linux partition, actually, you could do, but the waste of space in blocks is to small to worry about it...

Again, I have no idea how NTFS works, but I'd like to know

Last edited by Mega Man X; 12-27-2003 at 06:41 PM.
 
Old 12-27-2003, 07:51 PM   #6
dalek
Senior Member
 
Registered: Jul 2003
Location: Mississippi USA
Distribution: Gentoo
Posts: 2,058
Blog Entries: 2

Rep: Reputation: 79
Actually there is a company that is making software to defrag Linux. They "claim" it does get defraged. I have never seen mine get over about 3 or 4% myself. I delete and copy crap all over the place. Usually because I screw something up.

If you really feel you need it I may can search and find the company name. I sent them a e-mail. Still think they are milking a dead cow myself.

My advice, unless you are running some big fancy server that you need every ounce of speed from, don't worry about it.

Later



Last time checked, .3% on this rig. Note the ".".
 
Old 12-28-2003, 02:37 AM   #7
ugenn
Member
 
Registered: Apr 2002
Posts: 549

Rep: Reputation: 30
i have an ext2 partition that is 6.8% defragmented.
 
Old 12-28-2003, 03:08 AM   #8
mikshaw
LQ Addict
 
Registered: Dec 2003
Location: Maine, USA
Distribution: Slackware/SuSE/DSL
Posts: 1,320

Rep: Reputation: 45
Someone please correct me if I'm wrong, but I believe Linux file systems actually do fragment....so they came out with journal file systems (ext3 and reiser).
I may be mistaken about this, but i assumed these were, in a sense, self-defragging file systems. Ext2 is not.
 
Old 12-28-2003, 03:14 AM   #9
ugenn
Member
 
Registered: Apr 2002
Posts: 549

Rep: Reputation: 30
no. journaling is more concerned with fs recovery than defragmentation.
 
Old 12-28-2003, 03:20 AM   #10
mikshaw
LQ Addict
 
Registered: Dec 2003
Location: Maine, USA
Distribution: Slackware/SuSE/DSL
Posts: 1,320

Rep: Reputation: 45
k...I wasn't sure....hence the "correct me" part.
tanks
 
Old 12-28-2003, 08:46 AM   #11
dalek
Senior Member
 
Registered: Jul 2003
Location: Mississippi USA
Distribution: Gentoo
Posts: 2,058
Blog Entries: 2

Rep: Reputation: 79
I must confess, I use reiserfs for all my partitions. That may make a difference.

I seem to recall reading somewhere that you have to be pretty fraged to really make a noticable difference.

How do you get it to check that anyway? I watch it when I boot up, which ain't very often, and it scrolls by.

Later

 
Old 12-28-2003, 09:34 AM   #12
OrphanedLand
LQ Newbie
 
Registered: Dec 2003
Distribution: Slackware
Posts: 26

Rep: Reputation: 15
Fragment

Linux file systems can be fragmented. It's normal. Because Linux is multi-threaded and multi-user OS. And fragmented file system is good for these OSes. To defragment Linux can decrase performance.

Sometimes you can see your HDD is spinning so much. In that time, Linux changes inodes for files and reallocate some files for increasing performance. But it is not defragmantion.

Linux is a good designed OS. So don't worry about it. Only use

Linux forever
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
defragmenting and Ext2fs masand Linux - Software 10 08-23-2004 03:53 AM
Defragmenting in linux? wiggywag Mandriva 7 11-25-2003 01:22 AM
Defragmenting cucolin@ Linux - Software 2 11-25-2003 01:10 AM
Defragmenting files.. udayan Programming 2 07-19-2002 09:15 AM
defragmenting otaku9876 Linux - Software 4 09-24-2001 04:38 PM


All times are GMT -5. The time now is 06:48 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration