I think so

" />



Is Disk Defragmenting Worth The Trouble?

14810 Like disk partitioning, disk defragmenting is a topic of heated controversy. Some folks swear it speeds things up significantly. Others, including the official policy from Apple for OS X, dismiss it as unnecessary - basically a somewhat risky waste of time for most users.

image


Apple has posted a Knowledge Base article on Disk Optimization And Fragmentation With Mac OS X, which is worth a read before making any defragging decisions. The article says, in part:

"Files can become 'fragmented' over time as they are changed and saved and as the volume is filled, with different parts of a single file stored in different locations on a volume. The process of collecting file fragments and putting them 'back together' is known as optimization. However, if a failure occurs during optimization, such as power loss, files could become damaged and need to be restored from a backup copy....

You probably won't need to optimize at all if you use Mac OS X. Here's why:

• Hard disk capacity is generally much greater now than a few years ago. With more free space available, the file system doesn't need to fill up every "nook and cranny." Mac OS Extended formatting (HFS Plus) avoids reusing space from deleted files as much as possible, to avoid prematurely filling small areas of recently-freed space.

• Mac OS X 10.2 and later includes delayed allocation for Mac OS X Extended-formatted volumes. This allows a number of small allocations to be combined into a single large allocation in one area of the disk.

• Fragmentation was often caused by continually appending data to existing files, especially with resource forks. With faster hard drives and better caching, as well as the new application packaging format, many applications simply rewrite the entire file each time. Mac OS X 10.3 Panther can also automatically defragment such slow-growing files. This process is sometimes known as "Hot-File-Adaptive-Clustering."

• Aggressive read-ahead and write-behind caching means that minor fragmentation has less effect on perceived system performance.

For these reasons, there is little benefit to defragmenting.

Mac OS X systems use hundreds of thousands of small files, many of which are rarely accessed. Optimizing them can be a major effort for very little practical gain. There is also a chance that one of the files placed in the 'hot band' for rapid reads during system startup might be moved during defragmentation, which would decrease performance.

If your disks are almost full, and you often modify or create large files (such as editing video....), there's a chance the disks could be fragmented. In this case, you might benefit from defragmentation, which can be performed with some third-party disk utilities.


So sayeth Apple.

I beg to differ somewhat.

As noted, adding and deleting files to and from your hard drive will gradually cause the drive to become more and more fragmented. When the OS writes files to the drive, it will look for empty spaces on the hard drive to write data to. If the space is too small to fit the file, it will write part of the data in one area and the remaining to another area. This way less overall disk space is wasted, but drive access will slow down, as the read/write head has to scan multiple parts of the drive to locate and read a file. The more you use your your drive, the more fragmented the data on it will become. Consequently, defragmenting your hard drive from time to time can boost the performance of your computer by putting all of these broken-up pieces into one continuous block with all of the empty space at the end.

Also, while HFS+ is very good at keeping small to medium sized files from getting fragmented, but reportedly less efficient at keeping large files or free space from fragmenting, which is of particular interest to mac-users because the virtual memory swapfile must be contiguous on the disk, so you can actually run out of virtual memory long before you run out of disk space if your free space is fragmented.

For more discussion of defragmentation issues with OS X, see the links in the Appendix below.

Personally, I have been frustrated by the leisurely performance of my Pismo PowerBook since installing OS X 10.4 Tiger last spring. I did an archive and install, which gave me a fresh system, but left the existing 10.3.8 system on the partition until I deleted it. This meant that the Tiger installer had to work around the old system to find space to put the new one, resulting in what I suspected was less than ideal disk optimization.

Recently, I decided to see if I couldn't improve things. First I ran AlSoft Disk Warrior 3 to repair any directory damage (there was some) and replace the old directory with a fresh, new one. I then booted from the ProSoft Drive Genius 1.5.5 CD in order to use the Drive Genius defragmentation module. Because the bare-bones version of OS X on the CD doesn't support screen captures, I couldn't to any screen shots of the fragmentation report, but there was stuff scattered all over the partition in non-contiguous clumps, with a lot of empty space at the top of the partition, presumably vacated by the deleted former system installation.. I figured that a defrag was indeed in order.

