PDA

View Full Version : Defragmenting macs




mcguin2000
Jul 5, 2006, 03:33 PM
Just wondering, you sometimes have to use that defragmentation program in windows on a PC. Is the a Mac equivalent or don't they need it?



Makosuke
Jul 5, 2006, 03:35 PM
Defragmentation of smallish (under 20MB) files is handled automatically by the OS in the background, and in my personal experience, the modern MacOS is somewhat more resistant to fragmentation than Windows, so for most people (particulalry if you have a good chunk of your drive free) it's just not an issue.

But, in the event you frequently work with large files (say, a lot of video scratch files), then you could buy a 3rd party utility to defragment. To be honest, I haven't used one in years (nor needed to), but they do exist.

mcguin2000
Jul 5, 2006, 03:36 PM
Thanks, very helpful. Looks like I don't need to bother.

WildCowboy
Jul 5, 2006, 03:38 PM
FYI, here (http://docs.info.apple.com/article.html?artnum=25668) is the official Apple document on it.

WillMak
Jul 5, 2006, 03:43 PM
Haven't needed to defrag ever since I've switched. I love it! Haven't needed to constantly virus updates or do adware scans either! I love apple!

evangelion-01
Jul 6, 2006, 11:45 PM
Wow, this is a nice feature :)

bousozoku
Jul 7, 2006, 12:18 AM
Defragmentation of smallish (under 20MB) files is handled automatically by the OS in the background, and in my personal experience, the modern MacOS is somewhat more resistant to fragmentation than Windows, so for most people (particulalry if you have a good chunk of your drive free) it's just not an issue.

But, in the event you frequently work with large files (say, a lot of video scratch files), then you could buy a 3rd party utility to defragment. To be honest, I haven't used one in years (nor needed to), but they do exist.

Early Mac OS (1985) was more resistant than Windows is now.

I've got 3rd party utilities and the wait while defragmenting isn't worth the speedup or the danger of a power outage.

yadmonkey
Jul 10, 2006, 11:12 PM
Defragmentation of smallish (under 20MB) files is handled automatically by the OS in the background, and in my personal experience, the modern MacOS is somewhat more resistant to fragmentation than Windows, so for most people (particulalry if you have a good chunk of your drive free) it's just not an issue.

I'm not so sure about that automatic defragging. I've had clients with severely fragmented hard drives which consisted mostly of smaller, yet significant files, like photos and iTunes libraries. I've seen 40 GB hard drives with 8 GB free space and not a significant chunk of that free space contiguous.

That said, I don't recommend defragging to most people, as there are all sorts of problems which can occur, but if you do choose to use a utility, make sure your hard drive is in good shape first - no bad blocks, clean directory, no errors in the file system. Too risky otherwise.

I think the best means to defrag is by cleaning up your disk, copying it to a second drive or disk image and then cloning it back to the original drive. Again, making sure the drive is healthy first - Disk Warrior is a good cleaner for the directory. For a significantly fragmented drive, this can be much quicker and safer than using a utility, since you're creating a backup in the process.

wmmk
Jul 10, 2006, 11:24 PM
Early Mac OS (1985) was more resistant than Windows is now.

I've got 3rd party utilities and the wait while defragmenting isn't worth the speedup or the danger of a power outage.
hmmmm.....
didn't know that defragging causes power outages!:confused:

Killyp
Jul 11, 2006, 12:37 AM
No, what bousozoku means is that if there's a power shortage half way through Windows defragging, or you pull the plug on the computer, it will corrupt the hard disk.

We once had some work going on at our house (we have this quite often, but this was a while ago so I'll talk asthough it's very rare) and I decided (cleverly) to defrag my PC while the work was going on. Being a musician and wanting to work on all my music, I went ahead and started defragging. It got about 75% there, and then the workmen tripped a fuse. Obviously the computer went dead, but this was no problem. However, when I started it back up, it couldn't get into Windows. To cut a long story short, I lost everything on the computer!!!!!!

Now with Macs.... it's a bit different!

bousozoku
Jul 11, 2006, 01:12 AM
No, what bousozoku means is that if there's a power shortage half way through Windows defragging, or you pull the plug on the computer, it will corrupt the hard disk.

We once had some work going on at our house (we have this quite often, but this was a while ago so I'll talk asthough it's very rare) and I decided (cleverly) to defrag my PC while the work was going on. Being a musician and wanting to work on all my music, I went ahead and started defragging. It got about 75% there, and then the workmen tripped a fuse. Obviously the computer went dead, but this was no problem. However, when I started it back up, it couldn't get into Windows. To cut a long story short, I lost everything on the computer!!!!!!

