Slashdot Mirror


Measuring Fragmentation in HFS+

keyblob8K writes "Amit Singh takes a look at fragmentation in HFS+. The author provides numbers from his experiments on several HFS+ disks, and more interestingly he also provides the program he developed for this purpose. From his own limited testing, Apple's filesystem seems pretty solid in the fragmentation avoidance department. I gave hfsdebug a whirl on my 8-month-old iMac and the disk seems to be in good shape. I don't have much idea about ext2/3 or reiser, but I know that my NTFS disks are way more fragmented than this after similar amount of use."

7 of 417 comments (clear)

  1. Huh? by Anonymous Coward · · Score: 5, Insightful

    but I know that my NTFS disks are way more fragmented than this after similar amount of use

    Is this based off of instinct, actual data, or what?

    1. Re:Huh? by bfg9000 · · Score: 4, Insightful

      (Yes, I run WinXP on my Toshiba laptop -- deal with it.)

      Why would anybody have a problem with you running Windows XP on your laptop? I'm a card-carrying Linux Zealot, and I don't have a problem with it.

      --

      I'm not normally an irrational zealous dickhead, but I figure "When in Rome..."

  2. Disk Fragmentation by List+of+FAILURES · · Score: 5, Insightful

    A lot of people simply equate disk fragmentation with slow application execution and opening of data files. While this is the most visible effect that fragmentation has on a system, it's not the only one. If you are dealing with large files (multi track audio, video, databases) then you will get a different kind of performance hit due to the non-contiguous nature of the free space you are writing to. If you want to capture video with no dropouts, you really want a drive that has all of it's free space basically in one location. This allows you to write those large files with no physical disruption in location. Please do not think that the only benefit to unfragmented space is just "my programs launch faster". If you do any real kind of work on your system with large data files, you should know that a defragmented drive is a godsend.

  3. Re:How to determine fragmentation... by spectecjr · · Score: 4, Insightful

    This is a very arcane procedure in XP. I shall try to explain, but only a professional should attempt this.

    1. Right click on drive icon, select properties
    2. Select Tools tab and click on "Defragment Now"
    3. Click on "Analyze"
    4. When analysis finishes, click on "View Report"

    This shows two list windows, one containing general properties of the disk such as volume size, free space, total fragmentation, file fragmentation and free space fragmentation. The second list shows all fragmented files and how badly they are fragmented.


    If you're not using the same tool to measure fragmentation on each OS, how do you know that they're using the same semantics to decide what a fragmented file is?

    IIRC, the Linux tools use a different metric to calculate fragmentation than the NT ones.

    --
    Coming soon - pyrogyra
  4. Re:HFS+ defrag source by MattHaffner · · Score: 5, Insightful

    Are you talking about the "Optimizing System" phase? As far as I know, that updates binary-library prebindings--not fragmentation. You can read more about it here:

    http://developer.apple.com/documentation/Perform an ce/Conceptual/LaunchTime/Tasks/Prebinding.html

    In theory, when you install anything (on any system) and have a reasonable amount of contiguous free space on your disk, the installed files should always be unfragmented since I believe that's what most file systems look for first to allocate: a large chunk of contiguous space.

    Fragmentation typically occurs more when you open a file, increase its size, and write it back out. But operations that write large files to disk that do not know beforehand what the final size may also do this to some files that were only written once to your disk. For example, some of the largest fragmented files on my HFS+ volume are things snagged with BitTorrent. The fragments in these files are very regular chunks of blocks, which could be the typical 'buffer' size BT grabs when writing.

  5. Re:File allocation Table by SideshowBob · · Score: 4, Insightful

    That isn't a filesystem that is a tape. Any number of tape systems exist, pick whichever one you like.

  6. Re:HFS+ defrag source by ahknight · · Score: 4, Insightful

    Last time I checked filesystems were also operatining system components. Often these components might be referred to as drivers.

    Then you didn't check hard. Again, HFS+ is a specification of how to write data to media in order to organize another collection of data. The implementation is what handles the defragging. There are no drivers involved as drivers are the software component of a hardware/software union and there is no hardware involved at this level (just logical organization).