The defrag process goes as follows.

The user interface window shows the fragmentation of the volume:
• The yellow portion represents the data has already been defragmented.
• The lavender portion represents file that hasn’t been moved yet.
• The black portion represents the free space.

Here's what the fragmentation map of the 11 GB main partition on my iBook's 20 GB hard drive looked like when I defragged it last spring (in which case I was running Drive Genius while booted from an external FireWire drive and thus could take screenshots). You can read more about that project here:
http://www.macopinion.com/columns/roadwarrior/05/06/07/




Drive Genius gives you a running readout of what is happening as the defragmentation proceeds. Be forewarned that it's not a quick process, especially on an OS X boot volume with all those tens of thousands of tiny files.




In this case on a 78% full 25 GB partition defragmentation took about six hours. I expect that it might go more quickly and on a machine with a faster processor and/or hard drive (mine is a 40 GB, 5400 RPM Toshiba). The process is happy to run in the background, and you can continue working with the computer and even go online if you wish

Here's a finished defrag job (on the iBook):




Worth the effort? You Bet! When I booted back into Tiger from the Pismo's hard drive I was literally astonished at how fast it started up. I'm convinced, and delighted with the more lively performance out of Tiger on the old PowerBook.

Your mileage, as they say, may vary, depending upon how badly your disk data is fragmented. Also, at times my OS X partition on the Pismo has been 80 percent or more filled, a condition that exascerbates defragmentation.

If you do decide to defrag, as always with a major (and in this case somewhat risky of data loss) operation, make sure your data is securely backed-up before proceeding.


***




Appendix:

For more discussion on OS X disk defragmentation, see:

http://www.macattorney.com/ts.html (includes lots of links)

http://www.macosxhints.com/pollbooth.php?qid=defrag&aid=-1

http://8help.osu.edu/1563.html

And at macFixIt Forums here.

___


Another Defrag Solution

Another solution for disk defragmenting that I haven't tried, but which looks promising, is iDefrag 1.1.3 � Defragmentation & Optimization for Mac OS X, which is $30.00 demoware.

image


More info available here:
http://www.coriolis-systems.com/iDefrag-2.php



Charles W. Moore



Tags: Hot Topics ï News ï MooresViews ï

Login † or † Register † †

I have to agree with Apple about defraging, but I am glad to follow your recommendation on Disk Warrior which I just ordered an updated Bootable CD-ROM for as well as repairing permissions which I will be doing much more often now that there appears to be somebody who is writing exploits for Mac OS X security holes. I still don’t recommend people buying anti-virus software, but rather update to the latest security updates as this is a more proactive and effective approach as this prevents one from getting infected in the first place a risking losing data. Anti-virus products are just a stop gap measure and definitely not a solution to the underlying security problem only necessary where there is no security at all and thousands of different huge holes as with that other frequently used OS made by Microsoft. Linux also technically has viruses too but how many desktop computers actually get infected - maybe a couple people out of hundreds of thousands of desktops and those are unpatched and several years since they were supported.

Why use a defrag routine in the first place?  I find a more elegant and time effecient solution by using SuperDuper! by Shirt Pocket.  When SuperDuper! clones an “All Files” bootable backup of your OSX Panther or Tiger main HDD, it uses a sequential file approach during the copy routine, therefore defragging the destination HDD in the process.

An “All Files” reverse clone from the backup HDD as the source to the main HDD as a destination, then defrags the main HDD.  I do this once a month and my PowerMac system performance is always like a fresh new install of OSX and all my Applications.  The SuperDuper! copy run time is far superior to any defrag routine I have ever used, plus if you get a power outage during the process, the source HDD is still pristine and a new destination HDD clone or copy can be quickly made.

Yes, it takes two HDD’s to take advantage of SuperDuper!, but with the low cost of today’s HDD’s, it is a very affordable solution.  The 2nd HDD can be internal or external, using USB or Firewire connects.  On my systems, I have two internal HDD’s for OSX and two external Firewire HDD’s, to manage large music and photo content.

