Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Glassed Silver

macrumors 68020
Original poster
Mar 10, 2007
2,096
2,567
Kassel, Germany
Hey guys,

I've tried to get some best practices (/programs) for defragging my Mac, or more specifically, my El Cap partition (shared with a Bootcamp partition hosting Windows 7 and of course the usual recovery partition for OS X).

I've tried Drive Genius 3 once, but it caused problems. Well that or another event that occurred at the same time maybe.
To be frank, I don't really remember it too well, because right around that time my Mac failed anyways and I had to get my GPU replaced through Apple.
Maybe that's what I remember.

Anyhow, I'd love to hear what everyone considers to be a safe approach to defragging a Mac.
I know OS X does a better job at this than Windows, but I really think it's time to do this.

Glassed Silver:mac

PS: defragging can be either live or offline (booted from a stick or DVD) - guess offline is better as it can move files a live defrag can't. :)
PPS: no, I don't have an SSD, otherwise I wouldn't ask. :) Thank you for everyone who tried to stop me from unnecessarily wearing out a drive though. The least it's done is prevent a googler from doing this! :)
 
Last edited:

gnasher729

Suspended
Nov 25, 2005
17,980
5,566
The safe and recommended approach is to delete the defragging software.

As Les said: _Never_ on an SSD drive. With a HD drive, it isn't helpful. With an SSD drive, it will harm your drive.

And if your HD is full, defragmentation will take ages. Much better to replace the hard drive with a bigger one.
 
Last edited:

chscag

macrumors 601
Feb 17, 2008
4,622
1,946
Fort Worth, Texas
Most folks will tell you that defragging OS X is not necessary. And usually it isn't. It's only when you start to let your hard drive fill up that OS X will slow down considerably and that's when defragging may help. I purchased iDefrag a while back and have since updated it for El Capitan. It can do an off line defrag by booting from a flash drive. You can purchase a license for iDefrag for $39.95.
 
  • Like
Reactions: grahamperrin

mic j

macrumors 68030
Mar 15, 2012
2,669
156
Please save your time and money and move on from those "PC" days. There is no need to degrag a Mac drive.
 
  • Like
Reactions: chabig

maflynn

macrumors Haswell
May 3, 2009
73,682
43,740
Since most Macs now have SSDs, I'd say to avoid defraggers like the plague, they cause the SSD to incur excessive write cycles for no good reason.

OS X in general doesn't need to be defragged and performance with SSDs are such that you'll not likely see any improvements since there is no read/write had that has to move around to read the data blocks.
 

Weaselboy

Moderator
Staff member
Jan 23, 2005
34,489
16,217
California
Anyhow, I'd love to hear what everyone considers to be a safe approach to defragging a Mac.

As others mentioned, it is not needed on an SSD. But if you have a hard drive, I'd say things are less clear. If you often work with a lot of large files, then the drive can become fragmented since OS X built in defrag routine only works with file sizes smaller than 20MB. So you may benefit from defragmentation. I have seen several posts in here from forum members that saw real disk speed increases after defragmentation.

If you Google search "os x disk defragmentation", you can see some articles on this. I do see iDefrag mentioned a lot in the articles, but have no experience with it myself.
 

Glassed Silver

macrumors 68020
Original poster
Mar 10, 2007
2,096
2,567
Kassel, Germany
My Mac doesn't have an SSD and no, OS X on the fly defrag is not perfect.
Also, my OS X install is already in the first 6/10 of the drive, so the faster part, but it's still unbearably slow sometimes.
Why? Because my drive is almost always at 80-90% full, more leaning towards 90% most of the time, so especially when doing OS X updates and upgrades system files will fragment and not be placed in their best location on the disk fairly often.
OS X may defrag on the fly, but it can't do wonders whilst at the same time trying to install in a timely manner.

"PC days thinking"? If you understand how HDDs and fragmentation work and how OS X does NOT do a perfect job, how could it, you would know that yes, defragging is still needed in certain scenarios.

As others mentioned, it is not needed on an SSD. But if you have a hard drive, I'd say things are less clear. If you often work with a lot of large files, then the drive can become fragmented since OS X built in defrag routine only works with file sizes smaller than 20MB. So you may benefit from defragmentation. I have seen several posts in here from forum members that saw real disk speed increases after defragmentation.

