{"id":20544,"date":"2018-02-15T16:23:18","date_gmt":"2018-02-15T21:23:18","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=20544"},"modified":"2018-02-19T11:49:58","modified_gmt":"2018-02-19T16:49:58","slug":"data-loss-on-apfs-sparse-disk-images","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2018\/02\/15\/data-loss-on-apfs-sparse-disk-images\/","title":{"rendered":"Data Loss on APFS Sparse Disk Images"},"content":{"rendered":"<p><a href=\"https:\/\/bombich.com\/blog\/2018\/02\/15\/macos-may-lose-data-on-apfs-formatted-disk-images\">Mike Bombich<\/a> (<a href=\"https:\/\/news.ycombinator.com\/item?id=16402754\">Hacker News<\/a>):<\/p>\n<blockquote cite=\"https:\/\/bombich.com\/blog\/2018\/02\/15\/macos-may-lose-data-on-apfs-formatted-disk-images\"><p>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 &#x2013; 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.<\/p><p>[&#8230;]<\/p><p>Following the earlier example, suppose you attempt to copy 200GB of data to that 500GB disk image file. This shouldn&rsquo;t be possible, because there was only 100GB of free space left on the underlying disk. The APFS disk image reports that there&rsquo;s 500GB of free space available, though, so what the heck, let&rsquo;s do this! The first 100GB of data does successfully get written into the disk image file &#x2013; the disk image file has grown now to 100GB. But now the underlying disk is completely full, and the disk image file can no longer grow &#x2013; the diskimages-helper application is getting &ldquo;No space left on device&rdquo; errors when trying to write data to its band files.<\/p><\/blockquote>\n<p>But diskimages-helper simply ignores these errors.<\/p>\n\n<p>Update (2018-02-17): See also: <a href=\"https:\/\/www.theregister.co.uk\/2018\/02\/16\/apple_file_system_bug\/\">Thomas Claburn<\/a>.<\/p>\n\n<p><a href=\"https:\/\/news.ycombinator.com\/item?id=16403218\">kbumsik<\/a>:<\/p>\n<blockquote cite=\"https:\/\/news.ycombinator.com\/item?id=16403218\">\n<p>These are not even complex problems of the new format. It is just Apple forgot to have basic checks. It is like the root access with an empty password incident happened 2 months ago. Why these serious but basic problems happen?<\/p>\n<\/blockquote>\n\n<p>Update (2018-02-19): See also: <a href=\"https:\/\/www.macrumors.com\/2018\/02\/19\/apfs-bug-macos-data-loss-disk-images\/\">MacRumors<\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<p>Mike Bombich (Hacker News): 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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"","apple_news_api_id":"","apple_news_api_modified_at":"","apple_news_api_revision":"","apple_news_api_share_url":"","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[],"tags":[1395,131,1439,1396,32,1529],"class_list":["post-20544","post","type-post","status-publish","format-standard","hentry","tag-apple-file-system-apfs","tag-bug","tag-carbon-copy-cloner","tag-disk-image","tag-macapp","tag-macos-10-13"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/20544","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=20544"}],"version-history":[{"count":4,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/20544\/revisions"}],"predecessor-version":[{"id":20601,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/20544\/revisions\/20601"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=20544"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=20544"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=20544"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}