Disk Defragment

Posted:
in macOS edited January 2014
I've been accustomed to Windows for the past decade or so, so forgive me for this question.



Is there a way to defragment the HD in OS X?







Any comments or help are greatly appreciated.
«1

Comments

  • Reply 1 of 23
    jdbon2jdbon2 Posts: 44member
    Yes, however a defrag utiltiy is not included with Mac OS X. Disk Warrior and Drive 10 can defragment your drive, however they are not cheap, and the importance of defragging your drive with Mac OS X is not the same as with Windows.
  • Reply 2 of 23
    paulpaul Posts: 5,278member
    DW 3.0 can not defrag your drive.... but it is great for disk repair and every mac user should have it...



    Tech Tool Pro 4? can defrag your HD tho, and includes most of drive 10's features... I don't believe it is out yet tho...
  • Reply 3 of 23
    aquaticaquatic Posts: 5,602member
    Secret Agent Man you never need to defrag OS X because it has a journaling file system. Turn on journaling, it prevents data loss and other file system screw ups. Panther will have a switch for it but for now you need to use Terminal. http://www.afp548.com/Articles/Jaguar/journaling.html
  • Reply 4 of 23
    kecksykecksy Posts: 1,002member
    Quote:

    Originally posted by Aquatic

    Secret Agent Man you never need to defrag OS X because it has a journaling file system. Turn on journaling, it prevents data loss and other file system screw ups. Panther will have a switch for it but for now you need to use Terminal. http://www.afp548.com/Articles/Jaguar/journaling.html



    What? Journaling has nothing to do with preventing disk fragmentation. OS X doesn't fragement a whole lot because of HFS+.
  • Reply 5 of 23
    mmmpiemmmpie Posts: 628member
    A journaling filing system does not remove the need for defragmentation.



    Fragmentation occurs unavoidably duting the use of a drive. It will slow down the speed of file access, as files become fragmented during use.



    The only filing system immune to the effects of fragmentation are those that automatically perform defragmentation themselves. This can be in the background, or as files are written. Im not aware of any commercial file sytsems that do this ( it certainly has been done in research ).



    HFS, in particular, is not designed to mitigate the effects of fragmentation ( as opposed to NTFS, which was designed with the aim of never having to defrag - still not good enough ).



    The cheap way to defrag is to copy your system to another drive

    ( which is blank ), and then copy it back. The copying process will defrag files if sufficient space is available.



    I am dissapointed that os x has no defrag built in, or any way to see how fragmented files are. I suspect that the slow down of iphoto and mail with large databases can be tracked to heavily fragmented databases.



    Indeed, fragmentation occurs not only at the file system level, but also internally in databases. It is important to be able to defrag the db ( if you've ever used access it performs a 'compaction' when you close a db to do just that ).
  • Reply 6 of 23
    mrmistermrmister Posts: 1,095member
    Big article last couple of weeks from a guy who used to work at Norton (!) on why disk defragging is very overrated. Basically he said that on HFS+ drives it doesn't create enough of a difference to warrant the time, energy and potential data risk that all these utilities entail.



    Anybody have that link?
  • Reply 7 of 23
    aquaticaquatic Posts: 5,602member
    Quote:

    The cheap way to defrag is to copy your system to another drive

    ( which is blank ), and then copy it back.



    Yup but if you plan on rebooting you're in trouble. Stupidly you can't just copy an OS X drive to another drive and back. It breaks.

    Carbon Copy Cloner does it right (so why can't OS X?)



    JFS prevents data corruption so I assumed it tried not to fragment files as well. But hard drives are so large these days fragmentation is not an issue anymore. IIRC you have to fill your hard drive past 80% or more capacity to start fragmenting.
  • Reply 8 of 23
    baumanbauman Posts: 1,248member
    Quote:

    Originally posted by mrmister

    Big article last couple of weeks from a guy who used to work at Norton (!) on why disk defragging is very overrated. Basically he said that on HFS+ drives it doesn't create enough of a difference to warrant the time, energy and potential data risk that all these utilities entail.



    Anybody have that link?




    This the article you are looking for? http://www.welmac.org.nz/article_arc...optimising.htm



    MMmmmm.... Google is your friend. I simply entered "norton defragment hfs risk time"
  • Reply 9 of 23
    1337_5l4xx0r1337_5l4xx0r Posts: 1,558member
    Aquatic, journalling is put in place so that if a crash happens just before/during/after a hard crash, the system can be restored to a 'consistent' state after reboot. It has absolutely nothing to do with fragmentation, but rather data integrity.



    And fragmentation occurs on all drives, regardless of size, and regardless of free space available.
  • Reply 10 of 23
    aquaticaquatic Posts: 5,602member
    I don't know much about fragmentation, I admit. I have a 120 gig outboard drive I bought for my PBG4 12" to put most of my stuff on. I only have around 30 something out of 60 gigs used on my internal drive in the 12". I assumed that would prevent fragmentation. Are you telling me if I make mostly small documents under 10 megs on my internal drive with over 30 gigs available there will still be fragmentation!? Why would the system split files into parts if there was enough space available. I know apps, docs, and system files all have their separate space on the disk but I also have 640 megs of RAM and I don't multitask too heavily so that should keep the pagefile small. Anyway thanks for clearing stuff up 1337_5L4Xx0R.
  • Reply 11 of 23
    mmmpiemmmpie Posts: 628member
    Having a large disk doesnt prevent fragmentation. File systems dont move files around once they are created. So as you modify a file new fragments are created to hold that data, even though there is plenty of space to hold the file in one fragment.



    And even with big disks, data grows to fill that space. I have no trouble filling an 80gb disk with all sorts of accumulated junk.



    As far as the effectiveness of defragging, it requires some real numbers to make any sort of arguments. HFS has frequently been pointed out as being slow, so it may be that fragmentation doesnt make it much slower, hence making defragging less useful. I still think that fragmentation may have a significant impact on iPhoto, Mail, and iTunes. But without being able to see how many fragments those files are in and how the performance varies with defragging.



    While simply copying the system may not work, copying the user and application files should. That wont defrag the system files, you would have to do a clean install with all the updates as well. A bit of work...
  • Reply 12 of 23
    inkheadinkhead Posts: 155member
    All I know is after running Drive 10 on 3 different disks for 2 hours my computer is much faster, simply because it can access the disk faster. It maybe overrated but not to me. Less access to the disk is a good thing. Probably good on a powerbook battery as well.
  • Reply 13 of 23
    mrmistermrmister Posts: 1,095member
    "This the article you are looking for?"



    Yes. Thanks.



    "MMmmmm.... Google is your friend. I simply entered "norton defragment hfs risk time""



    I wonder how I never guessed the proper search string.
  • Reply 14 of 23
    fuzz_ballfuzz_ball Posts: 390member
    Here's what little I can add:



    1) ...

    < Okay, so my opener was correct, I can only add a "little" As it turns out I was confusing optimizing with defragging so this point deserves to be deleted. Move along, nothing to see here...>



    2) Regarding the article mentioned, the person that wrote it offers no facts to back up his statements, all he seems to offer are opinions. For example, in his discussion about optimizers he says "I'm dubious that this technique creates any perceptible speed increase." Wow, what did he say? Nothing really; he gave an opinion and didn't back it up. I won't go so far as to suggest the extreme, i.e. that he's completely wrong, but without any evidence, his statements are no more credible than the statements of companies that make defrag/optimizer utilities.



    3) I've heard lots of talk about HFS+ being "unaffected" and somehow impervious to the affects of file fragmentation, but again, I've seen no hard facts; however, I would be interested in seeing something factual on the topic one way or the other.



    In the mean-time, until I hear something credible and reliable, I don't mind the time my computer spends on occasion optimizing (was defragging, but as pointed out, DW optimizes, not defrags) when I'm not using it anyway...
  • Reply 15 of 23
    ringoringo Posts: 329member
    Quote:

    Originally posted by mmmpie

    The only filing system immune to the effects of fragmentation are those that automatically perform defragmentation themselves. This can be in the background, or as files are written. Im not aware of any commercial file sytsems that do this ( it certainly has been done in research ).



    Didn't BeFS automatically de-fragment?
  • Reply 16 of 23
    mmmpiemmmpie Posts: 628member
    No. You even have to recreate attribute indexes by hand to help with speed and bugs ( much like rebuilding the desktop DB on old macos ).



    BFS has some nice concepts, but as an implementation it isnt a perfect file system to hold up.
  • Reply 17 of 23
    1337_5l4xx0r1337_5l4xx0r Posts: 1,558member
    Quote:

    Are you telling me if I make mostly small documents under 10 megs on my internal drive with over 30 gigs available there will still be fragmentation!?



    Yes. But we're talking minimal fragmentation here, which won't measurably affect performance. Severe fragmentation, however, will.
  • Reply 18 of 23
    vandewaalsvandewaals Posts: 450member
    Quote:

    Originally posted by fuzz_ball

    Here's what little I can add:



    1) Your disk does get fragmented. After only 2 months of use my new PB 17 was 30% fragmented (contrary to what someone further up the chain said, DW 3 DOES defragment your drive).





    How? I have DW 3 and as far as I can tell, it can calculate how MUCH your drive is fragmented (mine is over a year and a half old and is only 1% fragmented according to DW). If there is a defrag utility in there I'd love to know how to get to it....
  • Reply 19 of 23
    fuzz_ballfuzz_ball Posts: 390member
    Quote:

    Originally posted by VanDeWaals

    How? I have DW 3 and as far as I can tell, it can calculate how MUCH your drive is fragmented (mine is over a year and a half old and is only 1% fragmented according to DW). If there is a defrag utility in there I'd love to know how to get to it....



    Again, my bad. Here I am spreading misinformation. DW appears to "optimize" not "defrag".
  • Reply 20 of 23
    Quote:

    Originally posted by fuzz_ball

    You don't explicitly defrag using DW 3. When you run the "rebuild" process it will defrag. Like I said, when I first ran it and looked at the graph, I was about 30% fragmented. After I ran "Rebuild", then looked at the graph again, it reported that I was either 1% or 2% fragmented (doing a quick check right now shows that I'm 4% fragmented).



    Are you seeing something like this?







    That's rebuilding the directory tree structure; it's not defragmenting any files. DiskWarrior 3 does not come with an actual file defragger.



    The older DW2 came with PlusOptimizer that defragmented files and optimizes free space. This doesn't come with DW3, though.
Sign In or Register to comment.