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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Defragging 3

Status
Not open for further replies.

SamDemon

Technical User
May 28, 2003
171
0
0
GB
I am not sure if this is the best place for me to place this query, so I apologise if it isnt.

In our office there are 6 servers which are all now starting to look a little fragmented. I would like to defrag them, but it is something that i have never done before and i was wondering what the possible problems are.

I will be using the Windows defrag and not anything external.

Thanks

Sam

It's just common sense, shame sense isn't common!
 
Thanks...

Will it effect the defrag if it is run during the day?

Sam

It's just common sense, shame sense isn't common!
 
I agree with electronicsfreak. Your first defrag may take quite a while. The servers will need to be either offline, or at least no disk activity on the partition you are defragging during the defrag.

I find it pays to defrag as often as you can as the longer you leave it, the longer it takes. I also find with microsofts defrag it pays to repeat immediately a couple of times to get a better result. It's as if it doesn't do the job properly.

Finally I never trust chksdk to deal with bad sectors. It seems to simply mark them bad and bins any data on them. I run spinrite to deal with that side of things, but use chkdsk to check the fle structure.
 
I have a slight problem in that the server with the most fragmentation is the mail server... which is an integral part of the company.

The disk that requires the de-frag is only 40GB in size... any ideas how long that should take (worse case scenario!)

Sam

It's just common sense, shame sense isn't common!
 
There's no way to really forecast the amount of time a defrag is going to take even if you know the size of the partition. The speed of the defrag depends on how fragmented the drive is, the size of data that has to be moved (which is determined during the analysis), and the speed of the system in question.

With Norton's SpeedDisk, I can usually defrag partitions that are under 30GB in less than 20 minutes on a newer PC. But like stduc said, if you have never defragged or if it's been a long time, it will take longer than if you were in a routine of doing it often.

It would be best for you to schedule an outage time with company management, perhaps performing it on a Saturday or Sunday instead of during the week (or at the very least, do it at night).

~cdogg
"Insanity: doing the same thing over and over again and expecting different results." - Albert Einstein
[tab][navy]For general rules and guidelines to get better answers, click here:[/navy] faq219-2884
 
electronicsfreak said:
Drives overtime will become that way

[pedant mode]
Make that "Windows file systems will become that way". None of the file systems for *nix, OSX, AIX, VMS, or Netware have this problem, only NTFS (not too badly) and FAT. Mostly FAT.
[/pedant mode]
 
Lawnboy,

That's interesting. It was my understanding that any file system is vulnerable to fragmentation.

Think about it this way. Say I add 20 gigs of data (video, audio, etc) to the system partition. Then I go an install a few programs. Now the structure in any file system is going to show that 20 gigs of data somewhere in the middle between system files and the programs I just installed.

Now say I move at random 5 of that 20 gigs over to another partition. If you were to analyze the system partition, you would now find random holes of free space spread out. It's NOT considered fragmented yet at this point.

As a final step, say I install a huge program like Adobe Acrobat or Microsoft Office on the system partition. Isn't it reasonable to assume that some holes are going to be filled with this new data? As a result, the software application is going to show as fragmented.

To me, fragmentation has little to do with the file system and more to do with the user's behavior. Perhaps some file systems are better than others in dealing with this, but I don't see how any file system can actually prevent it. Maybe I'm missing something...

~cdogg
"Insanity: doing the same thing over and over again and expecting different results." - Albert Einstein
[tab][navy]For general rules and guidelines to get better answers, click here:[/navy] faq219-2884
 
