Page 1 of 1

In-Depth Article On DEFRAGMENTING

Posted: 15 Jan 2010 10:36 am
by Chip Fossa
Early this morning I installed Auslogics Disk Defrag to try it out. It's free and was on the list on the Windows Seven Forum topic, "FREE Great Programs for Windows 7", http://www.sevenforums.com/software/92- ... s-7-a.html

http://www.auslogics.com/en/software/disk-defrag/

The "defrag & optimize" option (longest time) took about 10 minutes.

While checking out the entire software and it's options, I came across a couple of things I didn't understand:
a.] non-fragmented
b.] auto-defrag system disk ONLY

So I went looking on the web for those two items I didn't understand, and found this great article, instead [on 'defragmenting'], that really cleared up a lot things for me. Things I knew of, but didn't understand very well.

It's rather longish, and in some spots still a bit above me, but I pretty much got the whole gist of defragmenting.

It's definitely worth a read for anyone wishing to better their understanding of just how these crazy machines actually work.

http://www.diskeeper.com/defrag/impact- ... ation.aspx

I still don't know what 'non-fragment' and 'disk only'
mean, but someone here will probably straighten me out, I'm sure.

Check out that article. :)

Posted: 15 Jan 2010 11:54 am
by Bent Romnes
Chip,
The way I see those words:
non-fragmented means that there is no fragmentation present on the disk.
Through use, files get stored here, there and everywhere on your disk (gets stored in fragments) When you run DE frag, it takes all these little fragments of files and puts them in a nice orderly spot.

defrag system disk only, means simply that if you have 2 disks, that you direct the defrag to do the one containing the operating system only.

Posted: 15 Jan 2010 12:03 pm
by Jack Stoner
As you use a hard drive and read/write to it, the OS basically will write to whatever it free at the time. Thus instead of data being in blocks side by side, part may be in one location on the hard drive, another in a different area and even other parts in other locations on the hard drive. "Defragmenting" puts all the parts of a data file in adjoining locations on the hard drive, which makes accessing that data slightly faster since it's all together and not at many places on the drive.

Different defrag programs also methods of placing certain programs in one area of the drive, some based on how often they have been used.

Who's program is better, is like asking which Pedal Steel Guitar is better. Personally, I use the built in (and free) Windows defrag and do not find any problems with that.

Posted: 15 Jan 2010 12:22 pm
by Mitch Drumm
By default, the Windows 7 built in defrag does not defrag file segments of less than 64mb in size. It will show 0% fragmentation even though the disk has fragments under 64mb in size. Windows engineers believe that file segments that small don't effect disk performance.

I think you can force more complete defragmentation by running defrag through a command line switch.

Windows defrag requires administrator privileges from the command line.

defrag c: /a will analyze and report the defragmentation level of the C drive.

I just checked my C, D, and E drives. Fragmentation is reported at 2%, 0%, and 0%, respectively. I have had Windows 7 installed for nearly 3 months and did just one manual defrag immediately after the installation. Other than that, I haven't defragged other than what Windows does by its default schedule of once per week. So, it seems to be working well.

Based on that, I plan to ignore manual defragging indefinitely.

Posted: 15 Jan 2010 5:07 pm
by Chip Fossa
In Auslogics, I have defrag set to "auto-defrag", once every 12 hours.

I like the program, because you can at least SEE what's happening, and get reports and visual-aides stuff etc. Windows defrag? Hmmm? I'm not here to argue; just to present a pretty fair alternative.

That article I referred to. That guy does know what he's talkin' about. At least to me.

And by no means, I don't say this in any way to diminish the expertise of all the "professors" here.

Thanks Bent - seems redundant, though. Non-Frag is essentially De-Frag. And DISK ONLY? Well, before you defrag, you have the option to choose which drives you want to defrag. :\

Posted: 15 Jan 2010 6:58 pm
by Harold Liles Jr
Chip, unless you are storing and editing a massive amount of files and have 3 or 4 users on your machine you shouldn't need to defrag more than once a month. Personally I only defrag once every 3 months and I work with a lot of photo and music editing software. THere is no need to put excess wear on your hard drive mechanics..

Posted: 15 Jan 2010 7:02 pm
by Andy Sandoval
Yep, once every 12 hours might be a little excessive.

Chip, is that program a lot better than the defrag program that comes with any version of Windows?

Posted: 15 Jan 2010 9:59 pm
by Chip Fossa
Harold and Andy...

Maybe you guys didn't actually read and understand the article?

Hmmm???

And anyway, what can be hurt by an auto-defrag?

Just checkout Auslogics.

