Skip to main content
PowerPC Mac Liberation Army

Defragging

Forum IndexMess Hall

What's the go with OSX and defragging? I read somewhere that it does it all automatically; but then there appear to still be defragging programs available for OSX.

Just wondering because the finder has started playing up recently on my machine, running very slowly, whereas before it was lightning fast. Wondering if it's fragged or something. Confused
If your OS X Mac is not 'always-on' it will pine for its Unix antecedents. That is, it will not do its wee-small-hours housekeeping. MacJanitor is a freeware script to allow you to do the daily, weekly and monthly chores at a time of your choosing.

http://homepage.mac.com/brianhill/macjanitor.html

de
_________________
(60x) 13DT + 3PB + PTPro; (G3) 7DT/MT; (G4) 3T + PB. System 8.1 to OS 10.5.8
Thank you, sir. So is OSX's own defragging sufficient, if you use this script so that it actually gets done?

Also, I ran TechTool yesterday and it told me I should reformat my whole hard drive because of one bad block! Is it really worth reformatting the whole thing just for that?
OSX's defragmenting is done on the fly every time a file under 20MB is opened. If it's fragmented, it'll be moved elsewhere on the drive so it's in a contiguous area. On top of that is a feature called adaptive hot file clustering - so that 'hot files' (or files that the filesystem detects to be frequently accessed) are moved together to a faster portion of the disk AND defragmented.

As long term file use changes depending on what you're doing, long term, files move in and out of the hot zone.

In total, that means files that can benefit from being defragmented get defragmented, small often-used files end up placed in an optimal position on the disk, and fragmentation is minimal - and only on files large enough for fragmentation to be no real issue.

The scripts that apps like MacJanitor will run for you are separate processes to the auto defragging, and do things like cleaning up temp files, rotating log files around, rebuilding the 'locate' and 'whatis' databases, etc.

If you want to see exactly what those are, the scripts themselves are:

/etc/daily
/etc/weekly
/etc/monthly

There are a couple of things OSX's inbuilt systems don't do - they won't defragment files that are larger than 20MB, and they won't optimise placement of files on disk except for hot files (the small frequently accessed ones). Most people say that's all a system needs, a few others will defragment regularly and claim it speeds their systems up every time.

As for bad blocks, that's something I'd keep an eye out for. If they seem to be growing, I'd not reformat the drive - I'd make a final backup and then burn it or something Smile

Dana
Thanks. Smile I'll try the MacJanitor thing. It's been doing some weird stuff. Takes forever to start up when it used to beat my SE/30 running system 6, the dock changes size sometimes, and today when I started up, the CPU fan did not start up with it!! Had to restart before it came on. I really don't know what's up with it; it's been totally on the fritz lately. Better than being on the Siegfried I suppose.
I don't even know how to take it apart. Better register that Applecare plan now I think. Razz
Thank you, sir. Now that you mention it, this behaviour started happening once I got under about 8 GB of space free. Which would be pretty close to 85% capacity. And no, I don't back up regularly, but then I hardly create enough documents for it to matter. I shall delete some stuff and try again.