If you Google search "os x disk defragmentation", you can see some articles on this. I do see iDefrag mentioned a lot in the articles, but have no experience with it myself.

Thanks. I've heard that Apple use Drive Genius themselves, so I thought I'd try that, but it's pretty costly and iDefrag sounds like a decent priced product.
I'll look into it!

[...]
And if your HD is full, defragmentation will take ages. Much better to replace the hard drive with a bigger one.

I'll eventually upgrade to an SSD for OS X and make my HDD Windows-only on this Mac, but that's still some time away and in the meantime I'd love to have a better performing Mac.
Thanks for 5400rpm, Apple. (and the cumbersome upgrade process... You're real champs! /s )

Glassed Silver:mac
 
  • Like
Reactions: grahamperrin

whg

macrumors regular
Aug 2, 2012
236
153
Switzerland
I'll eventually upgrade to an SSD for OS X and make my HDD Windows-only on this Mac, but that's still some time away and in the meantime I'd love to have a better performing Mac.
Thanks for 5400rpm, Apple. (and the cumbersome upgrade process... You're real champs! /s )

Glassed Silver:mac

I have an iMac 27" mid 2011. I recommend using something like this:
https://www.amazon.com/Transcend-512GB-Thunderbolt-StoreJet-TS512GSJM500/dp/B00NV9LSEE
The internal HD is the weakest part of non SSD iMacs; and Apple's SSDs are too expensive.
 

Glassed Silver

macrumors 68020
Original poster
Mar 10, 2007
2,096
2,567
Kassel, Germany
I have an iMac 27" mid 2011. I recommend using something like this:
https://www.amazon.com/Transcend-512GB-Thunderbolt-StoreJet-TS512GSJM500/dp/B00NV9LSEE
The internal HD is the weakest part of non SSD iMacs; and Apple's SSDs are too expensive.
Well, I'd rather not get a Thunderbolt solution and have YET ANOTHER DRIVE sitting on my desk hehe. :)

Thanks for the info that TB seems to be a reliable boot option though I guess?
I had been wondering about just that a year or so ago.

I'd rather really just mount it internally, even though I don't really fancy having to open a 2011er iMac, but I've worked on harder projects, so yeah.

Guess what I really don't want to see happen is the SSD breaking down and then having to redo the whole process twice (removal, sending it in for replacement, reinserting).

Are there any TB cases, just in case I change my mind again, that don't cost a lot?
I'd prefer to chose the SSD itself freely, independent from the enclosure.

Glassed Silver:mac
 

grahamperrin

macrumors 601
Jun 8, 2007
4,942
648
… _Never_ on an SSD drive. With a HD drive, it isn't helpful. …

What about a solid state, solid state hybrid or hard disk drive where the HFS Plus catalog file is in hundreds or thousands of fragments?

Postscripts

@Glassed Silver Do I need to defrag external hard drive?

From a Time Machine volume, in 2011 (not hundreds of fragments, but you get the idea):

Screen Shot 2011-04-14 at 09.33.32.png Screen Shot 2011-04-14 at 09.35.34.png

Also attached: a 2012 example of a startup volume with 36Gi free and a 1G swap file (swapfile8) in more than two thousand fragments. With compressed memory in more recent versions of the operating system, there's less likelihood of a use case requiring nine or more swap files but still, it's desirable to have reasonably good contiguous free spaces.
 

Attachments

  • 2012-06-25 10-45 swapfile8 in 2240 extents.txt
    149.5 KB · Views: 297
Last edited:

Dopeyman

macrumors 6502a
Sep 5, 2005
614
48
Los Angeles!
Hey guys,

I've tried to get some best practices (/programs) for defragging my Mac, or more specifically, my El Cap partition (shared with a Bootcamp partition hosting Windows 7 and of course the usual recovery partition for OS X).

I've tried Drive Genius 3 once, but it caused problems. Well that or another event that occurred at the same time maybe.
To be frank, I don't really remember it too well, because right around that time my Mac failed anyways and I had to get my GPU replaced through Apple.
Maybe that's what I remember.

Anyhow, I'd love to hear what everyone considers to be a safe approach to defragging a Mac.
I know OS X does a better job at this than Windows, but I really think it's time to do this.

Glassed Silver:mac

PS: defragging can be either live or offline (booted from a stick or DVD) - guess offline is better as it can move files a live defrag can't. :)
PPS: no, I don't have an SSD, otherwise I wouldn't ask. :) Thank you for everyone who tried to stop me from unnecessarily wearing out a drive though. The least it's done is prevent a googler from doing this! :)

Drive Genius 3.2.5 is my personal preference to defrag my drive. I have a small 20GB hard drive in an external case with just the OS and DG on it. I use that to boot and to defrag my main drive. Defragging offline is much better (just like you said).
 

gnasher729

Suspended
Nov 25, 2005
17,980
5,566
What about a solid state, solid state hybrid or hard disk drive where the HFS Plus catalog file is in hundreds or thousands of fragments?
An SSD drive doesn't care about fragments. It _does_ care about tons of tiny files being moved around and doesn't like it at all.

And your HFS Plus catalog file isn't read sequentially, it's read like a database. Piece by piece. And it gets cached in RAM.
 

Glassed Silver

macrumors 68020
Original poster
Mar 10, 2007
2,096
2,567
Kassel, Germany
Drive Genius 3.2.5 is my personal preference to defrag my drive. I have a small 20GB hard drive in an external case with just the OS and DG on it. I use that to boot and to defrag my main drive. Defragging offline is much better (just like you said).
Why 3.2.5 over 4.x?
Upgrade cost or anything beyond that?

I see I could get an older version for less and whilst I do suspect they didn't have to reinvent the wheel for newer versions of OS X they specifically do advertise usage of older versions for systems below Yosemite I think.

Maybe it's more about the binary running smoothly and a bootable stick or DVD is independent from that, but I don't want to risk anything or have my system files arranged poorly, because an older version may not recognize everything correctly.

Glassed Silver:mac
 

whg

macrumors regular
Aug 2, 2012
236
153
Switzerland
Are there any TB cases, just in case I change my mind again, that don't cost a lot?
I'd prefer to chose the SSD itself freely, independent from the enclosure.

Glassed Silver:mac
After using the quoted Transcend Thunderbolt-Drive to my satisfaction (I have installed the Bootcamp partition on it, by the way), I wanted to use a Samsung 850 1TB SSD in an external Thunderbolt case. For this I ordered this item:
https://www.amazon.com/gp/product/B00G9TZM22/ref=od_aui_detailpages00?ie=UTF8&psc=1
I should get it in about 2 weeks. From the comments at Amazon it should be possible to replace the conventional HD with an SSD drive and get reasonable performance. I'm too afraid of opening my 27" iMac and prefer the external solution. As there are no separate power supplies needed, this seems to be a viable solution to me.

By the way, in the past I used Drive Genius 3 (installed on a USB stick with boot capability) to defragment the internal HD of my iMac. The performance gain was not really worth the cost and time spent, in my opinion. I think it is much better to try not filling up the disk too much. As long as about 30% of the HD is unused the performance is OK without using a defragmentation tool.
 

grahamperrin

macrumors 601
Jun 8, 2007
4,942
648
… HFS Plus catalog file … gets cached in RAM.

Impossible when, for example, that file alone is larger than the amount of installed memory.

At http://apple.stackexchange.com/a/19358/8546 there's a 3.5 GB example; I have seen many that are far larger.

An SSD drive doesn't care about fragments. …

That's not always true. In 2014 @AidenShaw drew attention to the following:

I actually did something to my 840 Pro that you're not supposed to. I defragged it completely. I saw an instant read performance increase and faster booting. I didn't benchmark for before/after but actual daily usage proved to be a seat of the pants increase. All apps. launched quicker and boot was quicker. This would probably only indicate read performance. I don't really write to this drive often except for video work. In efforts to protect the longevity of the drive, most all writes are done to spinners. I realize that defragging is counter intuitive to longetivity, but I just couldn't help trying it once. I'm glad I did. …

Also:

A seriously fragmented SSD is much slower than a defragged one.

The OS has to issue a separate I/O for each fragment - so there's CPU and I/O latency cost to fragments. There's no added latency due to moving the heads, so the effect is less than for spinners.

A fast consumer SSD like the 840 EVO 250 GB can do about 90,000 reads per second, and 66,000 writes per second.

If a file is in 200,000 fragments - that adds two seconds to the read time and 3 seconds to the write time.

An occasional manual defrag of an SSD can make Safari snappier.
 

Miguel Cunha

macrumors 6502
Sep 14, 2012
389
102
Braga, Portugal
Hey guys,

I've tried to get some best practices (/programs) for defragging my Mac, or more specifically, my El Cap partition (shared with a Bootcamp partition hosting Windows 7 and of course the usual recovery partition for OS X).

I've tried Drive Genius 3 once, but it caused problems. Well that or another event that occurred at the same time maybe.
To be frank, I don't really remember it too well, because right around that time my Mac failed anyways and I had to get my GPU replaced through Apple.
Maybe that's what I remember.

Anyhow, I'd love to hear what everyone considers to be a safe approach to defragging a Mac.
I know OS X does a better job at this than Windows, but I really think it's time to do this.

Glassed Silver:mac

PS: defragging can be either live or offline (booted from a stick or DVD) - guess offline is better as it can move files a live defrag can't. :)
PPS: no, I don't have an SSD, otherwise I wouldn't ask. :) Thank you for everyone who tried to stop me from unnecessarily wearing out a drive though. The least it's done is prevent a googler from doing this! :)
I tried several programs, including Drive Genius and TechTool Pro which caused more problems than they solved

