{"id":19325,"date":"2017-10-23T16:03:03","date_gmt":"2017-10-23T20:03:03","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=19325"},"modified":"2017-10-29T11:47:36","modified_gmt":"2017-10-29T15:47:36","slug":"backing-up-cloned-apfs-files","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2017\/10\/23\/backing-up-cloned-apfs-files\/","title":{"rendered":"Backing Up Cloned APFS Files"},"content":{"rendered":"<p><a href=\"http:\/\/www.shirt-pocket.com\/blog\/index.php\/shadedgrey\/comments\/fraternal_twins\/\">Dave Nanian<\/a>:<\/p>\n<blockquote cite=\"http:\/\/www.shirt-pocket.com\/blog\/index.php\/shadedgrey\/comments\/fraternal_twins\/\"><p>QThere are cases where we can&rsquo;t make an exact copy of your APFS volume. And Time Machine can&rsquo;t either. Nothing can.<\/p><p>[&#8230;]<\/p><p>The reason is there&rsquo;s no (public) way to find out that two files are actually sharing the same data (they might even only be sharing <em>some<\/em> of the same data, as I explain above). So, when copied, the &ldquo;clone&rdquo; relationship is broken, as is the ten-pounds-of-shit-in-a-five-pound-bag magic. You now have a full ten pounds. It doesn&rsquo;t fit&#8230;so you end up covered in shit.<\/p><p>[&#8230;]<\/p><p>Time Machine <strong>does<\/strong> seem to be able to determine if two files are clones (which I assume it&rsquo;s doing with <strong>private<\/strong> APIs, because I can&rsquo;t find any <a href=\"https:\/\/developer.apple.com\/library\/content\/documentation\/FileManagement\/Conceptual\/APFS_Guide\/ToolsandAPIs\/ToolsandAPIs.html\">documented APIs<\/a> to determine if two files are clones). When it backs up cloned files, it uses hard links to represent them (since HFS+ doesn&rsquo;t support clones, and Time Machine can only back up to HFS+ volumes), and when it restores, it checks to see if those files are clones (which it tracks in a special database), and restores them as clones to APFS&#8230;unless they&rsquo;re restored to an HFS+ volume, where all bets are off.<\/p><p><strong>But even in the best case<\/strong>, restoring to APFS, when files get &lsquo;separated&rsquo; when they&rsquo;re changed, again, only the <strong>part<\/strong> of the file that was changed is separate. The other blocks are still shared. So even though they&rsquo;ve jumped through hoops to maintain the clone relationship, there are lots of cases where Time Machine&rsquo;s own copies will increase in size too, and it happens more and more as the files diverge further.<\/p><p>[&#8230;]<\/p><p>What does this mean for <strong>you<\/strong>? It means you can get in cases where data that fits on a source drive won&rsquo;t fit on a destination, even when the drives are <strong>exactly<\/strong> the same size.<\/p><\/blockquote>\n<p>Previously: <a href=\"https:\/\/mjtsai.com\/blog\/2017\/09\/15\/superduper-and-apfs\/\">SuperDuper and APFS<\/a>.<\/p>\n\n<p>Update (2017-10-29): See also: <a href=\"https:\/\/eclecticlight.co\/2017\/10\/29\/last-week-on-my-mac-time-machine-and-apfs\/\">Howard Oakley<\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<p>Dave Nanian: QThere are cases where we can&rsquo;t make an exact copy of your APFS volume. And Time Machine can&rsquo;t either. Nothing can.[&#8230;]The reason is there&rsquo;s no (public) way to find out that two files are actually sharing the same data (they might even only be sharing some of the same data, as I explain [&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":[2],"tags":[1395,146,537,30,32,1529,1013,369,216],"class_list":["post-19325","post","type-post","status-publish","format-standard","hentry","category-technology","tag-apple-file-system-apfs","tag-backup","tag-filesystem","tag-mac","tag-macapp","tag-macos-10-13","tag-private-api","tag-superduper","tag-timemachine"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/19325","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=19325"}],"version-history":[{"count":2,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/19325\/revisions"}],"predecessor-version":[{"id":19387,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/19325\/revisions\/19387"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=19325"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=19325"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=19325"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}