LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 08-22-2004, 11:05 AM   #1
masand
LQ Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 58
defragmenting and Ext2fs


hi

is defragmentation required in the linux filesystem ext2/ext3
because i read it somewhere in the forum that defragmentation is not required in these filesystem
as it is required in windows for fat32 and ntfs


but recently i checked out this url which tell about defragmenting the linux fileysystem

http://e2fsprogs.sourceforge.net/ext2.html

so i am not able decide whther it is right to use this softare,if yes then do we have such for linux

also how safe are these softwares to use from windows,i am sure about this


pl. help

regards
gaurav
 
Old 08-22-2004, 11:40 AM   #2
Andrew Benton
Senior Member
 
Registered: Aug 2003
Location: Birkenhead/Britain
Distribution: Linux From Scratch
Posts: 2,073

Rep: Reputation: 64
Linux uses a swap partition so the file system on your hard disk does not get fragmented. If it ain't broke, don't fix it.
 
Old 08-22-2004, 11:53 AM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 17,483

Rep: Reputation: 2284Reputation: 2284Reputation: 2284Reputation: 2284Reputation: 2284Reputation: 2284Reputation: 2284Reputation: 2284Reputation: 2284Reputation: 2284Reputation: 2284
AFAIK the swap partition has nothing to do with fragmentation. Normally one does not need to defragment a linux filesystem. When an ext2/ext3 filesystem is created 5% (by default) is reserved for root. From what I have read this helps keep fragmentation down and allow root to login in case the filesystem becomes full.

Last edited by michaelk; 08-22-2004 at 11:54 AM.
 
Old 08-22-2004, 12:20 PM   #4
masand
LQ Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Original Poster
Rep: Reputation: 58
hi
yes,swap has nothing to do with defragmentation
we have swap in differemnt partiton whiule we have a swap(virtula memory) in windows too but there is not a different partiton,so then too winsows FS get defragmented
i
i think it is because of the nature of the FS that files get fragmented on a particular FS
and is not the nature of the exct3/ext2 FS to get fragmented

also is the above mentioned link usefulll or not????


regards
gaurav
 
Old 08-22-2004, 02:51 PM   #5
nafan
Member
 
Registered: May 2004
Location: /dev/bed
Distribution: Mandriva 2009.0 Powerpack
Posts: 172

Rep: Reputation: 30
Disk drives in windows get fragmented because
(1) the Virtual memory/Swapfile is not permanent by default
(2) The fat/fat32/NTFS filesystems do not implement any code to minimise fragmentation.
(3) When you save a file in windows, the OS starts to save it in the first available space on the disk, and when it gets full, it jumps to the next available space.

As far as I know, (which might not be that far, please correct me if i'm wrong...) the ext2/ext3 filesystem drivers for Linux contain code that checks to see if writing a file to disk will cause it to become fragmented. If it would be split into pieces then the code checks for another contiguous space on the disk which means that the filesystem will become more fragmented the fuller it gets, but not to the same extent as fat/fat32/NTFS. There isn't really much need of a defragmenter for an ext2/ext3 disk.
 
Old 08-22-2004, 02:57 PM   #6
masand
LQ Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Original Poster
Rep: Reputation: 58
hi

so it safe to use the above mentioned driver to defragment linux partitions from windows???

what about degramneting from linux itself????

regards
gaurav
 
Old 08-22-2004, 03:01 PM   #7
megaspaz
Senior Member
 
Registered: Nov 2002
Location: Silly Con Valley
Distribution: Red Hat 7.3, Red Hat 9.0
Posts: 2,054

Rep: Reputation: 46
there really is no need to defragment on linux although, that's not to say that the linux filesystem doesn't fragment - it does, just not to the extent as windows filesystems do. those proggies seem to already be included in linux distros. they're dangerous to run on a fully mounted filesystem. if you're using an ext3 filesystem, just power down your computer using the power button and do a filesystem check on the reboot (which is prompted automatically, you just have press the 'Y' key). i've personally have never seen anymore than 2% file fragmentation on my linux box after extended use - windows (running winME) on the other hand fragments at about 6-8% (c: drive) for the same amount of use.

Last edited by megaspaz; 08-22-2004 at 03:05 PM.
 
Old 08-22-2004, 03:30 PM   #8
michaelk
Moderator
 
Registered: Aug 2002
Posts: 17,483

Rep: Reputation: 2284Reputation: 2284Reputation: 2284Reputation: 2284Reputation: 2284Reputation: 2284Reputation: 2284Reputation: 2284Reputation: 2284Reputation: 2284Reputation: 2284
Seeing how your running FC2 you probably already have the latest version installed. The website does not mention defragmenting a linux partition from windows. The driver is for read / write to an ext2 partition.

BTW I wouldn't intentionally remove power from the computer just to run fsck.
 
Old 08-22-2004, 04:30 PM   #9
masand
LQ Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Original Poster
Rep: Reputation: 58
hi there

thanks for correcting me
i was actually confused with ext2fs and dump
i thought that is too for windows....

so i do not think i should try that too..
fcsk is ok

regards
 
Old 08-23-2004, 01:58 AM   #10
megaspaz
Senior Member
 
Registered: Nov 2002
Location: Silly Con Valley
Distribution: Red Hat 7.3, Red Hat 9.0
Posts: 2,054

Rep: Reputation: 46
Quote:
Originally posted by michaelk
BTW I wouldn't intentionally remove power from the computer just to run fsck. [/B]
neither would i. but if you're really anal and using a journaled filesystem, it doesn't hurt anything at all to do a hot power down. the chances of you corrupting your filesystem are slim to none.
 
Old 08-23-2004, 02:53 AM   #11
masand
LQ Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Original Poster
Rep: Reputation: 58
Quote:
Originally posted by megaspaz
neither would i. but if you're really anal and using a journaled filesystem, it doesn't hurt anything at all to do a hot power down. the chances of you corrupting your filesystem are slim to none.

on the journalling FS i think i have support for that in the kernel 2.6 and the FC2
and i have also compiled my kernel with that also
so no worries for me
i guess!!!!!!!!!


regards
gaurav
 
  


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
Does NTFS ever need defragmenting? servnov General 19 10-13-2004 11:27 AM
defragmenting ttilt Linux - Software 11 12-28-2003 08:34 AM
Defragmenting in linux? wiggywag Mandriva 7 11-25-2003 12:22 AM
Defragmenting cucolin@ Linux - Software 2 11-25-2003 12:10 AM
defragmenting otaku9876 Linux - Software 4 09-24-2001 03:38 PM

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

All times are GMT -5. The time now is 08:21 AM.

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