How To 'de-frag' A Mac?

RichardFinlay

Registered
Hi there. My Mac G5 is going nuts on me. It's getting incredibly slow (it's a second hand Mac that used to belong to a graphics designer). I'm no computer, nor Mac expert but I do have a Windows XP laptop aswell and I know how to do a "disc de-fragmentation" on that -- the question is, can you do that with a Mac G5? How do I do that, or do something similar to help speed up my Mac? Thanks for any help anyone can offer. Much appreciated!

Thisz me: 1.8 GHz PowerPC G5, 512 MB DDR SDRAM, super drive.
 
OS X defragments itself as you use it. It's part of the charm :)

There are other problems that cause your Mac to be slow. Most (if not all) of these traditional symptoms can be fixed by running an app like Onyx.

It's like spring cleaning for your mac.
 
Among the things which may be wrong with your computer, file fragmentation is among the least likely to be causing your slowdown. I would bet dollars to donuts that you are running out of space on your hard drive. No amount of defragmentation or anything is going to fix that. You need to delete some old files as a temporary measure. However, your better bet is to buy a large capacity external hard drive.
 
Thanks for getting back to me.
This is my current capacity and storage, I don't think it's bad at all. Tell me what you think.

Macintosh HD, Kind: Volume, Format Mac OS Extended (Journaled)
Capacity: 149.04 GB
Available: 83.36 GB
Used: 65.68 GB on disk

Movie Drive, Kind: Volume
Format: Mac OS Extended (Journaled)
Capacity: 76.21 GB
Available: 76.16 GB

So you do the math and let me know what you think about me running out of space.. Thanks...
 
you're certainly doing fine for disk space. I'd go ahead and run the utility listed above, and see how that works for ya.
 
You might want to upgrade your RAM (maybe double what you have). I know that my machine slows down after three or four days of being logged in, because the virtual memory files reach about 6GB in total. I only have 256MB more RAM than you have, and I need to do an upgrade in the near future to about 1.25GB. Your machine will max out at a lot more than that, and, the more, the merrier.
 
While fragmentation is certainly less of an issue on OS X than it is on Windows, it IS still a problem. Typically, with 70+GB of free space, you won't need to worry too much about normal use, so I agree that it's probably not your current problem. But then again, you have no idea what that drive used to be used for. Your free space could be fragmented to the point where your virtual memory swap files are split into many chunks, and that can be a huge speed killer. OS X DOES NOT automatically defragment all files; its auto-defragmenting only works on files smaller than 20MB (VM files are much larger than that), and even then it doesn't to a really great job. It also makes no attempt to keep free space unfragmented, which is what's really important here.

You might want to check out ShowVolumeFragmentation. It'll give you a useful report. Again, I honestly don't think fragmentation is the issue here, but it never hurts to know what's what.

Exactly when and where are you noticing major slowdowns?
 
Mikuro,

Defragmentation is not just a problem just because it has a name. It cannot be emphasized enough that file fragmentation is the most efficient way to store files on a hard drive. As an almost exclusive Mac user for years, I was never able to measure the benefits of defragmenting my hard drive. When I took a new position, I accepted the responsibility for my secretary's Mac. She had used it for years with no maintenance at all. I gave it the complete workover including defragmenting the hard drive. Benchmarking the freshly defragmented hard drive showed no measurable performance improvement. I had become convinced that defragmentation was just one of those things people did. And then I took charge of a Windows machine. Even though it received more frequent maintenance than my secretary's old Mac, it made me understand why Windows users fixate on file fragmentation. The performance improvement caused by defragging the Windows (FAT32) hard drive was nothing less than astounding.

Takeaway message: If you are experiencing a slowdown on Windows, file defragmentation is one of the first things that you try. If you are experiencing a slowdown on a Mac, file defragmentation is among the very least of your concerns.
 
Gotta agree with MisterMe here -- in certain cases on a Macintosh running Mac OS X, defragmenting the drive can actually degrade performance.

Due to adaptive hot-file clustering, Mac OS X is going to put files and pieces of files where it believes it can access them the best (read: fastest). By defragmenting the drive, you're undoing all the work that Mac OS X put into its filesystem. Sure, your drive may look all nice and pretty on a multi-colored fragmentation graph, but nice and pretty does not equal better performance.

Short answer: Mac OS X puts files on the drive where it wants the files to be. By defragmenting your drive, you are forcing Mac OS X to once again go back and move the files to where it wants them to be again: you're working against the system. Sure, go ahead and defragment your drive, but don't be surprised when, only a day or two later, your drive is back to being fragmented again due to Mac OS X moving the files around (and rightfully so).
 
it's like someone else tidying your room/office. just because it looks tidy, doesn't mean you can find anything any more.
 
MisterMe said:
Mikuro,

Takeaway message: If you are experiencing a slowdown on Windows, file defragmentation is one of the first things that you try. If you are experiencing a slowdown on a Mac, file defragmentation is among the very least of your concerns.
I won't disagree with what you've said, but I'm not harping about a mythical problem just because it's frequently called a problem! My own personal experience has shown very noticeable effects of fragmentation. I consider it something that's definitely worth keeping in mind.