You guys sound very professorial.

Posted: 16 Jan 2010 3:13 am
by Jack Stoner
Defrag every 12 hours? Completely ridiculous. To need that much would mean you are constantly writing new data to the hard drive, and even then it won't buy you any PC speed up that you will be able to see or even detect.

People sell many computer programs (not just defrag) with many wild claims and they make them sound like it's really needed. But in fact it's strictly "sell more product".

Defrag ever 12 hours is like you telling a customer that the faucet washers need replacement once a week.

Posted: 16 Jan 2010 3:39 pm
by Joe Harwell
A couple of other terms that need to be thrown in here are contiguous and non-contiguous.

If lots of large files are used frequently such as video and sound are used, especially editing, look closely at your options for formatting your hard drive.

Contiguous file space has lots to do with your pagefile system, as does it location.

One trick I like is to delete the pagefile on shutdown. A new one will be created on boot up.
Then you have no defrag issues with the pagefile. It's always fresh.

Plus its a little added system security of critical info perhaps.

Last I knew, MS purchased Diskkeeper's basic defrag technology and implemented with the rollout of W2K.
Don't know if it's been retained.

In the end, the biggest hard drive you can afford helps with contiguous temp work areas as a rule of thumb. Each person's needs are different.

Before defragging, dump your browser caches, delete temp files, and any other routine deletions and uninstalls.

Defragging is very labor intensive physically on a hard drive. For my needs, once a month is more than sufficient.

As with all technology, no one size fits all.

Posted: 16 Jan 2010 4:45 pm
by John Cipriano
Auto-defrag is different than scheduling one every 12 hours (which, like everybody already said, is way too much). Auto-defrag means that as soon as a file is fragmented, it gets moved. My feeling about that is that if it improved performance, it would be built into the filesystem.

That said, I do have Diskkeeper running on a server, and that has auto-defrag. It came with the server and I said, what the heck :)

Chip: Windows doesn't skip files smaller than 64mb, it skips files larger than 64mb. The reason for this is that by the time something useful is done with those 64mb, the hard drive has had time to spin to the next 64. That's sort of a crude explanation, but hopefully it makes some sense. I have to imagine that they did some serious benchmarks to defend that decision.

Now, they have millions of hardware configurations to think about, so it is possible to gain some performance with some tweaks for your specific hardware. But defragging twice a day is not one of them :)

I'll be happy when SSDs are the norm and most users don't have to deal with the problems of sequential storage.

Posted: 17 Jan 2010 8:26 am
by Chip Fossa
Well, the program is FREE. I wouldn't buy this program.

I think one of the points that the article was trying to get across was to try and keep down the physical moving of the disk arm when searching around for fragmented files. The more movements, the harder the whole drive works.
By defragmenting periodically, it's less movement and strain on the disk, than waiting until a massive defrag is necessary. I wasn't thinking about increasing the PC speed; but rather, reducing wear and tear on the physical disk itself.

Twelve hours is maybe a bit of overkill. Maybe I'll reconsider and set it for once a week, or just remember to do it manually.

Joe, where would you locate the 'pagefile' to delete on shutdown? Can you give a simple example? I can't see this in my mind's eye.

Posted: 17 Jan 2010 1:34 pm
by Mitch Drumm
c:\pagefile.sys; it's cranky and would prefer you took your toys and went home and left it alone, but if you insist................

Posted: 17 Jan 2010 1:53 pm
by John Cipriano
The more movements, the harder the whole drive works.
Absolutely. Just don't forget to consider the source when you see those benchmarks :D

The general idea is right on, though. You can't ask for a file in the middle of a platter without having to spin the platter and swing the head. (Tapes are worse...if you want something at the end you have to fast forward through 750 feet of tape!) This is why it takes longer in total to run multiple large copy jobs, or launch multiple large programs simultaneously, etc. The CPU does not incur much of a penalty jumping from job to job, but the hard drive does.

(edit: snip snip)

How often to defrag depends on usage. I know you use multiple drives so your system drive may not be all that fragmented. Maybe schedule a defrag for once a month. That said, I don't agree that it's dangerous to do it more often...the more you do it, the less there will be to do. It's just not really necessary to do it that often.

As for the pagefile, at least on XP it's a file called pagefile.sys. The simplest way that I know of to delete it is to go into the virtual memory settings and turn off paging. I'm not sure if you can delete it in explorer.
http://requiem4adream.wordpress.com/200 ... indows-xp/

