APFS – A Backup Software Developer’s Perspective
macdaddy.io
macdaddy.io
Even here, there isn't special casing for HFS. Instead, a special library function, copyfile()[1], is used to handle copying files and their associated metadata.
It seems this function was introduced in Mac OS X 10.5, which was after the article you linked. I'd wager copyfile() was introduced in response to the unwieldy file copy mechanics.
After discovering how copyfile() is used in rsync, I am fairly confident that rsync works so well on the new FS as a result of Apple implementing a fairly solid copyfile() for APFS.
[0] https://opensource.apple.com/source/rsync/rsync-20/patches/E... [1] http://www.manpagez.com/man/3/copyfile/
https://github.com/Homebrew/homebrew-core/blob/master/Formul...
”E, --extended-attributes copy extended attributes, resource forks”
edit: not really sure though, because it doesn't seem like this program cares about any of those metadata.
As it mentions in the blog post I come from a background of low level system programming (data recovery, even some kernel extensions, etc). It would have not added significant time to have rolled my own file copy tool. Irrespectively, it took about 1000 hours of work to make that app, as it says in the blog post. Things are nowhere as easy as they look. Doing the actual file copy is the easy part.
It's also not just a GUI. There is loads of code in there that does stuff. For example:
• Scheduling for scheduled backups
• A background daemon that looks for events to launch the UI for scheduled backups
• Manipulation of disks ownership stuff in order to allow backups with permissions to happen correctly
• Volume blessing, etc, in order to make bootable volumes
• Trash handling & maintenance for deleted files
• Deleting files (for removing old backups) And that was just off the top of my head. The app is many thousands of lines of code and it performs literally hundreds of functions. They're nearly all transparent to the user, and that is the idea.
As feelix says it is easy to burn 1000 hours on it. In addition to what feelix says you need to write help, build a site, do a lot of testing, write an installer etc. It does not compare at all to writing a script for technical users.
• Scheduling for scheduled backups
• A background daemon that looks for events to launch the UI for scheduled backups
• Manipulation of disks ownership stuff in order to allow backups with permissions to happen correctly
• Volume blessing, etc, in order to make bootable volumes
• Trash handling & maintenance for deleted files
• Deleting files (for removing old backups)
And that was just off the top of my head. The app is many thousands of lines of code and it performs literally hundreds of functions. They're nearly all transparent to the user, and that is the idea.
Rather light on the substance, few select links (with at least one pointing out) and lots and lots of precisous keywords.
--
Besides, the fact that a _file_ backup tool might need a near complete rewrite with a change of a file system should raise some eyebrows. It might be understandable for an imaging backup or if it was working directly with raw file system, but this one doesn't.
Indeed it's pretty light on content, it's more just a nod to Apple for making this a painless process rather than an excruciating one, as well as an early relay of the experience to others who are going to upgrade who may be harboring some concerns like I was.
The marketing for this site sucks, the software has been around since 2011 and it has nowhere near the marketshare of its competitors because it sucks. If I were really some SEO genius (and you'll see the google rankings are terrible), then this would not be the case. In short, I wish I was the evil genius that you claim, but I'm not. I'm just a dev sharing his experience with the filesystem.
In regards to it not implementing the file copying tool directly - that is covered in the article. The fact that the file copying tool was compiled in 2015 and still works flawlessly is the whole premise of the article stating that it's impressive. And it being a _file_ copying tool is the part that _makes_ it impressive. You seem to have no idea how complex the metadata, built up over 30 years without a rewrite, on HFS+ is. Take a look at BackupBouncer and the associated blog posts to get an idea of the situation. It's pretty crazy.
It appears you've never written file backup software for MacOS. I have, and it's anything but trivial to get all the edge cases right. There are half a dozen different schemes for metadata and you have to handle all of them. There are packages which are really directories. ACLs. Two different kinds of softlinks, plus hardlinks. Finder attributes. Hidden files and caches that usually don't matter, but sometimes do. Creation dates, which don't exist on [older versions of] linux. And legacy cruft like resource forks and file types, which some users still depend on. Spotlight comments (nee Finder comments). Tags. Special locks added by Time Machine. Weird new locks that even root can't penetrate. (You have to fail gracefully on those, as the author points out.)
It's a nightmare. Go write a complete file-level backup system or a transparent VM file-mirroring solution for HFS+ and get back to me. In the meantime, you'll just have to trust the original author when he says that Apple's seamless transition to APFS is astonishing.
But it's not a nightmare. It's just a very large pile of mostly trivial stuff.
Also none of this should require a "complete rewrite" if you are to add support for yet another file system. Saying something like this means that either existing program is a bowl of spaghetti code _or_ that someone is being coy and exaggerates implied difficulties. Are you going to argue with that? Because that was the point you were commenting on.
--Certain edge cases of HFS+ were no longer supported or would now be supported differently.
--The various special-case file-manipulation APIs in MacOS would have changed.
Both the above tend to happen to some extent with every major rev of MacOS and even some minor revs, and they necessitate substantial code changes. The fact that the old code still "just works" with the APFS change I find surprising.
And this in turn, kids, is how you assume bad faith without any reservation or doubt.
It's a really well executed example of content marketing. Whether it was intentional is a separate question, but the post is really quite shallow in technical terms and it exagerrates things here and there, so - yeah, it does look like something written primarily for promo reasons.
To be fair, though, your original comment did come across as negative — was it supposed to?
And yet I've learned more from the post than from this comment.
They have like 6 posts on their blog over several years. Hardly the SEO spinsters one would imagine.
Well, my quick visit to developer discussions forum at Apple website related to macOs Beta quickly revealed a lot of people with the problems. It seems like the author didn't look too far:
https://forums.developer.apple.com/community/beta/macos-1013...
I'm not trying to be negative, I was just pointing out the results of my own research into this question when I was considering to try High Sierra beta. It's not "zero issues" as the original author wrote.
"I converted my Macintosh HD to the APFS and it will not let me boot it up anymore." https://forums.developer.apple.com/thread/80784?q=apfs
"1TB APFS Container Corrupt, Then Reinit to Single Volume" https://forums.developer.apple.com/message/247781#247781
"APFS Brand new filesystem corruption" https://forums.developer.apple.com/message/145039#145039
"Re: Corrupted APFS disk map error" https://forums.developer.apple.com/message/254468#254468
"Device does not contain a valid APFS container" https://forums.developer.apple.com/message/235888#235888
"Re: Files & file changes disappear on APFS volume" https://forums.developer.apple.com/message/241082#241082
"Re: MacOs High Sierra Beta corrupted my disk" https://forums.developer.apple.com/message/244120#244120
I'm not really interested in debating this further, so if you are not satisfied by these references let's agree to disagree :)
Kudos to Apple!
In that case, what difference does the underlying block storage format really matter? If rsync didn’t work, general applications could easily be expected to have issues too.
The theming engine breaks on APFS (all the themes look like one particular theme) - but it works fine if you copy the app to a disk image formatted with any other filesystem, including Case-sensitive APFS (so it only breaks on case-insensitive APFS).
Nothing stood out to me in the dtruss output.
I'm not sure if I'm running into the same problem as you, but I just opened up Bear on my Mac to check and applying the themes themselves works for me, however the preview of each theme is the same.
This is on macOS 10.13 Beta (17A306f) and Bear 1.0.4 (3733).
Does each theme look identical when applied for you?
[0]: https://imgur.com/dBswvky [1]: https://imgur.com/jpHbS4i [2]: https://imgur.com/LxUWWS3
Make an HFS dmg in disk utility and move the app over and it will work fine.
Surprisingly, it works fine on "APFS (Case Sensitive)" too (I had thought maybe it was a case-folding issue).
Edit: Oh, for me the theme works for the list of documents, just not the "edit" panel. The two halves are stored in separate files on disk for some reason. (https://i.imgur.com/ZGS3Fp9.png)
Bear 1.2.5 (4944) and macOS 10.13 (17A362a).
"...it's important to note that Apple still hasn't released any documentation on the "proper" way to create a bootable APFS volume. An example of what they have in mind was released for the very first time when the High Sierra developer release came out a few months ago, but that's it. We basically have to make an educated guess about what they want."
and
"In particular, Apple has further tightened its System Integrity Protection process, and is completely denying access to some files on the startup volume, even when copying to a non-startup volume.... But since APFS is, again, basically undocumented... what could that backup be missing?"
http://www.shirt-pocket.com/blog/index.php/comments/news_on_...
I'd guess that if I wanted to put it out for sale I'd need to add a GUI on top that.
Can anyone shed some light on why backup apps are struggling with preserving metadata?
I started to be disappointed as soon as i read that he is using rsync.
I was expecting someone who writes something like rsync and not a gui for rsync.