Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

is there such a thing as defrag in linux?

Status
Not open for further replies.

prophotodx

Technical User
Jan 20, 2003
147
Hello, another linux newbie question, is there such a thing as defragmenting hard drives in linux? My server is running Fedora 3, and if there is what is a good choice?

Greg
 
There's not reason to de-frag a well design filesystem, so other than creating a new partition and copying the data over, no there's not de-frag for linux.
 
There is no defragmentation, because as ericbrunson said, either the FS is well-designed, or it happens along the way, invisibly (which would still be good design! haha).

On the other hand, choosing a filesystem can be tricky. Here's what the Gentoo documentation ( says about a few of them:

ext2 is the tried and true Linux filesystem but doesn't have metadata journaling, which means that routine ext2 filesystem checks at startup time can be quite time-consuming. There is now quite a selection of newer-generation journaled filesystems that can be checked for consistency very quickly and are thus generally preferred over their non-journaled counterparts. Journaled filesystems prevent long delays when you boot your system and your filesystem happens to be in an inconsistent state.

ext3 is the journaled version of the ext2 filesystem, providing metadata journaling for fast recovery in addition to other enhanced journaling modes like full data and ordered data journaling. ext3 is a very good and reliable filesystem. It has an additional hashed b-tree indexing option that enables high performance in almost all situations. You can enable this indexing by adding -O dir_index to the mke2fs command. In short, ext3 is an excellent filesystem.

ReiserFS is a B*-tree based filesystem that has very good overall performance and greatly outperforms both ext2 and ext3 when dealing with small files (files less than 4k), often by a factor of 10x-15x. ReiserFS also scales extremely well and has metadata journaling. As of kernel 2.4.18+, ReiserFS is solid and usable as both general-purpose filesystem and for extreme cases such as the creation of large filesystems, the use of many small files, very large files and directories containing tens of thousands of files.

XFS is a filesystem with metadata journaling which comes with a robust feature-set and is optimized for scalability. We only recommend using this filesystem on Linux systems with high-end SCSI and/or fibre channel storage and an uninterruptible power supply. Because XFS aggressively caches in-transit data in RAM, improperly designed programs (those that don't take proper precautions when writing files to disk and there are quite a few of them) can lose a good deal of data if the system goes down unexpectedly.

JFS is IBM's high-performance journaling filesystem. It has recently become production-ready and there hasn't been a sufficient track record to comment positively nor negatively on its general stability at this point.

-Haben sie fosforos?
-No tiengo caballero, but I have un briquet.
 
You know, I'm not so adept at Gentoo, only having installed it about 3 or 4 times, but dammit they write some good documentation.
 
*laugh* 3 or 4 times should be good enough to get you a good concept of how it works. And I do agree with you -- it's extremely clear and understandable, and a reference for any and all distributions out there :)

-Haben sie fosforos?
-No tiengo caballero, but I have un briquet.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top