I don't actually see any benefit to deleting and recreating it on boot. If you set it to a fixed size, it will not get fragmented. But even that may be excessive. Windows is good about managing the swap file. Large amounts of swapping are always going to slow the machine down, for the reasons mentioned above. Something's being loaded from disk into RAM, but at the same time what was in RAM is being written to a different section of disk. So there is a lot of back and forth activity ("churn"). This is what makes it slow...combined with that, the difference between a fragmented or contiguous page file is negligible, AFAIK.

Posted: 17 Jan 2010 2:31 pm
by Chip Fossa
Thanks Mitch & John,

John - what you said - now that's gonna take some time for me to digest. This is now: "I bit off more than I can chew". But I'll figure it out, I guess.

Just some new terms and ideas that will take me time to grasp.

After all, I'm still in the minor league [a rookie] :D

Posted: 17 Jan 2010 6:58 pm
by John Cipriano
I wouldn't be too embarrassed of that. IT isn't very glamorous.

The stuff I was saying about copy jobs you can ignore. My point was just that hard drives have certain physical characteristics which impact their speed, which is I think what you were showing us with the article. For instance, most of the disk access happens at boot time, so we can expect defrag to speed up boot a little. Once everything is loaded into RAM, you see less of a benefit.

I like how wikipedia puts it: hard drives are like a scroll, since to get at what you want you have to pass by everything in front of it. RAM is more like a book in that you can flip to any page.

I don't know if you find this stuff interesting but...there is a actually long chain of access that goes from CPU registers, to CPU cache, to RAM, to disk cache, and finally to disk. Register access can be "free" (zero CPU cycles) or close to it. RAM access takes longer because RAM runs at a fraction of the CPU speed (specifically it runs at the speed of the front side bus). Hard drive access times are long enough that they are not measured in CPU cycles. Also they are unpredictable. With RAM we might be able to say "this takes 8 cycles to get at" but with the disk you have no idea because it depends on where the data is on the disk.

It's all only tangentially related. I just find the underlying concepts more fun to talk about than the practical stuff, like when to defrag :)

Posted: 19 Jan 2010 7:24 pm
by Joe Harwell
Chip Fossa wrote:Well, the program is FREE. I wouldn't buy this program.

I think one of the points that the article was trying to get across was to try and keep down the physical moving of the disk arm when searching around for fragmented files. The more movements, the harder the whole drive works.
By defragmenting periodically, it's less movement and strain on the disk, than waiting until a massive defrag is necessary. I wasn't thinking about increasing the PC speed; but rather, reducing wear and tear on the physical disk itself.

Twelve hours is maybe a bit of overkill. Maybe I'll reconsider and set it for once a week, or just remember to do it manually.

Joe, where would you locate the 'pagefile' to delete on shutdown? Can you give a simple example? I can't see this in my mind's eye.
To minimize the non-contiguous area needed for its temporary work space is why contiguous space is needed.

Minimizing fragmentation increases performance.

Pagefile.sys tweaks are just small ways to add a little performance perhaps. I wouldn't sweat it
because it is possible to render your computer unbootable. Let if-it-aint-broke-don't-fixit prevail.

I do prefer a static pagefile.sys as opposed to a dynamic one.

My comments on the pagefile.sys also concerned
recommendations to defrag it. That's really what I was addressing. I've had bad experiences attempting to defrag it.

Bottom line, free space is not the same as free contiguous space. Maintaining plenty of free contiguous space is my goal.

I see 40gb SSD for 125.00. Won't be long to I go SSD.

Posted: 19 Jan 2010 7:33 pm
by Joe Harwell
And remember the corollary to, "Let if-it-aint-broke-don't-fixit prevail."

"If-I-tear-it-up, I-don't-mind-spending-the-next-week-fixing-it-and-losing-all-that-great-data-I've-saved-since-last-back-up."

Back up? What is this "back up"?
I don't need no stinkin' back up!

Posted: 21 Jan 2010 7:27 am
by John Floyd
c:\pagefile.sys is usually open and The Operating System won't let you delete an open file.
However if you have a second operating System on another Drive Such as Win XP,and boot up in that, You can Delete pagefile.sys on the previous operating System, It just won't be Drive C: anymore.

I would use Caution Deleting This File!

Posted: 21 Jan 2010 7:35 am
by Chip Fossa
Yesterday I did a complete image of C drive and noticed that a couple of times during the process a warning flag would pop up saying a certain file could not be acted on, and saw that it was either a pagefile.sys or a DAT file.

I just clicked OK and moved on.

Believe me friends, I'm from the very same school - if ain't broke, don't fix it and leave well enough alone.

It's taken a long and painful and expensive journey to finally grasp that notion. :)

Thanks all.