LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   De-fragmentation in Linux (https://www.linuxquestions.org/questions/linux-software-2/de-fragmentation-in-linux-617839/)

pprs project 02-01-2008 12:07 AM

De-fragmentation in Linux
 
Hi,
Do we need de-fragmentation in ext3 filesystem ?
If yes, why?
If no, why?

jiml8 02-01-2008 12:38 AM

No. Because it does not tend to fragment.

It will fragment, and can fragment badly, if the drive is nearly full (above 95%) and has lots of files on it that are changed frequently. But that is about the only time that ext3 will fragment to any substantial degree.

tailender 02-01-2008 03:18 AM

http://geekblog.oneandoneis2.org/ind..._defragmenting
Its explained pretty simple in this site

JZL240I-U 02-01-2008 03:20 AM

ext3 is ext2 with a journal ;). Here is a link (german) to an explanation of the mechanisms of fragmentation and why it is not significant in ext2 (as the fore poster already wrote)

http://de.opensuse.org/SDB:EXT2_-_Fragmentierung

sundialsvcs 02-01-2008 09:03 PM

For that matter, "defragmenting" is no longer an issue with Windows' modern filesystems, either!

Curiously, many off-the-shelf drives when you purchase them have been pre-formatted ... with an MS-DOS-era (FAT) filesystem! (I guess the manufacturers do this to keep technical-support costs down, so they don't have to explain what "formatting" means. And there is a certain amount of wisdom in that... ;) )

{Note: "FAT" = File Allocation Table. Referring to the original filesystem format for Microsoft MS-DOS.}

The bottom-line is simple: when you buy a new drive and put it into service, whether on Windows or on Linux or on OS/X, format it. This will install a (blank...) filesystem with the operational characteristics that you need. Any operating-system will have a recommended default ("ext3" is a fine choice for Linux).

All of these filesystems will never require "defragmenting."

Modern systems also routinely provide the concept of journaling, which simply means that if your computer "crashes," it doesn't have to verify the hard-drive on restart: the journal allows the state of the hard-drive to be instantly recovered. ("ext3" adds this capability to "ext2" without change to the disk format... it's upward-compatible and therefore definitely essential.)

All modern operating systems (including Windows, and OS/X, and Linux) provide for the concept of "installable file systems." In other words, they are not limited to just one arrangement of organizing a hard-drive into files and directories, but are capable of supporting one or several disk formats (on different disk volumes...) at the same time. The FAT-based formats will probably be with us until the end of time if only for backward-compatibility reasons, but there is no viable reason to use them for new drives today.

I recently bought a Windows-based laptop and was quite stunned to see that the system had been formatted with a moderate-sized NTFS partition for the main system ... and a large FAT(!!) partition! Since I had possessed the wisdom of also purchasing a Windows-XP retail DVD-ROM at time of purchase, I promptly reformatted the drive ... all of it ... and did a custom-install of XP-SP2 on the single NTFS partition that this poor laptop obviously always should have had. {Never assume that computer-vendors make intelligent decisions. They know they might be selling a computer to your grandmother, and they base a lot of their plans on "making darn sure that 'your grandmother' won't call for technical support!" Yeah, retail margins are that thin.}

lazlow 02-01-2008 10:36 PM

You might want to read the section on NTFS fragmentation in this link:

http://www.digit-life.com/articles/ntfs/

While EXT3 does fragment it is at such a low level that defrag is pointless (assuming the drive is not over 85% capacity).

jiml8 02-01-2008 11:06 PM

Quote:

All of these filesystems will never require "defragmenting."
NTFS is actually pretty bad about fragmenting.

It does indeed seem to be a bit better about allocating files across the space of the HD than FAT is, but it fragments badly anyway, even on partitions that are only half full. I have to periodically defragment my NTFS partitions (I have 6 of them on this workstation, all used by my Win2K installations in VMWare), and they do keep fragmenting as I work with them. The way Windows handles its swapfile - and those gawdawful registry hives, which get big and are constantly being changed - encourage the fragmentation.

archtoad6 02-02-2008 08:33 AM

lazlow,
Do you have any links to NTFS info. that is written in English that is easier to read? I tried that one you posted, but couldn't get through it.

lazlow 02-02-2008 11:40 AM

Rick

Just do a google search on ntfs fragmentation. It is a complex topic so almost all the discussions of it are going to be of a technical nature.

reddazz 02-02-2008 02:01 PM

Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.

Discussion continues here.


All times are GMT -5. The time now is 05:08 PM.