{"id":24968,"date":"2019-04-11T15:43:05","date_gmt":"2019-04-11T19:43:05","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=24968"},"modified":"2019-12-20T13:41:49","modified_gmt":"2019-12-20T18:41:49","slug":"quantum-computing-and-apfs-free-and-used-space","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2019\/04\/11\/quantum-computing-and-apfs-free-and-used-space\/","title":{"rendered":"Quantum Computing and APFS: Free and Used Space"},"content":{"rendered":"<p><a href=\"https:\/\/eclecticlight.co\/2019\/04\/04\/quantum-computing-and-apfs-free-and-used-space\/\">Howard Oakley<\/a>:<\/p>\n<blockquote cite=\"https:\/\/eclecticlight.co\/2019\/04\/04\/quantum-computing-and-apfs-free-and-used-space\/\">\n<p>In APFS, snapshots are made as part of Time Machine backups, on some occasions such as prior to installing a macOS update, and when the user initiates them. What happens when an APFS snapshot is made is that a complete copy is made of the file system metadata, which is very quick indeed and doesn&rsquo;t involve the copying of any other file data.<\/p>\n<p>However, to preserve all the files at the moment that the snapshot is made, as those files subsequently change, their original data are retained so long as the snapshot is kept. Let&rsquo;s say that, in one snapshot, there&rsquo;s a certain file of 1 GB in size, which then changes completely so the whole 1 GB is rewritten. So long as that snapshot is retained, its original 1 GB of data is retained, as well as its new 1 GB. So although the snapshot itself doesn&rsquo;t take up much space, it stops a lot of old data from being freed up for reuse.<\/p>\n<p>Time Machine purges old snapshots automatically, but by default retains the last 24 hours of hourly snapshots, which will take a total space similar to the amount of data backed up over that period. In my case, that&rsquo;s typically around 30 GB at any time, but if you manipulate large media files, or old snapshots aren&rsquo;t purged properly, it could easily require hundreds of GB.<\/p><\/blockquote>\n<p>I find the whole idea of free space confusing with Mojave and APFS. Last week, after updating Xcode, I started getting warnings that my MacBook Air&rsquo;s SSD was almost full. I deleted about 20 GB of files but saw little improvement in the amount of available space reported by Finder. And I continued to get the warnings. As far as I could tell, based on reports from OmniDiskSweeper and trying to figure out which files had been deleted and added, I should have netted about 14 GB more free space than I started with, yet Finder showed about 6 GB <em>less<\/em>.<\/p>\n<p>My first thought was that the culprit was snapshots, but Disk Utility showed no purgeable space, and <code>tmutil listlocalsnapshots<\/code> showed no snapshots. I guess this indicates that the disk really is almost full, but I can&rsquo;t figure out why.<\/p>\n<p>My current theory is that the problem is due to a 20 GB <tt>proxies<\/tt> folder in Photos&rsquo;s library (which is strangely not included in Manage Storage&rsquo;s report). I don&rsquo;t have a measurement of how large this was before, but I suspect it used to be much smaller. It&rsquo;s not clear how I might compact it or why Photos isn&rsquo;t automatically deleting old data now that it can tell that the disk is almost full. I will probably end up deleting the Photos library and syncing a new one down from iCloud. But that&rsquo;s only a potential solution because this Mac doesn&rsquo;t contain any Photos projects; those are not stored in the cloud and so would be lost if I were to attempt this.<\/p>\n\n<p>Previously:<\/p>\n<ul>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2019\/03\/07\/how-time-machine-makes-backups-with-apfs\/\">How Time Machine Makes Backups With APFS<\/a><\/li>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2019\/02\/08\/the-definitive-guide-to-icloud-photos-in-2019\/\">The Definitive Guide to iCloud Photos in 2019<\/a><\/li>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2018\/12\/06\/how-omnidisksweeper-reports-free-space\/\">How OmniDiskSweeper Reports Free Space<\/a><\/li>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2018\/09\/25\/photos-needs-better-storage-management\/\">Photos Needs Better Storage Management<\/a><\/li>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2017\/11\/13\/local-time-machine-uses-apfs-snapshots\/\">Local Time Machine Uses APFS Snapshots<\/a><\/li>\n<\/ul>\n\n<p>Update (2019-04-11): My iMac does show Time Machine snapshots, yet Disk Utility still says there&rsquo;s zero purgeable space.<\/p>\n\n<p id=\"quantum-computing-and-apfs-free-and-used-space-update-2019-04-23\">Update (2019-04-23): <a href=\"https:\/\/twitter.com\/Tricertops\/status\/1120591283523858433\">Tricertops<\/a> (via <a href=\"https:\/\/twitter.com\/steipete\/status\/1120596709736947712\">Peter Steinberger<\/a>):<\/p>\n<blockquote cite=\"https:\/\/twitter.com\/Tricertops\/status\/1120591283523858433\">\n<p>I have 40 GB of free space, but Xcode cannot be updated. Maybe the next macOS will finally fix things? Or the one after that?<\/p>\n<\/blockquote>\n<p>I just had the same problem updating Xcode on a Mac that purportedly had 30 GB of free space, with the expanded .xip file needing less than 10 GB. After waiting a while, the displayed amount of free space didn&rsquo;t change, but expanding the .xip no longer reported a disk space error.<\/p>\n\n<p id=\"quantum-computing-and-apfs-free-and-used-space-update-2019-04-28\">Update (2019-04-28): <a href=\"https:\/\/twitter.com\/mattbirchler\/status\/1122123301210468353\">Matt Birchler<\/a>:<\/p>\n<blockquote cite=\"https:\/\/twitter.com\/mattbirchler\/status\/1122123301210468353\">\n<p>iPad: You have about 70GB of free space<br \/>\nMe: I&rsquo;d like to download this 2GB file from iCloud<br \/>\niPad: I don&rsquo;t think so, chief<br \/>\nMe: Ok, I&rsquo;ll remove some stuff manually, can I see what files are taking up space?<br \/>\niPad: What sort of agreement do you think we have?<\/p>\n<\/blockquote>\n\n<p id=\"quantum-computing-and-apfs-free-and-used-space-update-2019-05-09\">Update (2019-05-09): <a href=\"https:\/\/macperformanceguide.com\/blog\/2019\/20190507_1926-macOS-Mojave-switch.html\">Lloyd Chambers<\/a>:<\/p>\n<blockquote cite=\"https:\/\/macperformanceguide.com\/blog\/2019\/20190507_1926-macOS-Mojave-switch.html\">\n<p>The purgeable space concept on APFS is mystifying.<\/p>\n<\/blockquote>\n\n<p id=\"quantum-computing-and-apfs-free-and-used-space-update-2019-07-29\">Update (2019-07-29): I recently encountered a problem where I couldn&rsquo;t back up via SuperDuper because the destination drive had 250 GB free, but it was all purgeable. Both <code>tmutil<\/code> and <code>diskutil<\/code> reported no space consumed by APFS snapshots, so it&rsquo;s not clear how I could ever purge that space. I ended up having to reformat the drive.<\/p>\n\n<p id=\"quantum-computing-and-apfs-free-and-used-space-update-2019-09-17\">Update (2019-09-17): <a href=\"https:\/\/twitter.com\/atomicbird\/status\/1173694827604729856\">Tom Harrington<\/a>:<\/p>\n<blockquote cite=\"https:\/\/twitter.com\/atomicbird\/status\/1173694827604729856\">\n<p>I have 78GB free on this Mac according to Finder but I can&rsquo;t decompress Xcode because there&rsquo;s not enough space. I know it&rsquo;s APFS stuff and can fix, but how do non geeks deal with this kind of thing?<\/p>\n<\/blockquote>\n\n<p id=\"quantum-computing-and-apfs-free-and-used-space-update-2019-12-20\">Update (2019-12-20): <a href=\"https:\/\/twitter.com\/OluseyiSonaiya\/status\/1181480652509794304\">Oluseyi Sonaiya<\/a>:<\/p>\n<blockquote cite=\"https:\/\/twitter.com\/OluseyiSonaiya\/status\/1181480652509794304\"><p>32 GB free.<\/p><p>Update Xcode to 11.1<\/p><p>20 minutes later: &ldquo;This application can not be installed. Insufficient disk space.&rdquo;<\/p><p>20 GB free.<\/p><p>It&rsquo;s insufficient because YOOOOOOUUUU took up 12 GB?!<\/p><\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Howard Oakley: In APFS, snapshots are made as part of Time Machine backups, on some occasions such as prior to installing a macOS update, and when the user initiates them. What happens when an APFS snapshot is made is that a complete copy is made of the file system metadata, which is very quick indeed [&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":"2019-04-11T19:43:08Z","apple_news_api_id":"e3b8032f-4a25-4d33-b9ee-1651edfe351b","apple_news_api_modified_at":"2019-12-20T18:41:52Z","apple_news_api_revision":"AAAAAAAAAAAAAAAAAAAABg==","apple_news_api_share_url":"https:\/\/apple.news\/A47gDL0olTTO57hZR7f41Gw","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,538,458,1142,30,1609,927,216],"class_list":["post-24968","post","type-post","status-publish","format-standard","hentry","category-technology","tag-apple-file-system-apfs","tag-diskutility","tag-finder","tag-icloud-photo-library","tag-mac","tag-macos-10-14","tag-photos-app","tag-timemachine"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/24968","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=24968"}],"version-history":[{"count":8,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/24968\/revisions"}],"predecessor-version":[{"id":27640,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/24968\/revisions\/27640"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=24968"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=24968"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=24968"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}