APFS Bug in macOS High Sierra Can Cause Data Loss When Writing to Disk Images
Feb 19, 2018 1:48 am PST by Tim Hardwick
Apple's APFS file system included in macOS High Sierra suffers from a disk image vulnerability that in certain circumstances can lead to data loss, according to the creator of Carbon Copy Cloner.

In a blog post last Thursday, software developer Mike Bombich explained that he had uncovered the data writing flaw in the Apple File System, or APFS, through his regular work with "sparse" disk images.


For those who aren't familiar with the term, a sparse disk image is basically a file that macOS mounts on the desktop and treats as if it was a physically attached drive with a classic disk volume structure. The flexibility of sparse disk images means they are commonly used in the course of performing backup and disk cloning operations, hence Bombich's extensive experience with them.
Earlier this week I noticed that an APFS-formatted sparsebundle disk image volume showed ample free space, despite that the underlying disk was completely full. Curious, I copied a video file to the disk image volume to see what would happen. The whole file copied without error! I opened the file, verified that the video played back start to finish, checksummed the file – as far as I could tell, the file was intact and whole on the disk image. When I unmounted and remounted the disk image, however, the video was corrupted. If you've ever lost data, you know the kick-in-the-gut feeling that would have ensued. Thankfully, I was just running some tests and the file that disappeared was just test data.
Two related problems are identified by Bombich, above. The first is that the free space on the APFS-formatted sparse disk image doesn't update as it should when the free space on the underlying physical host disk is reduced. The second problem is the lack of error reports when write requests fail to dynamically grow the disk image, resulting in data being "written" into a void. Bombich tracks both bugs back to macOS's background "diskimages-helper" application service, which he has since reported to Apple.


Every installation of High Sierra on Macs with all-flash storage converts the existing file system to APFS, which is optimized for modern storage systems like solid-state drives. However, as Bombich notes, ordinary APFS volumes like SSD startup disks are not affected by the problem described above, so the vast majority of users won't be affected by it – the flaw is most applicable when making backups to network volumes. Bombich says Carbon Copy Cloner will not support AFPS-formatted sparse disk images until Apple resolves the issue.

The APFS flaw follows the discovery of another bug in Apple's operating systems that received extensive coverage last week. That bug is induced by sending a specific character in the Indian language Telugu, which causes certain apps on iPhones, iPads, and Macs to freeze up and become unresponsive. The Telugu character bug has already been fixed in Apple's upcoming iOS 11.3 and macOS 10.13.4 software updates.

Related Roundup: macOS High Sierra
Tag: APFS

Top Rated Comments

(View all)

8 months ago
Glad I reverted to Sierra when I deemed High Sierra a S-show after a couple of weeks. There seems to be no end to Apple's incompetence with this OS.
Rating: 49 Votes
8 months ago
Another day, another bug. How very Apple-esque. #ifstevejobswasalive #firetimcook
Rating: 26 Votes
8 months ago
Ah this isn't important. Who cares about data.

People want..........new emoji! ;)
Rating: 24 Votes
8 months ago
quote: The bug has already been fixed in Apple's upcoming iOS 11.3 and macOS 10.13.4 software updates.
Rating: 22 Votes
8 months ago
High Sierra has been a complete disaster for me. My computer locks up for 5-10 seconds every few hours. Probably some memory leaks or something. Either way this is really pathetic, even windows works better than this.
Rating: 18 Votes
8 months ago

“Bombich”... you can’t make this stuff up.


Making fun of surnames. Feels like primary school already.
Rating: 16 Votes
8 months ago
Happy to be a paying CCC user; thanks!
Rating: 15 Votes
8 months ago

quote: The bug has already been fixed in Apple's upcoming iOS 11.3 and macOS 10.13.4 software updates.


That's a completely different bug.

Glad I reverted to Sierra when I deemed High Sierra a S-show after a couple of weeks. There seems to be no end to Apple's incompetence with this OS.


You probably weren't affected by this bug. Do you create your own sparse disk images or use CCC?

Wow, this makes me wonder. Did Apple and APFS destroy my only 2 year old Seagate drive with mostly disk images on it?


Were they sparse? Did you convert their contents to APFS? And then put in more data than there was room for?

I wonder if this is related to high sierra suddenly invalidating my time machine backups to my NAS,


No. Time Machine doesn't use APFS.

Likely not - Time Machine is not APFS, norvis it a disk image


Time Machine on a network volume is indeed a sparse disk image. It doesn't use APFS, however.

Filesystem bugs shouldn't happen - at least destructive ones like this. I wonder if they should have slowed the process down with APFS and let it age a little more so these bugs can be identified before they affect us.


They arguably have — it's why, for instance, APFS still isn't recommended on Fusion Drive.

Doesn't excuse this bug, but it does appear that they realized there's a lot of special cases that APFS doesn't yet handle well. (Rather, more specifically, the toolchain such as diskimages-helper hasn't yet been adapted for APFS.)

It's a normal bug, stop the drama.


It's a severe data loss bug. It doesn't affect most users, but it's quite serious nonetheless.
Rating: 14 Votes
8 months ago
I wonder if this is related to high sierra suddenly invalidating my time machine backups to my NAS, and demanding to do a new full. (Loosing two years worth of history). Then doing it again 2 weeks later.
Rating: 14 Votes
8 months ago
OMG Apple come on
Rating: 13 Votes

[ Read All Comments ]
Newer Article Older Article