Basically these other file systems defrag continuously as they run and keep themselves clean. A user never needs to run a utility (well, ok, some of the *nix filesystems, like ext2, come with defragging utilities, but it's a rare instance when you would need to use it).

There are many, many different techniques used to do this. I won't pretend to understand them all by any means...
 
OK, now I see. You are referring to the OS keeping things tidy - not the file system itself.
 
No, it is the job of the file system itself. Generally the OS has no clue what the FS is doing, it merely hands a request to the FS driver and waits for the return.

For example, the linux kernel can utilize a FAT32 FS, and FAT32 acts like it does anywhere and occasionally needs external maintenance with a defragger. However, that same linux kernel can also be using the reiserf FS, which never needs external maintenance (barring catastrophe, of course).
 
Agreed. I defrag my home PC running 'Doze about every 2 weeks. I have *NEVER* had to defrag my linux server... and doing a DF shows never more than 2% fragmentation.

In regards to the mail server tho... why don't you set the defrag to run as a task at, say, 2 a.m.?



Just my 2¢

"In order to start solving a problem, one must first identify its owner." --Me
--Greg
 
OK, did some research and here's what I found:

According to a Wikipedia entry, EXT2 (ReiserFS) has a built in tail-packing scheme "to reduce internal file fragmentation. Tail packing, however, has a significant performance impact; Namesys recommends disabling the feature in performance-critical applications."

So digging further, you find that there is external fragmentation (like what I described above) and there is internal fragmentation. Internal is described by Wiki as "...any space left over between the last byte of the file and the first byte of the next sector..."

So what does all that mean? It means that ReiserFS is not immune to fragmentation. It only has a built-in feature to handle "slack space" (internal frag) issues, which NameSys admits causes a noticeable hit on performance. Holes with free space like in the example I mentioned will undoubtedly cause external fragmentation, even in ReiserFS.



But here's the kicker you were probably taught. According to the article below, most fragmentation in ReiserFS does not matter [blue]when paired with the Linux OS[/blue]. This is because Linux reads ahead 16 blocks. The ext2 file system in turn writes files using at least 7 successive blocks. The combination of style that Linux and ext2 use in reading/writing data cancels out the effect of MOST fragmentation.



The bottom line is that ReiserFS gets fragmented just like other file systems. It just doesn't impact performance in the same way that it does in FAT or FAT32 for example.

~cdogg
"Insanity: doing the same thing over and over again and expecting different results." - Albert Einstein
[tab][navy]For general rules and guidelines to get better answers, click here:[/navy] faq219-2884
 
Gotta be careful using Wikipedia, ext2 and reiser are not the same FS. Reiser has found a way around most of the performance hits of ext2 (from what I've read, I've never setup performance tests of my own). Reiser V3 is what I'm using on my production webservers.

That's an excellent link you posted, and I must say that in my experience FAT32 on linux requires less maintenance than FAT32 on Windows. So the OS does have an impact, along with lots of other things.

Certainly, the holes you describe do occur in all FS's. Most FS's fill in those holes during 'slack time'.

Side note, I've never been 'taught' anything, I'm completely self-educated. I've about 15 years experience getting paid to work on various computer systems. I'm actually a very good electronics technician who decided he needed more money.

 
Well, we're in the same boat then! I've got about 10 years experience working on PC's, and just about everything I know or post about here was self-taught. Hell, I'm always learning!!

I've been a member here since 2001. It took me a long time to figure out what about this site keeps me coming back so often. I finally realized that it's because of threads like this. Must be an itch to unravel the unknown that just won't go away...
[yawn2]


As for Wiki, I agree. It's never a good source to use "by itself". But most of the topics I pull from there have been read by thousands of users and modified many times. It's the abstract, opinionated topics that you find disturbing and inaccurate.

~cdogg
"Insanity: doing the same thing over and over again and expecting different results." - Albert Einstein
[tab][navy]For general rules and guidelines to get better answers, click here:[/navy] faq219-2884
 
cdogg said:
Hell, I'm always learning!!

Hey, in this business, you either keep up or you get out. And Tek-Tips is a great way for people to "hash out" what they think they know; all in the pursuit of better understanding.

I don't understand all the ins and outs of all these FS types, but I do know that I've only ever run a defragger on a FAT or NTFS partition.
 
Interesting thread. A star for cdogg for digging in and getting the goods on the FS defrag dilema. I have often wondered about this as well. Thanks for the highly informative thread.

"Once you can accept the universe as matter expanding into nothing that is something, wearing stripes with plaid comes easy"
Albert Einstein
 
Thanks, I'm glad you found it useful. Star for LawnBoy as well for setting the topic and shedding some light on what is usually a repetitive discussion.

[cheers]

~cdogg
"Insanity: doing the same thing over and over again and expecting different results." - Albert Einstein
[tab][navy]For general rules and guidelines to get better answers, click here:[/navy] faq219-2884
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top