LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-22-2010, 09:17 AM   #1
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662

Rep: Reputation: 47
Defrag in Linux


In Windows the command defrag makes the hard drive somewhat effective-

How do I do the defrag in Linux?
 
Old 02-22-2010, 09:26 AM   #2
JimBrewster
Member
 
Registered: Feb 2010
Location: usa:/dev/random
Distribution: Slackware-15.0; -current
Posts: 245

Rep: Reputation: 60
The short (and I'm sure overly simplistic) answer is that Linux filesystems don't become fragmented the way they do in Windows, so defrag is not needed.
 
Old 02-22-2010, 09:26 AM   #3
fusion1275
Member
 
Registered: Jul 2007
Location: Knaphill, Surrey
Distribution: Linux Mint
Posts: 310

Rep: Reputation: 36
Hi, please explain to us what you are trying to achieve?

Linux has all sorts of filesystem checks and disk integrity checks. Whats going with your installation?

Rgds
 
Old 02-22-2010, 09:33 AM   #4
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662

Original Poster
Rep: Reputation: 47
Thanks for the replies,

I thought there is a defrag command in Linux which does the same as the Microsoft.

There may be another way of checking file disarray in Linux.
 
Old 02-22-2010, 09:47 AM   #5
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by Gins View Post
Thanks for the replies,

I thought there is a defrag command in Linux which does the same as the Microsoft.

There may be another way of checking file disarray in Linux.
You don't suffer from "file disarray" in Linux, at least not the the way you're thinking of it. There are no 'defrag' tools, because there's never a NEED to 'defrag' your disk.
 
Old 02-22-2010, 09:54 AM   #6
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Take a look at
http://geekblog.oneandoneis2.org/ind..._defragmenting
 
Old 02-23-2010, 03:22 AM   #7
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
I/O schedulers render defragers useless, mostly. Most file systems do not have an issue with fragmentation, not a noticeable one anyway (as long as you don't use reiser 3.x). You can always backup, format and restore if you are really interested.

There have been a number of attempts to create such tools in the past, but all the projects I knew of have been discontinued, no real interest in them besides academic interest. There are also plans for such a tool for ext4, and also for an on-line defragmenter, maybe also for btrfs. However this might very well be also a project that will die before it's born as the rest of them in the past.
 
Old 02-23-2010, 08:34 AM   #8
giammy
Member
 
Registered: Feb 2010
Posts: 36

Rep: Reputation: 20
Quote:
Originally Posted by Gins View Post
In Windows the command defrag makes the hard drive somewhat effective-

How do I do the defrag in Linux?
Hi,

perhaps the most simular tool is fsck, but it do no defrag: it checks
filesystem concintency. Anyway it is automattically strated from time
to time: no need for you to start
bye
giammy
 
Old 02-23-2010, 09:03 AM   #9
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662

Original Poster
Rep: Reputation: 47
Thanks everybody.
Our friend giammy touched on the command 'fsck'. It is different; nothing to do with de-fragmentation.
However, repo had given us an interesting link.

I use or rather people use ext3 file system. I don't know about 'reiser' file system. This must be something new.
 
Old 02-23-2010, 10:57 AM   #10
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by Gins View Post
Thanks everybody.
Our friend giammy touched on the command 'fsck'. It is different; nothing to do with de-fragmentation.
However, repo had given us an interesting link.

I use or rather people use ext3 file system. I don't know about 'reiser' file system. This must be something new.
No, not new at all:

http://en.wikipedia.org/wiki/ReiserFS
 
Old 02-23-2010, 12:31 PM   #11
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Reiser has its age, it's no longer a young critter. It has its own set of lovers and haters around it just like every other fs around. There are quite a lot of fs's that are compatible with linux to a given extent. Ext2/3 is considered the standard linux fs though. The wikipedia is full of articles about the many linux fs's. You can start researching around there if you feel curious, they are not hard to find.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
defrag on Linux ashley75 Linux - General 27 02-05-2009 04:21 PM
Defrag in Linux? fedivh Linux - General 4 02-09-2004 04:02 PM
How Can i Defrag Linux??? FearPasion710 Linux - General 9 10-29-2003 04:45 PM
Defrag in Linux? orange400 Linux - General 7 03-15-2003 02:32 AM
Defrag in Linux? glitch Linux - Newbie 2 09-02-2002 06:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:06 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