A Hidden Snow Leopard Feature: HFS+ Compression

Discussion in 'macOS' started by brkirch, Sep 5, 2009.

  1. tplatt macrumors newbie

    Joined:
    Aug 30, 2009
    #26
    I was able to get it to compile in XCode by adding frameworks: CoreFoundation, CoreServices, and libz.dylib.

    Does that sound right? I guess it is, because it works :)
     
  2. brkirch thread starter macrumors regular

    Joined:
    Oct 18, 2001
    #27
    I've setup a website for updates:
    http://web.me.com/brkirch

    That works, although you actually don't need CoreFoundation to be linked in, only CoreServices and libz. To compile through the Terminal try
    Code:
    gcc -arch x86_64 -arch i386 -lz -o afsctool afsctool.c -framework CoreServices
    The CoreServices framework didn't use to need to be linked in, which is why I didn't include it in my previous post.
     
  3. Jakimo macrumors 6502

    Joined:
    Apr 25, 2008
    Location:
    Colorado Springs
    #28
    Squeeze - GUI for HFS+ compression

    Check out MacHeist.com this week for a free copy of Squeeze, a utility that does this via a Preference Panel.
     
  4. andi242 macrumors member

    andi242

    Joined:
    Jan 27, 2009
    #29
    this only works for the system partition.
    if you do store your system on a single partition, you're fine.
    if you have stored files on a second partition Squeeze won't work.
    external drives neither...

    the developers may to lift this restriction in later releases, support told me.

    besides... Squeeze seems to work as a service noticing changes within folders while afsctool is static
     
  5. CPngN macrumors newbie

    CPngN

    Joined:
    Jun 9, 2008
    Location:
    Bay Area, California
    #30
    I assume that if you stop the service, it simply doesn't monitor those folders to compresss any new data. So if you turn off the service after you compress a few folders, it should be the same effect as running afsctool, no?

    I ran my docs and movies and a few other folders through there and saved 4.x gigs - enough to store an additional DVD ISO. Not bad if it doesn't eat up too many resources after the initial compression effort.
     
  6. Tu13es macrumors regular

    Joined:
    Sep 28, 2009
    #31
    Code:
         --hfsCompression
                       When copying files or extracting content from an archive,
                       if the destination is an HFS+ volume that supports compres-
                       sion, all the content will be compressed if appropriate.
                       This is only supported on Mac OS X 10.6 or later, and is
                       [B]only intended to be used in installation and backup scenar-
                       ios that involve system files[/B]. Since files using HFS+ com-
                       pression are not readable on versions of Mac OS X earlier
                       than 10.6, this flag should not be used when dealing with
                       non-system files or other user-generated content.
    I stumbled onto this after finding Squeeze. I'm curious as to why the bolded section is there and whether or not using Squeeze will be worth it or not.
     
  7. lns-pedro macrumors newbie

    Joined:
    Mar 8, 2010
    #32
    I believe that message appears for compatibility reasons, as explained in the next sentence in your quote (i.e., compressed files can only be read in Snow Leopard systems). Copying a file to other location, or sharing it from your computer works correctly, so the caveat is there for volumes you use alternatively in several operating systems.
     
  8. lns-pedro macrumors newbie

    Joined:
    Mar 8, 2010
    #33
    Squeeze 1.1 now allows folders in non-boot volumes to be compressed, as long as they are not located in removable media. Please, upgrade to the latest release :)

    The reasons for still excluding removable media are:
    - If you mount a volume in an OS other than Snow Leopard, compressed files cannot be read. We prefer to exclude those volumes rather than cause any inconvenience to users that might not be aware of this limitation. Note, however, that copying a file to any location or sharing it from your Snow Leopard computer will work correctly in all cases.
    - Squeeze being configured to receive filesystem notifications from a folder in removable media would prevent the volume from being ejected while Squeeze is running. Again, this would potentially be the cause of frustration for some users.

    We are looking at ways to further relax the non-boot volume restriction. However, Squeeze 1.1 allowing internal disks to be processed does help with a lot of configurations.
     
  9. lns-pedro macrumors newbie

    Joined:
    Mar 8, 2010
    #34
    That's correct :)

    Using as a background service is intended to keep some folders compressed, which is most useful in locations where reading is much more frequent than writing. For example, pointing Squeeze at your applications folder will ensure that any new application you install will be automatically compressed.

    After the initial compression has taken place, Squeeze will sit there and will only wake up when changes occur in the configured folders. When that happens, Squeeze will only perform compression if your system CPU and disk activity levels are below a certain threshold, so it should not interfere with the rest of your activities.

    Nice savings! :)
     
  10. Truffy macrumors 6502a

    Truffy

    Joined:
    May 9, 2005
    Location:
    somewhere outside your window...
    #35
    Not so SSD?
     
  11. kylekai macrumors member

    Joined:
    Nov 23, 2009
    #36
    HDCleanUp

    There's a relatively new app called HDCleanUp that does this also, but it's not a preference panel. Drag and drop a file or folder onto its window.

    More info is here: http://web.me.com/wmodesitt/HDCleanUp/Welcome.html
     
  12. mckyvlle macrumors 6502a

    Joined:
    Nov 21, 2007
    Location:
    London, UK
    #37
    Ooh, I'm rather late to this game...

    To those that have used HFS+ compression extensively/on a daily basis, any pros/cons/caveats to be aware of? Does running compression do anything negative to data integrity?
     
  13. gnasher729 macrumors P6

    gnasher729

    Joined:
    Nov 25, 2005
    #38
    Don't do it. All the really space consuming items on your hard drive are already compressed, and HFS+ compression won't help (videos, music and photos). HFS+ compression is excellent for Apple's applications that contain everything needed for 20 different languages inside, and for most users 19 languages will be compressed at all times.
     
  14. Detrius macrumors 68000

    Joined:
    Sep 10, 2008
    Location:
    Asheville, NC
    #39
    I can't agree with this blanket response. There are situations where it would be beneficial. For example: if you use MacPorts or Fink, you can use this to compress their installation folders, and you can save a fair chunk of space that way. Note, though, that these tools don't help you on files that ever change. These tools are good for files that just sit there. So, if you have a large Boost library installed, for example, it's great for that too. :)
     
  15. mckyvlle macrumors 6502a

    Joined:
    Nov 21, 2007
    Location:
    London, UK
    #40
    I see. I will give it a go at the Applications, Developer and Macports folders. At least those are easy to replace if it blows up.
     
  16. danpritts macrumors newbie

    Joined:
    Sep 26, 2007
    #41
    For those who are coming to this thread later, like me, many links above are broken (thanks for shutting down .me, apple!)

    I found this:

    http://clustersapp.com/

    Which is the "squeeze" referred to above, I think.

    The afsctool script is on github:

    https://github.com/jrk/afsctool
     
  17. LordDeath macrumors member

    Joined:
    Feb 28, 2013
    #43
    I installed this tool over the MacPorts and it is great!
    It saved ~2GiB on my MacTeX installation and it also saved a lot storage on Application Bundles. I haven't noticed something incompatible yet and I also don't feel any performance drawbacks. The Core i5 and the SSD in my MBA are fast enough to compensate this additional on-the-fly decompression. :)
     
  18. benwiggy macrumors 68020

    Joined:
    Jun 15, 2012
    #44
    Funny how things go out of fashion and then return:
    http://en.wikipedia.org/wiki/DiskDoubler
    "Eventually, ... changes to the underlying filesystem and ever-increasing drive space killed off this product niche."

    Even a saving of 2Gb on a modern system are not really worth any potential problems -- such as being able to get at your files.
     
  19. Mr. Retrofire macrumors 601

    Mr. Retrofire

    Joined:
    Mar 2, 2010
    Location:
    www.emiliana.cl/en
    #45
    Over 90 percent of Apples OS X is already compressed. So it is a fully supported feature on (Mac) OS X 10.6.x and newer. Btw, Apple compresses also updated parts of OS X.

    Compression is still useful. Even SSDs use compression (SandForce controller).
     
  20. Ant0ine macrumors newbie

    Joined:
    Feb 10, 2013
    #46
    Where does this number come from exactly? 90% of what is compressed ?
     
  21. MrGimper macrumors 601

    MrGimper

    Joined:
    Sep 22, 2012
    Location:
    Andover, UK
    #47
    Just been speaking to the devs of "Clusters".. V 1.7.1 just released is compatible with Mav in case anyone was interested. Think I'll buy it.
     

Share This Page