I ended up selecting iDefrag which is, in my opinion, the best by far.

Not only it defragments files, but it also optimizes and organizes them for better performance and checks your drive/partition for errors. You can also defragment individual files - very useful when your drive is not very fragmented, but some files are spanned across it.

Note that in the case of files through RAID configurations (ex: video), you SHOULD NOT defragment, because that's the very purpose of working in RAID - to distribute files across drives, for speed and redundancy.
 

Fishrrman

macrumors Penryn
Feb 20, 2009
29,279
13,378
mic j posted common Mac misinformation above:
"Please save your time and money and move on from those "PC" days. There is no need to degrag a Mac drive."

There absolutely IS good reason to defrag a Mac drive in some situations.

This is particularly so for those who work with audio or video, and do a lot of recording with same. Typically, audio or video apps need a large contiguous block of "free space" so that they can lay down a clean, continuous stream of data. Any fragmentation they encounter can interfere with this process. As a result, data may be lost.

It's also true for drives that have been in use for some time.
Over time, without defragging, the drive will acquire thousands of areas of "fragmented free space" between data files. This is immediately apparent if you "view" the platters of a drive with a defragging app that can show you each individual sector.

This definitely slows a drive down when trying to find or write a file.

Defragging will not only re-concactenate any fragmented files (the Mac OS can defrag -some- files, but not -all- of them), it will also re-group them "at the head end of the drive", leaving a contiguous block of free space "at the end".

