Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compression and APFS #3

Open
szhorvat opened this issue Sep 26, 2017 · 25 comments
Open

Compression and APFS #3

szhorvat opened this issue Sep 26, 2017 · 25 comments

Comments

@szhorvat
Copy link

Will this tool work on High Sierra with APFS volumes?

Are there any known problems with converting a HFS+ volume containing compressed files (compressed using afsctool) tp APFS? Is it safe to upgrade to High Sierra if we have HFS+ compressed file?

@RJVB
Copy link
Owner

RJVB commented Sep 26, 2017 via email

@szhorvat
Copy link
Author

szhorvat commented Nov 1, 2017

Reporting back after High Sierra upgrade:

afsctool appears to work fine with APFS

Compressed files were maintained as such during HFS+ -> APFS conversion.

@RJVB
Copy link
Owner

RJVB commented Nov 2, 2017 via email

@DanielSmedegaardBuus
Copy link

Wait, what? I was under the impression that compression hasn't yet been implemented in APFS? Are you saying that you can use afcstool on APFS and it actually compresses files? As in, it doesn't just say it does, it actually does?

@szhorvat
Copy link
Author

szhorvat commented Dec 13, 2017

The Finder reports smaller sizes. Also, compression is preserved during conversion to APFS>

But there are issues. I have some apps compressed and when running them from a terminal, I get messages like this (but everything appears to work fine):

/BuildRoot/Library/Caches/com.apple.xbs/Sources/AppleFSCompression/AppleFSCompression-96.30.2/Common/ChunkCompression.cpp:50: Error: unsupported compressor 8
/BuildRoot/Library/Caches/com.apple.xbs/Sources/AppleFSCompression/AppleFSCompression-96.30.2/Libraries/CompressData/CompressData.c:353: Error: Unknown compression scheme encountered for file '/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/Exceptions.plist'
/BuildRoot/Library/Caches/com.apple.xbs/Sources/AppleFSCompression/AppleFSCompression-96.30.2/Common/ChunkCompression.cpp:50: Error: unsupported compressor 8
/BuildRoot/Library/Caches/com.apple.xbs/Sources/AppleFSCompression/AppleFSCompression-96.30.2/Libraries/CompressData/CompressData.c:353: Error: Unknown compression scheme encountered for file '/System/Library/CoreServices/CoreTypes.bundle/Contents/Library/AppExceptions.bundle/Exceptions.plist'

@RJVB I haven't forgotten about this but didn't yet find the time to look at it.

@RJVB
Copy link
Owner

RJVB commented Dec 13, 2017 via email

@szhorvat
Copy link
Author

@RJVB Don't bother with this now. I still have to investigate when the warnings appear, I just haven't had the time yet. I mentioned it in response to Daniel's comment.

I mainly use afsctool to compress Mathematica. It's 6-8 GB and I need several versions installed. When I start the GUI part of Mathematica from a terminal, I sometimes see these messages. When I start its "kernel" part (the command line program that actually does computations) I never see them. It might have something to do with Mathematica specifically.

I use the program daily and I have not yet noticed any tangible problems.

I'll update you in a couple of weeks.

@RJVB
Copy link
Owner

RJVB commented Dec 13, 2017 via email

@RJVB
Copy link
Owner

RJVB commented Dec 13, 2017 via email

@Henrietta1989
Copy link

Anybody tested in Mojave?

@maximumsomething
Copy link

@Henrietta1989 it works just as expected in Mojave.

@lpar
Copy link

lpar commented Jun 11, 2019

Confirmed, seems to work on test files. Go binaries show up as already compressed, which I'm not entirely convinced by, but maybe the linker is that smart?

@RJVB
Copy link
Owner

RJVB commented Jun 12, 2019 via email

@lpar
Copy link

lpar commented Jun 13, 2019

A Mac executable built using go build. Looks like a failure to compress is being reported incorrectly:

meta@updog % afsctool -v mage 
/Users/meta/Programming/Go/bin/mage:
File is not HFS+/APFS compressed.
File content type: public.unix-executable
File data fork size (reported size by Mac OS X Finder): 4298904 bytes / 4.3 MB (megabytes, base-10)
Number of extended attributes: 0
Total size of extended attribute data: 0 bytes
Approximate total file size (data fork + resource fork + EA + EA overhead + file overhead): 4300800 bytes / 4.1 MiB
meta@updog % afsctool -c mage 
Unable to compress file (already compressed).
meta@updog % 

@RJVB
Copy link
Owner

RJVB commented Jun 13, 2019 via email

@lpar
Copy link

lpar commented Jun 13, 2019

Well, I had to zip it, but here you are.
mage.zip

@gingerbeardman
Copy link
Contributor

gingerbeardman commented Jun 13, 2019

This compresses for me, with LZVN and the latest afsctool (it seems you're using that)

$ afsctool -cvvv -T LZVN mage
/Users/matt/Downloads/2019-06-13/mage:
Compression type: LZVN in resource fork (8)
File content type: public.unix-executable
File resource fork size: 2346302 bytes
File DECMPFS attribute size: 16 bytes
File size (uncompressed; reported size by Mac OS 10.6+ Finder): 4298904 bytes / 4.3 MB (megabytes, base-10)
File size (compressed): 2347008 bytes / 2.2 MiB
Compression savings: 45.4%
Number of extended attributes: 1
Total size of extended attribute data: 19 bytes
Uncompressed file size reported in compressed header: 4298904 bytes

With ZLIB I get this:

$ afsctool -cvvv -T ZLIB mage
/Users/matt/Downloads/2019-06-13/mage: file has a compressed chunk that's larger than the original chunk; -L to compress
/Users/matt/Downloads/2019-06-13/mage:
Unable to compress file.
File content type: public.unix-executable
File data fork size (reported size by Mac OS X Finder): 4298904 bytes / 4.3 MB (megabytes, base-10)
Number of extended attributes: 1
Total size of extended attribute data: 19 bytes
Approximate total file size (data fork + resource fork + EA + EA overhead + file overhead): 4300819 bytes / 4.1 MiB

I'm on 10.13.6 with an APFS filesystem.

How about you @lpar ?

@lpar
Copy link

lpar commented Jun 13, 2019

I unzipped the zip file and tried compressing the unpacked copy and it still wouldn't compress:

% afsctool -c mage
Unable to compress file (already compressed).
% afsctool --help
afsctool 1.6.9. (1.6.8.6-132-gc437635)

OS is 10.14.5 with an APFS filesystem.

Trying to use LZVN I get Sorry, LZVN compression has not been enabled in this build. I just used the README instructions to build it.

@lpar
Copy link

lpar commented Jun 13, 2019

With ZLIB, same results as you, so maybe the root problem is that the build doesn't have LZVN enabled.

@RJVB
Copy link
Owner

RJVB commented Jun 13, 2019 via email

@gingerbeardman
Copy link
Contributor

Thanks @RJVB

@lpar let us know if you have a problem building with LZVN support which requires cmake+make+install of https://github.com/RJVB/LZVN before cmake+make+install of this afsctool.

@lpar
Copy link

lpar commented Jun 13, 2019

Everything built and installed with no problems, thanks.

@ylluminate
Copy link

Do we know yet if compression is readily available with APFS on macOS 14 Sonoma yet?

@RJVB
Copy link
Owner

RJVB commented Sep 26, 2023 via email

@ylluminate
Copy link

With the way things are going generally I have a lot of apprehensions "upgrading" anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants