When does OSX defrag?

Discussion in 'Mac Apps and Mac App Store' started by slipper, Apr 22, 2005.

  1. slipper macrumors 68000

    slipper

    Joined:
    Nov 19, 2003
    #1
    I know OSX self defrags organizes files, but when does it do it? Is it after i install a program when it 'optimizes'?
     
  2. grapes911 Moderator emeritus

    grapes911

    Joined:
    Jul 28, 2003
    Location:
    Citizens Bank Park
    #2
    I'd guess that the optimization is defraging. But, when ever you access a file OS X 'defrags' that file before using it. This only works the file is under 20mb. I think there is some defraging during the daily, weekly, and monthly scripts too.
     
  3. daveL macrumors 68020

    daveL

    Joined:
    Jun 18, 2003
    Location:
    Montana
    #4
    The "optimizing" installation step is pre-binding the installed program(s); it has nothing to do with defragmenting. The defrag is done on the fly for all files that are smaller than 30 meg (I believe that's the size, but I may be off).
     
  4. GeeYouEye macrumors 68000

    GeeYouEye

    Joined:
    Dec 9, 2001
    Location:
    State of Denial
    #5
    20 MB is the size limit for auto-defragging. There's also hotfile clustering, which moves oft-used files to nearby regions on the disk. Other than that, the only reason to defrag (and yes, you do have to use a 3rd party utility, though with some clever scripters, this should change in Tiger) is if you're converting a hard drive from general use to video storage for editing, especially if it's a slow drive with lots of previous use of files just greater than 20 MB in size. Generally though, defragging simply isn't needed.
     
  5. mkrishnan Moderator emeritus

    mkrishnan

    Joined:
    Jan 9, 2004
    Location:
    Grand Rapids, MI, USA
    #6
    I knew the first part of this, but I have a question...normally, when you force update all prebindings, you must reboot because system performance will be impaired if you do not. I guess this is because prebindings involving almost everything are updated. But when you install new software and it goes through the optimize routine, it does not always require you to restart. So in the cases where it says its optimizing, but it doesn't require you to reboot, is it still doing prebinding when it says its optimizing?
     
  6. mkrishnan Moderator emeritus

    mkrishnan

    Joined:
    Jan 9, 2004
    Location:
    Grand Rapids, MI, USA
    #7
    So, semi-OT, this is related to the fact that the HD is journalized, correct? That is, non-journalized MacOS partitions in older versions of OS X are not de-fragmented automatically?

    What I've been wondering is, NTFS is also journalized, to my knowledge. But MS has been making a big deal about auto-de-fragmentation in Longhorn. So does XP really not have this feature already?
     
  7. daveL macrumors 68020

    daveL

    Joined:
    Jun 18, 2003
    Location:
    Montana
    #8
    mkrishnan

    1. When you run pre-binding on the entire system, you are affecting system programs, thus the need to reboot. An app installation isn't, in general, touching any OS/System stuff, and if it does, then you will be asked to reboot, e.g. security updates.

    2. No, it has nothing to do with journaling, per se. Journaling simply logs meta data changes to the file system so they can be replayed, if needed (a dirty shutdown, for instance). The defrag stuff was added in Panther, I believe, and although it came at the same time as journaling, they are two different features of HFS+.
     
  8. mkrishnan Moderator emeritus

    mkrishnan

    Joined:
    Jan 9, 2004
    Location:
    Grand Rapids, MI, USA
    #9
    Ahhh... Thanks! :) I thought that the journal's meta-data was the thing being used to know what to move around and fix for de-fragmentation. At least with hot clustering, that's what some other sites seemed to imply. Anyway, it's good to have it, at least on my Mac. ;) Not that WinFS doesn't sound impressive, should it ever be released....
     
  9. daveL macrumors 68020

    daveL

    Joined:
    Jun 18, 2003
    Location:
    Montana
    #10
    The defrag may use the journal's meta data. I just wanted to make it clear that they are two different functions, i.e. you could have a journaled filesystem, but not have the defrag feature or vice versa.
     
  10. mkrishnan Moderator emeritus

    mkrishnan

    Joined:
    Jan 9, 2004
    Location:
    Grand Rapids, MI, USA
    #11
    Got it... which would explain NTFS on NT4 Win2k and XP, I guess....I do *not* miss defragging. Stupid #$#@ thing restarting because some mouse movement or TSR caused a system file to be accessed. :D
     
  11. stcanard macrumors 65816

    stcanard

    Joined:
    Oct 19, 2003
    Location:
    Vancouver
    #12
    The difference between the windows based filesystems which require constant defragging, and the HFS+ or EXT2/3 filesystems that don't is based on the algorithm used to determine the best place (physically) on a disk to place the file. There are many different ways of doing this (do you pick the smallest space that can fit the file, do you pick the largest contiguous block of free space? What do you do with really small files, etc), plus ways of optimizing during cleanup routines.

    I had a Windows 2000 system where the defrag kept stopping because defrag had changed a file! I don't miss that...
     
  12. mkrishnan Moderator emeritus

    mkrishnan

    Joined:
    Jan 9, 2004
    Location:
    Grand Rapids, MI, USA
    #13
    This would be when you physically throw the computer out the window. :eek: :D
     
  13. ~Shard~ macrumors P6

    ~Shard~

    Joined:
    Jun 4, 2003
    Location:
    1123.6536.5321
    #14
    If you ever want to pick up a nice little free tool that will do some maintenance tasks like this, grab MacJanitor.
     
  14. stcanard macrumors 65816

    stcanard

    Joined:
    Oct 19, 2003
    Location:
    Vancouver
    #15
    Or go buy a PowerBook :D
     

Share This Page