how to do a disk defragment on a mac book

How do i do a disk defragment on my mac book pro

MacBook Pro

Posted on Jan 23, 2012 1:45 PM

Reply
82 replies

Jul 11, 2012 8:30 PM in response to cmelbourne91

cmelbourne91 wrote:


defrags wont work on a mac, simply because it is not a computer. This is a PC process, and wont help the mac in any way, due to the processing system and the lack of background processes that occur. a defrag wont help you, the only way to try and imitate it, is to trawl through the mac syastem looking over your files.


The Lack of Background Proccess?

It's a completely deferent file system! Treads or Proccess have nothing to do with it. Exept to run the defrag program. HardDrives use Platters, Clusters & Sectors.

When a file is copied on a Windows machine, the OS copies the file on the 1st bits of Free Space the the Platter. Once that Patter is full it will continue the copy procces on the next Platter, Cluster or Sector of the HD, until the file is done coping. Filling up any & all Free space along the way. So a 1gig file could & does end up Scattered across the HD.

On a Mac machine, the OS copies the same 1gig file on the Continuous Free Space Part of the HD. No it does not start splitting the file, & scatter it across the HD. So when you Delete or Uninstall a File or Program you Delete the whole file.

I'm NOt Saying ya don't know what you're say, but I am saying ya need to be specific in your wording. & provide Sources.

Here's more for Apple..

http://support.apple.com/kb/HT1375


'"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.""

Sep 21, 2012 4:59 AM in response to davscanlon

davscanlon wrote:


I meant to say SSD's don't fragment as they use flash cells, so don't have to be read sequentially as apposed to a disk?


I mis-used the word "digital", i meant "flash technology"

SSD do fragment just like any other type of drive and this also happens on Mac computers. But with SSDs you aren't supposed to DeFrag them as it can have detrimental effect on there life span. SSD flash memory only has a certain number of Writes before it fails. SSDs have wear leveling were data is not written to the same part of the drive over and over. It is written to the complete drive before it goes back and re-writes to a section that has been written to already.


Oh and pay no attention to CSound1. His main purpose on this forum is to brake peoples balls.

Feb 27, 2014 1:41 PM in response to lweileman

It's absolutely helpful to defragment a mac disk, everyone in here saying you don't need to are either ignorant or not power users. Coming from someone who works on lots of data regularly i can tell you fragmentation definitely occours on disk drives (ssd and flash storage are an other story). idefrag is pretty good. defragging will save your drives from dying an early death and you'll be able to access large clumps of data (like uncompressed audio and video) much faster.

Apr 22, 2014 11:01 AM in response to lweileman

There seems to be two sides to this defragmenting issue here. Both are correct in their own ways but only slightly. Here is the truth.


Mac does do routine file defragmentation as you go about your normal activies. But it only defrags files of 20mb-50mb (apple tells you if you look but this is around the sizes) or less routinely. This means that if you do a bunch of read/write operations of larger files (large pictures, audio editing, video editing, downloading movies, downloading archives, etc) that you WILL have to eventually defragment your harddrive.


There are people that says it does nothing to help and can only do harm if you do defragment. However this isn't the case. Macbooks are computers just as much as PC's are computers. Both do benifit from routine maintenece as well.


If you move large files (moving large files to a backup HDD and deleting as well) your system will end up fragmented.


I do my defraging with ONYX and iDefrag.


First I backup what I need/want. Then I repair permissions using ONYX. Then I do a full defrag with iDefrag.


I can tell you for sure that this has helped my system. I do alot of audio editing (audio engineer/producer) with huge .wav files all of the time. My bootup speed increased to boot in 40 seconds (compaired to before at 1:20) and everything runs much smoother again (just like new).


But also be sure that you DO NOT defrag an SSD (will burn it out faster) and ALWAYS make a backup!


Hope this helps!

Feb 18, 2013 5:43 PM in response to John Galt

'i may assume that is does'... That OS X is satisfied with 20 GB on any size of disk you mean.

And indeed, OS X optimizes is an more correct way to say then OS X defragments.


Me and this guy agree on not running third party software.

The only thing we do NOT agree, is the gigabite versus procent issue.

Without hesitating he writes: on a 2 TB drive you need to have 200 GB free...


Where i stick to 20 GB.

Now confirmed here, but i'm not going to show him this link.

As a Apple Certified Technician with more than 12.000 post on that Belgian forum he is convinced OS X needs 10 to 15 percent free space, whatever the size of the drive.


actually, i would like to find any comment from Apple itself.

But the only article i can find is this no longer updated and archived one: http://support.apple.com/kb/ht1375

Feb 18, 2013 7:09 PM in response to John Galt

I am CompTIA Cert. I hold several from them. 1st lets start with, A hard drive is a hard drive and needs to be defragmented from time to time. Even Apple said so... (Toward the end of the article ) http://support.apple.com/kb/HT1375#


You will note Apple explains a little of how Disks end up with fragments. They all so state 'you might benefit' Defragmentation, use third party utilities. Here is the link to the Review of the utility I use & recommend.... http://reviews.cnet.com/8301-13727_7-10422120-263.html