The same reasons that make defragging a good idea (periodically) on a Windows drive make doing so a good idea on a -Mac- drive, as well.
 
  • Like
Reactions: grahamperrin

G4DPII

macrumors 6502
Jun 8, 2015
401
544
Drive Genius is what they use in the Apple Stores when they have a sluggish Mac with a spinner brought in. Saves so much time just running that before doing anything else.

To say Mac OS X defragments as it goes is how it is supposed to happen, but it doesn't work like that sadly. As with any Spinner, cockups happen and the OS misses things.

Thankfully as everything starts moving to SSD's this should become less of a problem as anything the OS misses TRIM should pick up.
 

Tech198

Cancelled
Mar 21, 2011
15,915
2,151
The safe and recommended approach is to delete the defragging software.

As Les said: _Never_ on an SSD drive. With a HD drive, it isn't helpful. With an SSD drive, it will harm your drive.

And if your HD is full, de-fragmentation will take ages. Much better to replace the hard drive with a bigger one.


Fair enough, but even a spinning hard drive would sill need defrag...... The idea is not because u don't have enough space, but to speed up performance, since as files are written there scatted across the drive...

It take time for the head to read each one and move, but once defrag, all files are contiguous.

But not on ssd, because while SSD's write in blocks i guess not really needed.... how faster can u made an ssd ? its already faster than a spinning hard drive so is pointless to even defrag one.. and even if u did use one, the speed would still be limited to the interface.
 

grahamperrin

macrumors 601
Jun 8, 2007
4,942
648
… not on ssd … pointless …

A point: it's sometimes useful to defragment at least the metadata (the B-trees).

@Glassed Silver if you purchase a product, go for one that can focus on optimising the metadata. iDefrag has that capability. (I also have Drive Genius but have not used it for a long time. I can't recall whether Drive Genius has that capability.)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.