Now with Macs.... it's a bit different!

Yes, you lose everything on Macs, too. That's extremely different. I've had luck with it and recovered a volume but lost a number of files.

Depending on where it is in the process, it's more critical that the power stay on with the Mac because of the more sophisticated directory structure. FAT is reasonably simple to reconstruct.

MisterMe
Jul 11, 2006, 08:51 AM
I'm not so sure about that automatic defragging. ...When in doubt, accept Apple's word. Afterall, it made the computers.
... Disk Warrior is a good cleaner for the directory. ....Disk Warrior does not clean directories, it repairs them.

wmmk
Jul 11, 2006, 09:58 AM
No, what bousozoku means is that if there's a power shortage half way through Windows defragging, or you pull the plug on the computer, it will corrupt the hard disk.

We once had some work going on at our house (we have this quite often, but this was a while ago so I'll talk asthough it's very rare) and I decided (cleverly) to defrag my PC while the work was going on. Being a musician and wanting to work on all my music, I went ahead and started defragging. It got about 75% there, and then the workmen tripped a fuse. Obviously the computer went dead, but this was no problem. However, when I started it back up, it couldn't get into Windows. To cut a long story short, I lost everything on the computer!!!!!!

Now with Macs.... it's a bit different!
Yikes. I defragged my PC a lot back in the days before I had a nice UPS. Good thing I never lost data from that!

howesey
Jul 11, 2006, 10:09 AM
You will not loose data even if the power goes. Most, if not all apps copy the data, once it has been copied and verified, it deletes the old data.

How often do you get a power outage, every 3, 4, 5 or more years?

If you do loose data, it can be recovered and fixed. You do not loose all your data. Oh no, you did manage to loose data, however you may have lost a chunk that stores two fonts, not the end of the world is it?

I'd love to work out the odds of while defragmenting, having a power cut and then loosing some data. It may have more odds of myself winning the lottery and then getting run over by a rhino.

bousozoku
Jul 11, 2006, 10:37 AM
You will not loose data even if the power goes. Most, if not all apps copy the data, once it has been copied and verified, it deletes the old data.

How often do you get a power outage, every 3, 4, 5 or more years?

If you do loose data, it can be recovered and fixed. You do not loose all your data. Oh no, you did manage to loose data, however you may have lost a chunk that stores two fonts, not the end of the world is it?

I'd love to work out the odds of while defragmenting, having a power cut and then loosing some data. It may have more odds of myself winning the lottery and then getting run over by a rhino.

Are you sure about any of that?

Here in Central Floriduh, the power interruptions are quite frequent every day because of a cheap power grid that hasn't been upgraded properly, which is now serving millions more than originally intended. It's also been patched after various hurricanes.

It's one thing to have the power go out when it's writing the data to a few files. It's another thing when it's working on the catalog/directory structure. Suddenly, the data, while still there, is completely unknown and unattached and can't be recovered unless the catalog can be recovered.

With the FAT system, it's so brainless that it's easy to protect. It's also for that reason that it should be de-fragmented weekly on a busy system. Mac HFS and HFS+ use binary trees to speed up file lookup and that resists a slowdown when the drive becomes very cluttered.

So, it's not as clear as you apparently think it is.

Eraserhead
Jul 11, 2006, 11:00 AM
Defragmentation of smallish (under 20MB) files is handled automatically by the OS in the background, and in my personal experience, the modern MacOS is somewhat more resistant to fragmentation than Windows, so for most people (particulalry if you have a good chunk of your drive free) it's just not an issue.

But, in the event you frequently work with large files (say, a lot of video scratch files), then you could buy a 3rd party utility to defragment. To be honest, I haven't used one in years (nor needed to), but they do exist.
But they are a total waste of money, if you need to run them (eg because you free space is all fragmented) it is quicker to backup your data, reformat and reinstall the OS X. Especially as OS X doesn't require your to reinstall your applications afterwards (you can just copy them back) it's relitavely painless...

sushi
Jul 11, 2006, 11:14 AM
if you need to run them (eg because you free space is all fragmented) it is quicker to backup your data, reformat and reinstall the OS X. Especially as OS X doesn't require your to reinstall your applications afterwards (you can just copy them back) it's relitavely painless...
Even better...try using CCC.