This guys How-To is good if you need to just start over ( https://discussions.apple.com/docs/DOC-4032 ). But the massive dump of data to be restored will cause quite a bit a Fragmentation. Best just to start the way the article states with the bootable image of the system(Verify the image before proceed), Delete all the data you don't want. I would go for near to all, Run the defrag program, Boot into your bootable image, And then copy over the files you need and or want to have on your main hard drive(You will have to jump through quite a bit of folders to find your user profile), to their appropriate locations, one by one(Not folder by folder, but one individual file at a time.), & let each one finish before starting the next. This way each file will write on to one cluster of the disc contiguously.


Also, for future reference, try not to write multiple files simultaneously to the disk. Set Safari and iTunes to only allow one download at a time not simultaneously. This will help to combat fragmentation but will not prevent.


Mac OS X handles defragmentation in 20 MB chunks. It can handle no greater than 4 GB chunks of data. This is why a Windows machine cannot write a file greater than 4GB onto a GUID partitioned hard drive on an Apple router. You would need a Mac to do that.




Some time just running MemoryFreer (found in Mac AppStore) will help, as lots of unused data likes to stay in RAM. & use IStatPro to help you monitor your system RAM, Fan, HD & more.



There are tons of these articles within Apple's archived sections That help explain this.


For best Practices, I recommend 20% free space of what the Hard Drive is. 200GB = 40GB free at least at all times. (160GB = 32GB) that's 20%.


I hope this helps as I have been getting a lot of emails on the subjects from this post. I had posted earlier in this thread look back to the first or second page for my earlier post.


I reread some of the posts. A few post after my earlier post, someone also put down some good info check it out.



.

Mar 10, 2013 4:16 PM in response to lweileman

This is my method for defragmenting a OS X boot drive.


How to safely defrag a Mac's hard drive



It requires to make sure the operating system is working perfectly first, then reducing the user content of the boot drive so it's ideally below 50% filled (for best hard drive performance, but not more than 80% filled) then cloning the OS X boot volume to a blank external drive (formatted GUID OS X extended J in Disk Utility) then booted from (hold option key on wired keyboard) and then Disk Utility Zero Erase (one notch to the right on 10.7+) the internal boot drive, then reverse clone.


It's a lot more work, but it's extremely effective as every single file is defragmented and Applications folder are written to the "hot band" of the drive where reading is fastest. Also the Zero erase maps off any potential bad sectors it finds.


It also creates a bootable backup in the process, which ensures one can get online and use the machine while booted off the clone drive.


Users folder, which is subjective to the most radical changes, is at the end of the data as it's written last (in alphabetical order of the root directory) thus it ca expand and contract into the more slower parts of a hard drive, namely the second 50% of the drive, thus not seriously messing up OSX or Applicaitons which are written before Users folder.


I have done this and haven't had a slowdown issue in over 2 years, because apps and OS X updates are usually small and I keep my boot volume under the 50% filled mark (the second 50% is a bootable clone of the first for mobile backups)


Good Luck. 🙂

Jan 23, 2012 1:53 PM in response to lweileman

It's just not necessary or done on a Mac. Some people do it (and you can find apps that help you out), but most old grizzled Mac users never do it. Don't bother, it won't do much.


Mac OS X's formatting system is quite advanced and doesn't use every nook and cranny of your hard drive. The only time when it "might" matter is when or if your hard drive is near full, and OS X is trying to find those nooks and crannies.


  • 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.


Message was edited by: OrangeMarlin

Jan 23, 2012 1:58 PM in response to Allan Eckert

Allan Eckert wrote:


I like that one about a politician. 😁 Cute.


I like to see him ddig himself out of that hole because he certainly come across as knowing nothing at all with that comment.


Allan

We'll see. He might never return.


It's hard not to be snarky around here, but seriously, it sounded like a troll comment. You know, PC's are real computers, but Macs are just toys. 😠

Jan 23, 2012 2:16 PM in response to eww

eww wrote:


Here is a detaled rundown on what defragmenting does and doesn't do and when it is and isn't needed on a Mac:


http://www.macattorney.com/ts.html#6

Thanks eww for posting that link.

Although the Mac file system does not Fragment files like the Windows file system does that does not mean some routine mantenance wouldn't help.

As explained in the link post by eww a defragging program can help move all files into a closer area of the drive giving a larger free space area for the operating system to work with.

Does it need to done on a scheduled basis or done as files are written like on a Windows PC? No. But it is not a bad Idea to do it every now and then. I have done it with no ill effects. The one thing you don't want to do is run it on a SSD just like you don't defragment SSDs on a Win PC.

Jan 23, 2012 2:54 PM in response to cmelbourne91

According to cmelbourne91, only pc's are computers. Everything else is "not a PC and therefore not a computer." Good logic. Therefore the million of linux servers that the internet runs on aren't computers, nor is the cray super-computer. Cmelbourne91 I know computer history - I starting programming the 8086 intel processor running MS/DOS in assembly language. Having run various flavors of windows and linux over the years it is my personal opinion that Apple has the finest operating system (since OSX came out). Also cmelbourne91 apple uses the same processor and system bus and graphics cards that your beloved PCs use.


As for the real question - I concur that Mac OSX maintains and optimizes the disk. I've run a macbook for years without fragmentation or slowing. There is a disk-utility if you want, and if you really need a clean disk for video processing Mac OSX has tools to copy to a clean external drive, boot off that drive, wipe your hard drive, and copy back. Voila.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

how to do a disk defragment on a mac book

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.