Part of the reason is because I do a fair amount of video work. Large files that go in and out frequently build up fragmentation in a hurry. For a time, my boot partition had very, very little free space. Not enough for VM. But even after deleting a ton of stuff, the free space on my boot partition was still fragmented. That meant that all new VM files had to be fragmented. NOT GOOD. I could hear my disk thrashing about all the time as I switched apps. It killed performance like nothing else. Defragmenting solved this problem.

These days, I rarely defragment my boot partition, because I excercise sufficient caution in the way I use it. I never use my boot partition for video anymore. I try to keep it as static as possible, using other partitions for things that go in and out a lot. This cuts down on 90+% of the problem of fragmentation. That's enough so that I don't worry about it anymore.

However, I still defragment my other partitions about once every month or two. I really need to. If I don't, it will get to the point where I can't even play videos at full speed, because the fragmentation makes it impossible for the file to be read fast enough. Ugh.

I've never seen anything hurt performance anywhere near as much as file fragmentation. This is coming from someone who's been using Macs exclusively since System 7. Actually, fragmentation was a smaller problem before OS X, since you could just turn of VM, and even if you did have it on, it wasn't dynamic, so it wasn't at risk of being fragmented (unless you turned it on when your disk was already fragmented). A big reason fragmentation is such a problem in Windows is because it handles VM relatively poorly.

And of course, the problem of VM fragmentation sharply decreases as you add more RAM to your system. When I only had 256MB, disk speed was my top concern. With 1GB, it's not nearly as big a deal.


The bottom line is, you shouldn't generalize. The effects of fragmentation vary greatly based on the setup of the machine (hardware and software), the habits of the user, and the kind of work being done. Your setup and work habits clearly don't promote the problem, but mine and many others' do, and it takes a good deal of conscious effort to keep the problem at bay. All we know about the last user of the system is that he was a graphic designer. Graphic design really DOES promote the problem, so even with 70+GB of free space, it is quite possible that there is horrible fragmentation. And with 512MB of RAM, which is only the practical minimum these days, that could cause serious a performance hit.


Again, more details about when and where the slowdown occurs are needed to properly diagnose it.


Edit: I see some other people posted while I was typing. Modern defragmenting programs are smart about the hotband, so that's not really an issue anymore. I actually don't user defragmenters, though (they have not earned my confidence). I just back up, reinitialize, and restore. This does not respect the hotband, but even so, it offers a definite improvement. For some people it might create a slight short-term performance hit. For others it will offer a huge long-term gain. Again, it depends greatly on habits and setup, so generalizing is bad. ShowVolumeFragmentation is a very useful tool for determining if defragmenting is worthwhile.
 
Quick Question: If I have my HD partitioned into 4 pieces, are they all getting taken care of? Or does only the HD with the OS on it get the special defrag/prebind treatment automatically?
 
As long as they're all journaled HFS+ volumes, you're covered. You can enable journaling on drives using Disk Utility. Journaling is generally a good idea.
 
RichardFinlay,

Another possibility is that something is hogging an inordinate chunk of CPU time. Have you looked at Activity Monitor yet? It's located in /Applications/Utilities. Activity Monitor shows running processes (programs) and various other system info.

You can sort running processes by their CPU usage by clicking on "CPU", the title of one of the columns.

** Look for processes taking up huge amounts of processor time. **

Doug
 
O.K. so defragmenting may not be a huge problem with OS X, but what if you really do want to defragment (for one reasonn or another)? Do you need software like Norton Utilities or is there something that can be used that's already on the Mac hard drive?
 
sonoraquest said:
O.K. so defragmenting may not be a huge problem with OS X, but what if you really do want to defragment (for one reasonn or another)? Do you need software like Norton Utilities or is there something that can be used that's already on the Mac hard drive?
You'll need a third-party program. Do NOT use Norton, though. It was never optimized for OS X. There are more X-savvy defragmenters out there, like iDefrag and I think TechTool 4.

But as I've said in previous posts, I don't use defragmenters. The one time I tried iDefrag, it destroyed my entire disk (after working at it for 12 hours!). So these days, I just back up my data, reinitialize my volume, and then drag my files back. It doesn't give me full defragmentation, but it's close enough, and it's safe.
 
Besides, unless you're an audio/video editor (like Mikuro may be), there is no need to defrag. You say "one reason or another" -- what reasons, exactly, are those? You can actually degrade the performance of your OS X drive by defragmenting it.

Please state what "one reason or another" is, and we'll help you decide if it's a valid reason to defragment. I can say right off, though, that if you're a casual OS X user that does a little Photoshopping, web surfing, emailing and small-time music/video making, then there really isn't a need to defrag. Just keep an ample amount of space free on your drive (~15% - 20% of the total size of the drive) and let OS X take care of the rest.
 
Did you apply the latest software updates ?

Did you run the permission correction ?
 
Did you do a fresh install of Mac OS X when you got this machine from the previous owner? This would have been the first thing I did if I got a used mac: Erase, reformat, erase free space, and install a fresh copy of 10.4.
 
Back
Top