1094 points · by sirn · 10y ago · 393 comments
I.e., a "unique copy-on-write design"
> Space Sharing
Basically, ZFS datasets.
> Snapshots
If those can be sent: Finally Time Machine done right.
> The AFP protocol is deprecated and cannot be used to share APFS formatted volumes.
Interesting.
> An open source implementation is not available at this time. Apple plans to document and publish the APFS volume format when Apple File System is released in 2017.
Yay!
Limitations: https://developer.apple.com/library/prerelease/content/docum...
Edit:
> encryption models for each volume in a container: no encryption, single-key encryption, or multi-key encryption with per-file keys for file data and a separate key for sensitive metadata
Nice. I hope they also include checksums for each block.
Famously missing, but not the hardest thing to add considering all the features above: Compression (which HFS+ supports!)
> If those can be sent: Finally Time Machine done right.
If this ends up being true I can't wait—it's so frustrating watching tiny incremental backups take forever over the network. It seems like "Preparing" and "Cleaning up" take longer than moving the data.
While waiting for APFS to become stable, buy Carbon Copy Cloner. $40. I love it. It's fundamentally rsync, but tailored to OS X. For personal use a single license covers an entire household.
Every night CCC fires up on each laptop and each does an incremental clone to its own dedicated directory on my desktop machine. This clone is usually less than a few GB and takes about a minute to run. CCC doesn't have to be run daily, it can be told to run hourly instead.
Time Machine running on my desktop then copies everything off to yet another disk.
So my backup environment is:
each laptop uses CCC to periodically clone to desktop
the clones on the desktop are "traditional",
CCC is told not to keep its own copies of modified files
desktop runs time machine,
makes hourly backups to a TM disk,
old versions of files can be found there
This gives me 3 copies of all data on each laptop:1) on the laptop
2) on the desktop
3) on the desktop's Time Machine Volume
If you create your users in the same order on each machine, or later go back and change the User IDs to match (under advanced options in Users and Groups) then the uids will match everywhere, and all files can be easily browsed in each location, with all file permissions intact.
This was my epic "there is to kind of people those who lost data and those who will loose data" story. All my dad and mum files where gone, luckily nothing professional and no pictures (analog camera still ruled back then).
This is just a reminder that no tool is ever perfect. CCC is great, TimeMachine is sluggish but "dumbproof" to a certain extend (but you have to keep faith in a black box).
Personally I'm pretty paranoid so I perform my monthly off-site backup by rebooting my Mac on recovery partition and I perform a full disc copy to an external drive using DiskUtils (because ultimately this will be the recovery tools I'll use if things goes bad so I need to use my off-site backup...).
It really sluggish so I run it while sleeping. I get that for professionals with more than 1To you will need to get to some more serious stuff anyway.
I use google docs for all my docs and spreadsheets, occasionally I use excel or word or keynote for files but if I do I save the docs to my dropbox or google drive folder, I have my photos synced with google photos, my music is synced through itunes match (or I can sync my music library files to dropbox, or use spotify), all my code is in git repos pushed to github or bitbucket.
What else is there to back up? Is it a matter of not wanting to re-install apps manually to get your computer back to its current state? Or is it a matter of not wanting to pay for the extra storage space on dropbox?
That is really interesting. I recognised with El Capitan that it already defaults to SMB instead of AFP when you don't give a scheme.
While I imagine this might be retrofittable (netatalk manages it, after all), I can't blame Apple for wanting to ditch AFP. It's an ancient protocol at this point, and I'm frankly just amazed it still works at all.
HFS+ supports compression, so compression is not a new feature, so it's not on the New Features page. No problem!
Anecdotally, I'd always found AFP in the Tiger and Leopard days to be faster than whichever version of SMB support was included at the time. Now I use the default SMB3 and it seems that 802.11ac and gigabit are bottlenecks (of course its 10 years later in the times of SSD's as well)
On-disk consistency ("crash protection"), snapshots, encryption, and transactional interfaces ("atomic safe-save") will no doubt be incredibly valuable. I don't think though though that APFS will dramatically improve upon the time it took ZFS to mature from a first product to world-class storage.
Some commenters have opined that (despite Apple distributing ZFS for Mac OS X at WWDC nearly a decade ago) that ZFS would never be appropriate for the desktop, phone, or watch. True ZFS was designed for servers and storage servers, but I don't think there's anything that makes it innately untenable in those environments--even its default, but not essential, use of lots of RAM.
Who knows... maybe Apple have spent the decade since killing their internal ZFS port taking this new filesystem though the paces. Its level of completeness though would suggest otherwise.
(That does leave me wondering how interesting an open-source APFS would be without an open-source Core Storage.)
hammer.ko is 494KB in the latest DFBSD, for those wondering the obvious.
It would be fantastic if they actively helped with HAMMER2 development.
Then Steve Jobs' buddy Larry bought Sun, and licensing of ZFS became basically impossible to sort out on time. So they dropped it.
Was that 2007 or 2009?
/edit
https://web.archive.org/web/20080721031014/http://www.apple....
Either way, what file system didn't take years to get right? There are so many possible edge cases with file systems that it not only takes a long time to sort them out, but an amazing community and/or luck to reproduce deterministically to fix them.
Could speed up their time to market with such seasoned hands on board.
It will be interesting to see which license, if any, APFS is released under.
Sounds an awful like like ZFS (zero-cost clones, read-only snapshots) but could it be? I would imagine they'd start from scratch to due IP issues.
Clearly this is immature technology they want to get out for testing/evaluation before it's fully adopted even into their own products. (See below.)
- - - from the release notes - - -
As a developer preview of this technology, there are currently several limitations:
Startup Disk: APFS volumes cannot currently be used as a startup disk.
Case Sensitivity: Filenames are currently case-sensitive only.
Time Machine: Time Machine backups are not currently supported.
FileVault: APFS volumes cannot currently be encrypted using FileVault.
Fusion Drive: Fusion Drives cannot currently use APFS.
Being energy hungry relative to UFS and others is likely true due to things like checksum calculations and compression, but there is no way to implement these things without needing more cycles to compute them.
Not so true now - people have added encryption and compression instructions to CPUs. I'd be surprised if Apple couldn't ask Intel for a couple opcodes, and with the mobile platforms they do it anyway.
Getting ZFS to run on the Apple Watch is definitely possible. I am not sure what acceptably means here. It is an ambiguous term.
> To use ZFS, at least 1 GB of memory is recommended (for all architectures) but more is helpful as ZFS needs lots of memory.
Is that inaccurate?
Otherwise, it is basically the SLUB memory block allocator that was used in the Linux kernel for a while. So yes, it can run on watchOS-level amount of RAM.
ATP will just be a concert of dings.
This one is confusing, because this is a logical volume feature. Not sure how or why APFS would ever care that some layer above it is encrypting stuff.
On the other hand, if the new ability to partition drives with flexible partition sizes includes separate encryption keys per partition, and encryption/decryption is done by the block driver, they may have work to do to keep that block driver informed about what blocks should get encrypted with what key.
> APFS supports encryption natively. You can choose one of the following encryption models for each volume in a container: no encryption, single-key encryption, or multi-key encryption with per-file keys for file data and a separate key for sensitive metadata. APFS encryption uses AES-XTS or AES-CBC, depending on hardware. Multi-key encryption ensures the integrity of user data even when its physical security is compromised.
[1] https://developer.apple.com/library/prerelease/content/docum...
Most apple volumes are already logical volumes (check diskutil list).
FileVault itself is, right now, implemented as part of corestorage (see diskutil cs for the encryption/decryption commands).
I assume they decided they just wanted to go the entire ZFS route and get rid of core storage in favor of a pool model, but still ...
It's wishful thinking, I know.
\o/ Hallelujah, something modern!
Hopefully this with change in the next macOs release.
The bootloader/bootmanager is what determines what fs choices you have for /boot. GRUB2 reads anything, including ZFS, Btrfs, LUKS, even md/mdadm raid5/6 and even if it's degraded, and conventional LVM (not thinp stuff or the md raid support).
[0] https://helpx.adobe.com/creative-suite/kb/error-case-sensiti... [1] http://apple.stackexchange.com/questions/192185/os-x-case-se... [2] http://dcatteeu.github.io/article/2015/12/31/case-sensitive-...
> Case Sensitivity: Filenames are currently case-sensitive only.
First thought: they have seen the light!
A moment later: wait...they consider this a "limitation", and it's only "currently" the case. So maybe they're going to perpetuate the brain-damage anyway.
Sigh.
Backwards compatibility is going to end up trumping whatever ideological purity case sensitivity represents.
The information currently is very scarce on this one, but I hope they would at least test it REALLY WELL.
And AFAIK, GNU Grub hasn't done a release in about four years now, and all the distros are using their own, custom beta build of it. It's a bit of a mess.
I realize new file systems are difficult, but HFS+ is just an ancient mess that's needs to be replaced for a long while. This isn't new and innovative so much as finally getting around to removing technical debt and catching up with the rest of the world.
Windows and WinFS is a bad comparison. WinFS was just a tagging/metadata system on top of NTFS with a SQL storage backend. We're still quite far from the ability to tag files with custom meta data and have it easily to query using default file chooser dialogues.
I would have greatly appreciated being able to use ZFS with MacOS X, for datasets, snapshots, sending them to remote pools for backup etc. It would have made it directly interoperable with a lot of pre-existing and cross-platform infrastructure. (I couldn't care less if it didn't scale down to the "watch". Filesystems are not a one-size-fits-all affair.) I find it great that I can take a set of disks from e.g. Linux, run "zpool export", pull them out, and then shovel them into a FreeBSD system, run "zpool import" and have the pool and datasets reassembled and automatically mounted. Perfectly transparent interoperability and portability. While Apple like to do their own thing, this is one place I would have definitely appreciated some down to earth pragmatism and re-use of existing battle-tested and widely used technology.
There's also a decent chunk of what ZFS supports (particularly flexible volume pool management) that would be useless on almost every machine that Apple makes and sells. Your example of pulling a drive out of one machine and putting it in another is either impossible (soldered-on storage) or highly unlikely (user-serviceable SSD, but hidden behind a bunch of pentalobe screws) with their modern hardware lineup.
Is it that Apple is a much bigger target? Patent issues?
Given what we know about Oracle that was probably the right call.
* best support modern hardware technologies,
* start from the state of the art in file systems (like ZFS and btrfs, old as they may be), and also
* emphasize security.
Google them and see what they do well, and you might get some ideas.
Let's recap:
- On OS X HFS+, filenames are stored using a "variant" of NFD, where some characters are precomposed "for compatibility with old Mac text encodings" (https://developer.apple.com/library/mac/qa/qa1173/_index.htm...).
- On Windows NTFS, filenames are "opaque sequences of WCHARs", and are thus "kind of" UTF-16 with no formally required normalization format. Windows itself tries to use NFC, but applications are free to use the Windows APIs to create a filename with anything they like. Since filenames are just sequences of 16-bit WCHARs, dangling surrogate pairs are allowed (and can break all sorts of code!)
- On Linux, filenames are opaque sequences of 8-bit characters. The only requirement is that a filename not contain either a slash or NUL character. No other formal specification exists, although "most" users these days use UTF-8. (However, you can and will find loads of filesystems with invalid UTF-8, usually because filenames are in one of the ISO encodings instead).
Multiple programming languages have been bitten by the possibility of invalid Unicode in filenames (see for example: rust (https://github.com/rust-lang/rust/issues/12056), Python (https://www.python.org/dev/peps/pep-0383/)). This mess is pretty much never going to go away, either, because filesystems are extremely durable and long-lasting.
More details here http://serverfault.com/a/427200
PS: I've been using LC_CTYPE="whatever.ISO8859-1" and an ISO-8859-1 Terminal.app locale forever since I seem to keep dragging a bunch of legacy filenames around (having started on MS-DOS and FreeBSD 2.2) and ISO-8859-1 still seems to be the only locale that lets me "see the bytes" matrix-style instead of a random amount of "?" chars. Curiously, Finder.app seems to keep up very very well despite the odd encoding. Crossing my fingers the new APFS will act more like Linux.
PPS: Java is especially hilarious when launched with -Dfile.encoding=utf-8 as it is literally impossible to access some files from there.
And don't get me started on .DS_Store :P
With Space sharing and multiple logical volumes there will probably be a shift to encrypting users home directories separately.
Probably even an unencrypted System Base, which is read-only and protected by rootless anyway, so the system can boot without user interaction.
This also finally allows the most user friendly implementation of file encryption: Encrypted Folders, supported by the OS.
Sounds cool, Id be willing to help with a rust port once the source is available :) (case sensitive only - naturally)
Encryption is not authentication, so it does not prevent unnoticed modification.
And secure boot only really depends on authentication and not on encryption, so you are conflating two different concepts.
No you cant just trust the data, replay attacks over time and space are still an issue.
It's certainly more secure (indeed, it prevents replay attacks) to just keep a big block-hash table, update it when blocks change, and then hash that table and sign it on fsync—but it's costly in a few ways over just trusting unauthenticated encryption, and was even moreso five-to-eight years ago when Secure Boot was being formulated.
These days, you see a lot of wholly-signed read only OS images—the OSX recovery partition is signed; CoreOS signs its OS images; most firmware is signed; etc. But I don't expect the unauthenticated-encryption on most computers' read-write rootfs will be replaced by a signed-but-unencrypted filesystem any time soon—if just for the fact that consumers really seem to hate the idea of separate OS and data partitions, especially when the OS partition is "stealing space" they could be using for data. (The only thing I can think of that might finally kill this making the default install on some consumer-OS create a thin pool, such that an OS partition that only contains 5G of data only "steals" 5G of their "space.")
Or, y'know, authenticated encryption. Do any block-device cryptosystems support an AEAD mode yet? LUKS maybe?
Thank you for injecting sexism into a technical discussion.
This is not a small thing. We had nice visual overhaul 2 years ago, now Apple needs to pick it up on under the hood level.
AFP deprecated too.
There are many limitations in the developer beta so this is clearly still very much a work in progress. Getting these file-systems right is traditionally difficult and can take years (see ZFS, BTRFS) so it will be interesting to see how well it does.
Sanity, at last! (even if temporary)
You will be able to see it here shortly:
Most people do seem to assume that the WWDC is an hour~ long commercial for everything Apple is going to do for the rest of the year.
Checksumming drives a lot of support calls that would otherwise not happen. As long as the errors are in media files and not meta-data, most consumers are going to be oblivious to bit rot in their downloaded movies and photos.
Enabling checksumming is going to reveal a lot of errors that would otherwise be silently ignored (spoken from experience running a ZFS media server)
ReFS already does this when you're running it on non-redundant storage - integrity streams are only enabled on mirrored/parity configurations.
It would be unbelievable if they really didn't have checksumming. Could it just be that they haven't documented it yet? That seems weird and unlikely, but... not was weird and unlikely as APFS not having checksumming.
Rather than having to RAID-mirror every block on my disk, I'd like to be able to pick just some files and say "please store those ones slightly more redundantly, such that they're protected from bit-level disk errors—they're important."
zfs set checksum=off rpoolWhen a sector goes bad on a hard drive, the firmware will mess about retrying and altering the analog amplifiers to try to get the signal back. If it gets the data back, it might "recover" by moving the data to spare sectors. Without a CRC, the firmware would have no way of differentiating between a sector read correctly and one that is read erroneously.
If block 1027 is errantly overwritten due to a bug in the filesystem, the block driver, the DMA subsystem, or the device firmware, the FS will know as soon as it goes to fetch block 1027 that something went wrong. This is true even if the block is still internally consistent; perhaps the write was misdirected, another sector was incorrectly read, or a failure in the flash translation layer caused a newer write to be lost.
If there's any redundancy to the system, whether storing the metadata in multiple places on the disk, or on different disks in an array, the FS can then check all the others and, crucially, detect which version is correct.
If I see one bad sector develop on a disk for no obvious reason, it's getting replaced ASAP because it's a sign that more will follow very soon.
I'll gladly spend 1% or whatever space overhead to notice it.
FS level checksums also cover bitflips on your bus during the write phase (the drive will crc the already bad data) or during the read phase (you receive different data than your drive sent).
I have no idea if Unicode is an issue for Apple File System.
Emoji file names, you guys.
But are they 3x bigger?
Anyway I'm not a specialist, just another IT guy, so maybe I'm too opinionated to argue more.
Part of the reason Apple has historically gotten much better press from WWDC than most tech companies do from their big developer events is that they laser-focused their keynote on being Press-digestible and not full of incomprehensible tech terminology that bores non-geeks to tears.
As evidenced by this thread, the people "filesystem snapshots" can be marketed to didn't need it to be mentioned in the keynote to get them talking about it. Hence, using precious keynote time for it would have been a waste of marketing resources.
- More resilience against data corruption for one due to copy on write and likely checksumming - so in theory power failure should not harm the filesystem and you can roll back to a last known state and only lose data for the last few seconds if at all.
- Snapshots, before installing updates you can snapshot the filesystem and roll back instantly. You could also create a readonly snapshot to have consistent backups. This should also allow seamless rollback of OS updates. There are also clones supported e.g. multiple diverging versions of a file tree - think something similar to git branches on a filesystem level.
- Native encryption at the filesystem level
- Possible better handling of metadata. Faster access to directories with lot's of files, more files on a volume without slowdown.
- Sparse files - you can create huge files instantly and fill them later, guess it's important for various types of software e.g. virtual machine images.
But as nice as these properties are in theory history showed that that in practice a lot can go wrong.
If you sue closed technology you get burned. I didn't have a problem with Microsoft doing what they did. We should have used an open file system for those devices. I personally have used ext2/rfs on my drives and it is a pretty light security system ;)
God, what a relief, we're almost done with this monstrosity of HFS+. Didn't you hear the collective sigh of anyone having to _work_ with this flea-market antique FS?
Nope. HFS+ is REALLY GOOD at losing data or having silent corruption. I'm thrilled to have a new filesystem just because it's not HFS based.
I'd celebrate having NTFS as the official filesystem. It's much more modern than HFS+.
That only took... a very very long time.
(Wonder if Radar has a new look...)
If you want to know why, just contemplate the smoking wreckage of the Oracle/Google Java API lawsuit.
Oracle's beef with Google comes from actions that occurred before Java was open sourced.
It's hard to see how the two scenarios are even remotely related, other than "Oracle"
> Word on the street in Cupertino is that dropping ZFS wasn’t an engineering decision, but a legal one, and it might have had something to do with Oracle’s acquisition of Sun. I don’t know if it was a problem with the terms of the CDDL license, general distrust/dislike for Oracle, or what — only that the word came down from legal that ZFS was a no-go.
Apple has a notoriously paranoid pack of legal sharks, and they clearly felt uncomfortable with something about the ZFS legal situation.
Oracle's viewpoint on what patents are and are not granted by that license is also interesting (as was Sun's).
Interesting enough that Apple felt they needed to go get a patent license for it, and couldn't come to terms.
http://arstechnica.com/apple/2009/10/apple-abandons-zfs-on-m...
You are correct this happened pre-oracle, but note that it was confirmed by Sun's spokeperson.
(Also note that the national labs, who have been continuing ZFS on linux, are immune to a lot of these issues. Oracle literally cannot get an injunction against them on patent infringement issues, so they are guaranteed they can always work on it)
I have to say it's made me a lot iffier on contributing to open source projects, or at least those owned by for-profit companies.
Open Source: "An open source implementation is not available at this time. Apple plans to document and publish the APFS volume format when Apple File System is released in 2017."
They got sued heavily for it. They had to completely change the implementation and it became a non-P2P video chat.
No, not true at all. iMessage was never promised, mentioned, or even hinted at being open source. Also, on the FaceTime from they said that the underlying protocols would be submitted to standards bodies as an open standard - that's a completely different things from open source. And the reasons that Apple didn't wind up doing that are well known (lawsuit from patent trolls).
Sounds like you have an axe to grind or only listen to people who do...
Too many fanboys I guess. I would hope the community is more enlightened than that.
https://developer.apple.com/library/prerelease/content/docum...
Releasing a new filesystem is already surprising. And they plan to open-source it. Huh.
The result, of course, is that nothing can access anything else's file system, at least well. Most of the formats I mentioned have been reverse engineered to some extent, but there are limits, especially when you're scared of corrupting data by misinterpreting the format and therefore limit your implementation to read access. If you want read-write access to NTFS from Linux or macOS, a filesystem which is old enough to drink, you have to rely on either a relatively slow FUSE implementation or some proprietary software. If you dual boot Linux on your Mac and want access to the Mac partition, make sure to turn off disk encryption (and hope you don't run into any evil maids) unless you want to use a read-only FUSE tool, and I hope you don't have a Fusion Drive because I don't think anything supports that at all (could be wrong).
To be fair, this situation cannot be blamed entirely on lack of openness. Lack of interest matters too; as I said, HFS+ has an open source implementation, yet Linux's hfsplus driver doesn't support journaling, a feature added in 2002. But if anyone tries to improve the situation, that implementation makes their job a lot easier: for one thing, since filesystem support is in the BSD-based portion of the xnu kernel, it may be possible to port the HFS implementation to other BSDs with relative ease - like the NetBSD rump kernel, which can run in userspace, from which FUSE support wouldn't be that hard... Alternately, if they chose the path of enhancing the native Linux driver, at least they could consult Apple's code to be sure they weren't missing any obscure corners of the format that could cause their driver to corrupt data.
Anyway, what we got with Apple File System is this:
> An open source implementation is not available at this time. Apple plans to document and publish the APFS volume format when Apple File System is released in 2017.
That's pretty good! Open source plus documentation would be ideal, but documentation is much better than nothing[1], and the text of that paragraph doesn't exactly rule out the possibility of the final release being open source too. (I haven't installed the beta yet, but am I right in guessing that APFS is implemented in a kext?)
While there's no guarantee, I hope that that documentation will also come with information about the Core Storage format APFS will usually be wrapped in, so that proper interoperability can be achieved. Rather than my fear coming to pass of one of the last vestiges of openness in proprietary OS storage formats disappearing, the situation may actually be improved compared to today. Maybe in a few years I'll be able to install Ubuntu on my Mac and have full access to the OS X partition out of the box. I can hope...
[1] whether it's better or worse than open source alone is debatable - source can be harder to understand, but it's also never wrong, unlike documentation...
Keep this up and they will end like MS.
No doubt there is reasoning in there besides the "we are an evil company" logic - Apple developers are people too...
Apple not only ignored first major consensus in Games industry it also blocked support on its devices. It also stuck with old OpenGL. This will make gaming on Apple to suck for many years to come.
Which is probably how it should be. I'd rather not lose data to a new filesystem because Apple rushed the thing out without proper testing.
Unless you use multi-key encryption.
I find that a bit odd.
Dominic, lol.
https://en.wikipedia.org/wiki/I/O_Kit http://opensource.apple.com/source/xnu/xnu-3248.20.55/iokit/