Eraserhead
Jul 11, 2006, 12:05 PM
Even better...try using CCC.
Nice tip, CCC (http://www.bombich.com/software/ccc.html) is only $5 too!

SuperDuper! (http://www.shirt-pocket.com/SuperDuper/SuperDuperDescription.html) looks pretty good too. (but its $27 for some extra advanced features)

Makosuke
Jul 11, 2006, 03:07 PM
How often do you get a power outage, every 3, 4, 5 or more years?Must be nice to live places like New York where a 4-hour blackout makes the national news, and you think power outages only occurr every few years.

My power was out for THREE DAYS after a storm this January, and it was a week before my parents house a few miles away got power. Then there was a two week blackout about eight years ago. And it isn't just storms--ignoring the occasional rolling blackout during the summer, the power flicks out for no reason whatsoever several times a year when somebody at PG&E falls asleep on a switch or something.

Not saying that there's a high chance of the grid going down while defragging, and I have a UPS personally, but it's not a "once in a blue moon" sort of thing, and there are those with far worse power grids than I have.

yadmonkey
Jul 11, 2006, 08:01 PM
Nice tip, CCC (http://www.bombich.com/software/ccc.html) is only $5 too!

SuperDuper! (http://www.shirt-pocket.com/SuperDuper/SuperDuperDescription.html) looks pretty good too. (but its $27 for some extra advanced features)

SuperDuper is great and copies metadata which CCC misses - specifically the creation date and maybe something else.

yadmonkey
Jul 11, 2006, 08:11 PM
When in doubt, accept Apple's word. Afterall, it made the computers.

Are you being sarcastic? OS X does not defrag in the background, contrary to popular myth. Read the official Apple article (http://docs.info.apple.com/article.html?artnum=25668). They don't claim anything about automatic defragging, keeping in mind that "Hot-File-Adaptive-Clustering" doesn't apply to files which don't "grow". They caution against it, which I think is wise on their part.

Disk Warrior does not clean directories, it repairs them.

Not sure why you're getting into semantics. No, it does not clean a directory. Yes, it repairs them when possible. However, I fail to see why using the word clean warranted correction.

WildCowboy
Jul 11, 2006, 08:21 PM
Are you being sarcastic? OS X does not defrag in the background, contrary to popular myth. Read the official Apple article (http://docs.info.apple.com/article.html?artnum=25668). They don't claim anything about automatic defragging, keeping in mind that "Hot-File-Adaptive-Clustering" doesn't apply to files which don't "grow". They caution against it, which I think is wise on their part.

Apple seems to say (http://developer.apple.com/technotes/tn/tn1150.html) otherwise.

Most files on a disk are rarely, if ever, accessed. Most frequently accessed (hot) files are small. To improve performance of these small, frequently access files, they are moved near the volume's metadata, into the metadata zone. This reduces seek times for most accesses. As files are moved into the metadata zone, they are also defragmented (allocated in a single extent), which further improves performance. This process is known as adaptive hot file clustering.

yadmonkey
Jul 11, 2006, 08:32 PM
Right, but this still isn't the same as "defragging in the background". This hot-adaptive thingy happens when you access files and won't defrag fragmented files which aren't being accessed.

Regardless, my only and original point was that it is not always sufficient. I've seen plenty of severely fragmented drives running OS X with as much as 20% free disk space.

Val-kyrie
Jul 11, 2006, 09:08 PM
I'm not so sure about that automatic defragging. I've had clients with severely fragmented hard drives which consisted mostly of smaller, yet significant files, like photos and iTunes libraries. I've seen 40 GB hard drives with 8 GB free space and not a significant chunk of that free space contiguous.

That said, I don't recommend defragging to most people, as there are all sorts of problems which can occur, but if you do choose to use a utility, make sure your hard drive is in good shape first - no bad blocks, clean directory, no errors in the file system. Too risky otherwise.

I think the best means to defrag is by cleaning up your disk, copying it to a second drive or disk image and then cloning it back to the original drive. Again, making sure the drive is healthy first - Disk Warrior is a good cleaner for the directory. For a significantly fragmented drive, this can be much quicker and safer than using a utility, since you're creating a backup in the process.

Won't cloning and restoring a fragmented drive result in a fragmented drive? Or perhaps I don't understand what you mean by "cleaning up your disk." By "clean," do you mean "defrag"?

Makosuke
Jul 11, 2006, 09:27 PM
Won't cloning and restoring a fragmented drive result in a fragmented drive? Or perhaps I don't understand what you mean by "cleaning up your disk." By "clean," do you mean "defrag"?No. The clone operation copies the files one at a time, which in turn defragments them if the destination drive is empty to start with. Cloning back and forth has always been the most "surefire" way of defragging a drive (though it technically doesn't allow you to put the most heavily accessed files in the fastest portion of the disk... but as said, if they're small, the MacOS does that for you anyway). It's also a moderate hassle, and if you're cloning a boot partition, it can cause annoyances when you have to reset a couple of things depending on how you clone.

That is, however, why I keep most of my "heavy use" data on a seperate partition from my OS--that way when I repeatedly create and delete huge scratch files, if I'm fragmenting the drive at least it's not my OS partition so it won't affect the speed of anything but those files. Also makes bootable backup clones easier, since there isn't as much data to clone.

yadmonkey
Jul 11, 2006, 09:41 PM
Won't cloning and restoring a fragmented drive result in a fragmented drive? Or perhaps I don't understand what you mean by "cleaning up your disk." By "clean," do you mean "defrag"?

I guess I left that a little vague on purpose because the point of my post wasn't to encourage defragging, but to say that Apple's "background defragging" isn't what many people think it is. But since you asked, here's what I do in the rare cases when I want to defrag a drive...

1. Update your backup.
2. Use Disk Utility to check for errors. This usually comes up clean, but not always.
3. Use Disk Warrior to check the directory for errors and repair any it finds. This is the most important part, IMO. A disk with directory errors could potentially run into trouble during a defrag. Once DW gives you a clean directory, you are much less likely to run into trouble from a defrag, unless your house is prone to power outages.
4. Use TTP or another utility to scan the drive for bad blocks. This is optional, but I like to do this once in a blue moon, which is about how often a defrag should be necessary.
5. Use SuperDuper to clone your drive to another drive and copy it back. Cloning in this way doesn't make a bit-by-bit copy... rather it reads a fragmented files and writes them in order. Your drive should have almost zero fragmentation and it can take a fraction of the time a defragger would take.

Val-kyrie
Jul 11, 2006, 09:57 PM
I guess I left that a little vague on purpose because the point of my post wasn't to encourage defragging, but to say that Apple's "background defragging" isn't what many people think it is. But since you asked, here's what I do in the rare cases when I want to defrag a drive...

1. Update your backup.
2. Use Disk Utility to check for errors. This usually comes up clean, but not always.
3. Use Disk Warrior to check the directory for errors and repair any it finds. This is the most important part, IMO. A disk with directory errors could potentially run into trouble during a defrag. Once DW gives you a clean directory, you are much less likely to run into trouble from a defrag, unless your house is prone to power outages.
4. Use TTP or another utility to scan the drive for bad blocks. This is optional, but I like to do this once in a blue moon, which is about how often a defrag should be necessary.
5. Use SuperDuper to clone your drive to another drive and copy it back. Cloning in this way doesn't make a bit-by-bit copy... rather it reads a fragmented files and writes them in order. Your drive should have almost zero fragmentation and it can take a fraction of the time a defragger would take.


Thanks for the clarification Makosuke and Yadmonkey. Most of my experience in cloning is with Acronis True Image 9 for Windows. If the hard drive is fragmented when the cloning starts, the new HDD is also fragged. This doesn't speak well of ATI's cloning utility in my opinion.

MisterMe
Jul 11, 2006, 11:11 PM
....

Not sure why you're getting into semantics. No, it does not clean a directory. Yes, it repairs them when possible. However, I fail to see why using the word clean warranted correction.Generally, clean and repair have fundamentally different meaning. In the case of a directory, the term clean refers to the process of removing extraneous and unwanted files. You can clean a perfectly robust directory. The term repair generally means to fix corrupted pointers. DiskWarrior uses this process to recover files that you want to keep.

In summary: to clean means to remove unwanted files; to repair is the strategy used by DiskWarrior to recover wanted files.

yadmonkey
Jul 12, 2006, 01:22 AM
Well since you've gone the extra mile to correct something which didn't really need correcting, let's get technical... we're both wrong according to the Diskwarrior website (http://alsoft.com/DiskWarrior/index.html)

DiskWarrior is not a disk repair program in the conventional sense. Instead of patching the original directory, it uses a patent-pending technology to quickly build a new replacement directory using data recovered from the original directory, thereby recovering files and folders that you thought were lost and that no other program could recover.

Diskwarrior doesn't repair or clean - it rebuilds. However, I'm perfectly comfortable calling the new directory a clean directory - something which is desirable if you are going to use any method of defragmenting a drive. I'm crazy like that.