I also use a SuperDuper! Safety Clone partition to install all OSX updates for testing.  If there are problems, my path back is a simple reboot back to the Master OSX HDD.  I use SuperDuper! to successfuly maintain several Mac systems across the country, running both Tiger and Panther OSX.  SuperDuper! has run error free since early 2004 and is the best system software investment I have made in over 25 years as a Mac user.  Check out SuperDuper! you won’t be disappointed.

Yep, regardless of what Apple or anyone else says, a defragged drive (if it was significantly fragmented prior to the defrag) can run noticeably faster.  But some defragged drives can also run not so noticeably faster--you won’t know until you try it.  And, if you use a defrag utility, you run the risk of problems during the defrag.

As cspheres says, not much beats backing up your drive, erasing it, and doing a file copy of the data back to the source drive--don’t do a block copy back to the source, unless the backup was done using a file copy method--otherwise, the drive will still be fragmented, since a block copy will place all the blocks on the destination drive in the same fragmented locations as the source drive.  SuperDuper is a good choice for a file-level copier.

Hi John;

Agreed on pretty much all points. I’m not a routine drive defragger, but I have realized significant performance improvements from defragging drives that had a lot of activity on them.

I haven’t used Super Duper, but it certainly gets glowing reviews from thise who have.

Charles

Charles:

I’ve seen good speed improvement from some defragged drives too, but one thing I forgot to mention: a backup, erase, and restore also takes a lot less time than a defrag util.  Less time for something to go wrong, like a power outage (we should all have uninterruptible power supplies to plug our computers into, during these operations), cat on the keyboard, etc.

But there have been a few times when I haven’t had a backup drive with enough free space to hold the source drive, but I still needed to defrag a drive, at least somewhat, so that a util like Diskwarrior could write a contiguous replacement directory to the drive--this happened to me last night.  I started Drive Genius’s defrag option, but then decided taking another approach that has sometimes worked for me before: copy as much of the source drive as you have free space available on your backup drive (preferably at least a few gigabytes), then trash those files from the source, then run Diskwarrior--it often (or usually) then finds enough contiguous free space to create a new, contiguous replacement directory.  Then copy the files back to the drive.

Re: Is Disk Defragmenting Worth The Trouble?

From John

Charles:

I’ve seen good speed improvement from some defragged drives too, but one thing I forgot to mention: a backup, erase, and restore also takes a lot less time than a defrag util.  Less time for something to go wrong, like a power outage (we should all have uninterruptible power supplies to plug our computers into, during these operations), cat on the keyboard, etc.

But there have been a few times when I haven’t had a backup drive with enough free space to hold the source drive, but I still needed to defrag a drive, at least somewhat, so that a util like Diskwarrior could write a contiguous replacement directory to the drive--this happened to me last night.  I started Drive Genius’s defrag option, but then decided taking another approach that has sometimes worked for me before: copy as much of the source drive as you have free space available on your backup drive (preferably at least a few gigabytes), then trash those files from the source, then run Diskwarrior - it often (or usually) then finds enough contiguous free space to create a new, contiguous replacement directory.  Then copy the files back to the drive.

Hi John;

You’re probably right about the time thing. With defrag. runs I usually just set it up and leave for a while to do something else.

I must get around to experimenting a bit with SuperDuper.

I love DiskWarrior, and the latest edition of Drive Genius is on its way for a review.

The uninterruptible power/cat on KB issues do not loom large for me as I’m an all laptop shop and have no cat (currently at least). wink

Gotta love Time Machine, though. It’s sublimely low-effort for backups, although I haven’t had occasion to restore anything from it yet.

Charles

Follow Us

Twitter Facebook RSS! Buzz

Most Popular

iPod




iPhone

iLife

Reviews

Software Updates

Games

Hot Topics

Hosted by MacConnect - Macintosh Web Hosting and Mac Mini Colocation                                                    Contact | Advanced Search|