<?xml version="1.0" encoding="utf-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Posts about macOS</title><link>https://chriswarrick.com/</link><atom:link href="https://chriswarrick.com/blog/tags/macos.xml" rel="self" type="application/rss+xml" /><description>A rarely updated blog, mostly about programming.</description><lastBuildDate>Mon, 26 Sep 2022 17:45:00 GMT</lastBuildDate><generator>https://github.com/Kwpolska/YetAnotherBlogGenerator</generator><item><title>Reinstalling macOS: What To Try When All Else Fails</title><dc:creator>Chris Warrick</dc:creator><link>https://chriswarrick.com/blog/2020/06/03/reinstalling-macos-what-to-try-when-all-else-fails/</link><pubDate>Wed, 03 Jun 2020 21:00:00 GMT</pubDate><guid>https://chriswarrick.com/blog/2020/06/03/reinstalling-macos-what-to-try-when-all-else-fails/</guid><description>
Recently, I reinstalled macOS on my device. Throughout the process, many
attempts failed miserably. But I now have some experience and assorted hints on
what to try (as long as you’ve got an Intel Mac).
</description><content:encoded><![CDATA[
<p>Recently, I reinstalled macOS on my device. Throughout the process, many
attempts failed miserably. But I now have some experience and assorted hints on
what to try (as long as you’ve got an Intel Mac).</p>



<p><strong>DISCLAIMER:</strong> All information in this post is provided as-is, and some of it may
void your warranty. Neither Chris Warrick nor Apple will be responsible for any
damage to your devices caused as a result of using information in this post.</p>
<p><strong>Note:</strong> This blog post is written for Intel Macs, particularly those that can
boot OS X El Capitan (or macOS Sierra, but that’s untested). If your Mac can’t, you’ll need to look for help
elsewhere. If you’ve got an Apple Silicon Mac, you probably want to perform
<a class="reference external" href="https://support.apple.com/guide/apple-configurator-mac/revive-or-restore-a-mac-with-apple-silicon-apdd5f3c75ad/mac">a DFU restore</a>
(requires another Mac and a USB-C cable.)</p>
<section id="making-install-media-with-el-capitan-with-access-only-to-recovery">
<h1>Making install media with El Capitan (with access only to Recovery)</h1>
<p>The best, safest, least error-prone way to do an install is with a USB stick.
Unfortunately, making a USB stick with the macOS installer on it is a nuisance.
The expected way to produce macOS install media is to download the installer
from App Store/Software Update, and run the <code class="docutils literal">createinstallmedia</code> command-line
program included with that installer app. All is well, as long as macOS works.
If it doesn’t, and Recovery can’t install it for you, that can be difficult to
solve.</p>
<p>Apple does not make macOS images publicly available. That’s probably to make
Hackintoshing this little bit harder, but this also affects legitimate users.
The only thing you can easily download from Apple is El Capitan. Apple offers
<a class="reference external" href="https://support.apple.com/en-us/HT206886">InstallMacOSX.dmg</a> on their
website.</p>
<p>There are also some other downloads available:</p>
<ul class="simple">
<li><p>there’s a Sierra download, with a broken link, although it can be fixed by changing <code class="docutils literal"><span class="pre">updates-http</span></code> to <code class="docutils literal">updates</code>: <a class="reference external" href="https://updates.cdn-apple.com/2019/cert/061-39476-20191023-48f365f4-0015-4c41-9f44-39d3d2aca067/InstallOS.dmg">get Sierra installer</a>.</p></li>
<li><p>if you need something older than El Capitan, downloads are available as far
back as Lion, although these might not have the <code class="docutils literal">createinstallmedia</code> tool
required for this procedure.</p></li>
</ul>
<p>This post assumes you’re working with El Capitan; a quick look though that file
suggests the instructions in this post should work with Sierra as well.</p>
<p>If you take a look at the instructions, you will see that this is
<em>not</em> a bootable OS X image. This image has a <code class="docutils literal">.pkg</code> package. This package is
expected to install <code class="docutils literal">/Applications/Install OS X El Capitan.app</code>. Well, we’re
in recovery, we can’t install stuff. So, let’s do this the manual way.</p>
</section>
<section id="manually-installing-pkg-files">
<h1>Manually installing .pkg files</h1>
<p>Turns out the <code class="docutils literal">.pkg</code> format is just an archives all the way down, with all
archives being different formats (at least three).</p>
<aside class="float-md-right mt-md-0 sidebar">
<p class="sidebar-title">macOS flat package format</p>
<p>You can find more resources about the flat package format, <a class="reference external" href="http://s.sudre.free.fr/Stuff/Ivanhoe/FLAT.html">one</a> or <a class="reference external" href="https://matthew-brett.github.io/docosx/flat_packages.html#payload_">two</a>, although
this was deduced from the <code class="docutils literal">file</code> command and The Unarchiver.</p>
</aside>
<p>The first archive is the <code class="docutils literal">.pkg</code> file itself. Those files are in <a class="reference external" href="https://en.wikipedia.org/wiki/Xar_(archiver)">XAR format</a>, which was invented by the
OpenDarwin community. You can either extract it with <code class="docutils literal">pkgutil <span class="pre">--expand</span>
foo.pkg foo_files</code> (the last argument is the destination directory, can be
anything, will be created by <code class="docutils literal">pkgutil</code>) if you have access to that command (it’s
available in Recovery OS), or you can try the <code class="docutils literal">xar</code> utility as <code class="docutils literal">xar <span class="pre">-xf</span>
foo.pkg</code>. The structure produced by both tools is a bit different, but we can
work with both.</p>
<p>The second archive-in-archive is the <code class="docutils literal">Payload</code>. It’s a gzipped cpio archive
that contains the files installed by this package.  If you have BSD tar
(default on macOS, easily installable on Linux), you can just do <code class="docutils literal">tar <span class="pre">-xvf</span> Payload</code>.
Otherwise, you can use <code class="docutils literal">gunzip <span class="pre">-c</span> Payload | cpio <span class="pre">-i</span></code> (or <code class="docutils literal">gzcat</code>). That
will extract all the files the package has.</p>
<p>Another nested archive is the <code class="docutils literal">Scripts</code> archive, although note that
<code class="docutils literal">pkgutil</code> will extract it automatically. If it’s not extracted, it’s actually
<code class="docutils literal">.cpio.gz</code> again, with the same way to extract it.</p>
<p>(PS.  If you have <code class="docutils literal">7z</code> around (on Windows/Linux as well), you can just point
it at all the compressed files mentioned in this paragraph.)</p>
</section>
<section id="making-install-media-out-of-partial-macos-installers-not-a-valid-os-installer-application">
<h1>Making install media out of partial macOS installers (“not a valid OS installer application”)</h1>
<section id="a-from-the-el-capitan-download">
<h2>a. From the El Capitan download</h2>
<p>Let’s expand the El Capitan package.</p>
<div class="code"><pre class="code console"><a id="rest_code_a12b8e2380434f0097be4f820a042a57-1" name="rest_code_a12b8e2380434f0097be4f820a042a57-1" href="https://chriswarrick.com/blog/2020/06/03/reinstalling-macos-what-to-try-when-all-else-fails/#rest_code_a12b8e2380434f0097be4f820a042a57-1"></a><span class="gp">$ </span><span class="o">(</span>mount<span class="w"> </span>the<span class="w"> </span>DMG<span class="w"> </span><span class="k">in</span><span class="w"> </span>Disk<span class="w"> </span>Utility<span class="o">)</span>
<a id="rest_code_a12b8e2380434f0097be4f820a042a57-2" name="rest_code_a12b8e2380434f0097be4f820a042a57-2" href="https://chriswarrick.com/blog/2020/06/03/reinstalling-macos-what-to-try-when-all-else-fails/#rest_code_a12b8e2380434f0097be4f820a042a57-2"></a><span class="gp">$ </span>cp<span class="w"> </span>/Volumes/Install<span class="se">\ </span>OS<span class="se">\ </span>X/InstallMacOSX.pkg<span class="w"> </span>/Volumes/Macintosh<span class="se">\ </span>HD/
<a id="rest_code_a12b8e2380434f0097be4f820a042a57-3" name="rest_code_a12b8e2380434f0097be4f820a042a57-3" href="https://chriswarrick.com/blog/2020/06/03/reinstalling-macos-what-to-try-when-all-else-fails/#rest_code_a12b8e2380434f0097be4f820a042a57-3"></a><span class="go">     (Or copy it to some other volume you can write to; NOT the USB stick)</span>
<a id="rest_code_a12b8e2380434f0097be4f820a042a57-4" name="rest_code_a12b8e2380434f0097be4f820a042a57-4" href="https://chriswarrick.com/blog/2020/06/03/reinstalling-macos-what-to-try-when-all-else-fails/#rest_code_a12b8e2380434f0097be4f820a042a57-4"></a><span class="gp">$ </span><span class="nb">cd</span><span class="w"> </span>/Volumes/Macintosh<span class="se">\ </span>HD/
<a id="rest_code_a12b8e2380434f0097be4f820a042a57-5" name="rest_code_a12b8e2380434f0097be4f820a042a57-5" href="https://chriswarrick.com/blog/2020/06/03/reinstalling-macos-what-to-try-when-all-else-fails/#rest_code_a12b8e2380434f0097be4f820a042a57-5"></a><span class="gp">$ </span>pkgutil<span class="w"> </span>--expand<span class="w"> </span>InstallMacOSX.pkg<span class="w"> </span>elcapitan
<a id="rest_code_a12b8e2380434f0097be4f820a042a57-6" name="rest_code_a12b8e2380434f0097be4f820a042a57-6" href="https://chriswarrick.com/blog/2020/06/03/reinstalling-macos-what-to-try-when-all-else-fails/#rest_code_a12b8e2380434f0097be4f820a042a57-6"></a><span class="gp">$ </span>ls<span class="w"> </span>-F<span class="w"> </span>elcapitan
<a id="rest_code_a12b8e2380434f0097be4f820a042a57-7" name="rest_code_a12b8e2380434f0097be4f820a042a57-7" href="https://chriswarrick.com/blog/2020/06/03/reinstalling-macos-what-to-try-when-all-else-fails/#rest_code_a12b8e2380434f0097be4f820a042a57-7"></a><span class="go">Distribution*       InstallMacOSX.pkg/ Resources/</span>
<a id="rest_code_a12b8e2380434f0097be4f820a042a57-8" name="rest_code_a12b8e2380434f0097be4f820a042a57-8" href="https://chriswarrick.com/blog/2020/06/03/reinstalling-macos-what-to-try-when-all-else-fails/#rest_code_a12b8e2380434f0097be4f820a042a57-8"></a><span class="gp">$ </span><span class="nb">cd</span><span class="w"> </span>elcapitan/InstallMacOSX.pkg/
<a id="rest_code_a12b8e2380434f0097be4f820a042a57-9" name="rest_code_a12b8e2380434f0097be4f820a042a57-9" href="https://chriswarrick.com/blog/2020/06/03/reinstalling-macos-what-to-try-when-all-else-fails/#rest_code_a12b8e2380434f0097be4f820a042a57-9"></a><span class="gp">$ </span>tar<span class="w"> </span>-xvf<span class="w"> </span>Payload
<a id="rest_code_a12b8e2380434f0097be4f820a042a57-10" name="rest_code_a12b8e2380434f0097be4f820a042a57-10" href="https://chriswarrick.com/blog/2020/06/03/reinstalling-macos-what-to-try-when-all-else-fails/#rest_code_a12b8e2380434f0097be4f820a042a57-10"></a><span class="go">x .</span>
<a id="rest_code_a12b8e2380434f0097be4f820a042a57-11" name="rest_code_a12b8e2380434f0097be4f820a042a57-11" href="https://chriswarrick.com/blog/2020/06/03/reinstalling-macos-what-to-try-when-all-else-fails/#rest_code_a12b8e2380434f0097be4f820a042a57-11"></a><span class="go">x ./Install OS X El Capitan.app</span>
<a id="rest_code_a12b8e2380434f0097be4f820a042a57-12" name="rest_code_a12b8e2380434f0097be4f820a042a57-12" href="https://chriswarrick.com/blog/2020/06/03/reinstalling-macos-what-to-try-when-all-else-fails/#rest_code_a12b8e2380434f0097be4f820a042a57-12"></a><span class="go">x ./Install OS X El Capitan.app/Contents</span>
<a id="rest_code_a12b8e2380434f0097be4f820a042a57-13" name="rest_code_a12b8e2380434f0097be4f820a042a57-13" href="https://chriswarrick.com/blog/2020/06/03/reinstalling-macos-what-to-try-when-all-else-fails/#rest_code_a12b8e2380434f0097be4f820a042a57-13"></a><span class="go">…</span>
</pre></div>
<p>We’ve got the installer app, which is what we need to create an install image.
Great, let’s try it!</p>
<div class="code"><pre class="code console"><a id="rest_code_dd7186a14dd947c1acd6377af6fa0a91-1" name="rest_code_dd7186a14dd947c1acd6377af6fa0a91-1" href="https://chriswarrick.com/blog/2020/06/03/reinstalling-macos-what-to-try-when-all-else-fails/#rest_code_dd7186a14dd947c1acd6377af6fa0a91-1"></a><span class="gp"># </span><span class="s2">&quot;Install OS X El Capitan.app/Contents/Resources/createinstallmedia&quot;</span><span class="w"> </span>--volume<span class="w"> </span>/Volumes/MyBlankUSBDrive<span class="w"> </span>--applicationpath<span class="w"> </span><span class="s2">&quot;Install OS X El Capitan.app&quot;</span>
<a id="rest_code_dd7186a14dd947c1acd6377af6fa0a91-2" name="rest_code_dd7186a14dd947c1acd6377af6fa0a91-2" href="https://chriswarrick.com/blog/2020/06/03/reinstalling-macos-what-to-try-when-all-else-fails/#rest_code_dd7186a14dd947c1acd6377af6fa0a91-2"></a><span class="go">Install OS X El Capitan.app does not appear to be a valid OS installer application.</span>
</pre></div>
<p>Oh, we’ve got a problem. Turns out there’s one more thing we need to take care
of, and it’s the scripts. MacOS packages have scripts, typically shell scripts,
that are run at various stages in the install process. We can look at the
<code class="docutils literal">PackageInfo</code> file, or just look in the <code class="docutils literal">Scripts</code> folder, to see that
there’s an <code class="docutils literal">link_package</code> script we need to run. This script creates a
<code class="docutils literal">Contents/SharedSupport</code> directory inside the installer app, and
copies/hardlinks the <code class="docutils literal">InstallESD.dmg</code> file (which is the install formerly-DVD
image) to that directory. Let’s try doing this on our own:</p>
<div class="code"><pre class="code console"><a id="rest_code_02681eda476540b2a277870eab700139-1" name="rest_code_02681eda476540b2a277870eab700139-1" href="https://chriswarrick.com/blog/2020/06/03/reinstalling-macos-what-to-try-when-all-else-fails/#rest_code_02681eda476540b2a277870eab700139-1"></a><span class="gp">$ </span>mkdir<span class="w"> </span><span class="s2">&quot;Install OS X El Capitan.app/Contents/SharedSupport&quot;</span>
<a id="rest_code_02681eda476540b2a277870eab700139-2" name="rest_code_02681eda476540b2a277870eab700139-2" href="https://chriswarrick.com/blog/2020/06/03/reinstalling-macos-what-to-try-when-all-else-fails/#rest_code_02681eda476540b2a277870eab700139-2"></a><span class="gp">$ </span>mv<span class="w"> </span>InstallESD.dmg<span class="w"> </span><span class="s2">&quot;Install OS X El Capitan.app/Contents/SharedSupport&quot;</span>
<a id="rest_code_02681eda476540b2a277870eab700139-3" name="rest_code_02681eda476540b2a277870eab700139-3" href="https://chriswarrick.com/blog/2020/06/03/reinstalling-macos-what-to-try-when-all-else-fails/#rest_code_02681eda476540b2a277870eab700139-3"></a><span class="gp"># </span><span class="s2">&quot;Install OS X El Capitan.app/Contents/Resources/createinstallmedia&quot;</span><span class="w"> </span>--volume<span class="w"> </span>/Volumes/MyBlankUSBDrive<span class="w"> </span>--applicationpath<span class="w"> </span><span class="s2">&quot;Install OS X El Capitan.app&quot;</span>
<a id="rest_code_02681eda476540b2a277870eab700139-4" name="rest_code_02681eda476540b2a277870eab700139-4" href="https://chriswarrick.com/blog/2020/06/03/reinstalling-macos-what-to-try-when-all-else-fails/#rest_code_02681eda476540b2a277870eab700139-4"></a><span class="go">Ready to start.</span>
<a id="rest_code_02681eda476540b2a277870eab700139-5" name="rest_code_02681eda476540b2a277870eab700139-5" href="https://chriswarrick.com/blog/2020/06/03/reinstalling-macos-what-to-try-when-all-else-fails/#rest_code_02681eda476540b2a277870eab700139-5"></a><span class="go">To continue we need to erase the disk at /Volumes/MyBlankUSBDrive.</span>
<a id="rest_code_02681eda476540b2a277870eab700139-6" name="rest_code_02681eda476540b2a277870eab700139-6" href="https://chriswarrick.com/blog/2020/06/03/reinstalling-macos-what-to-try-when-all-else-fails/#rest_code_02681eda476540b2a277870eab700139-6"></a><span class="go">If you wish to continue type (Y) then press return:</span>
</pre></div>
<p>And it works! <code class="docutils literal">createinstallmedia</code> will now produce valid install media.</p>
</section>
<section id="b-installer-from-recovery-app-store-any-macos-version">
<h2>b. Installer from Recovery/App Store (any macOS version)</h2>
<p>If you are in Recovery, you can find an Install app on the filesystem. If you
try to run it, you will get the same error as in the previous paragraph:</p>
<div class="code"><pre class="code text"><a id="rest_code_0447ee55c787469fb1388d1fd77a288f-1" name="rest_code_0447ee55c787469fb1388d1fd77a288f-1" href="https://chriswarrick.com/blog/2020/06/03/reinstalling-macos-what-to-try-when-all-else-fails/#rest_code_0447ee55c787469fb1388d1fd77a288f-1"></a>Install macOS Catalina.app does not appear to be a valid OS installer application.
</pre></div>
<p>This also happens with some older macOS versions, where you get a small
<code class="docutils literal">.app</code> from the App Store, and that app does the actual download.</p>
<p>Whatever the issue was, we need to download the install files with the
installer. Open the installer and let it run until the download finishes. If
the app asks you to reboot, quit it at this point. If it never asks, you can
still find a way to get files out (after a failed install, they should not be
removed).</p>
<p>The install files can be found in <code class="docutils literal">/macOS Install Data</code> on the destination
volume. For older versions, you will just have <code class="docutils literal">InstallESD.dmg</code>, newer
versions add more and more files, some of which are hardware-specific (and
Catalina has <code class="docutils literal">InstallESDDmg.pkg</code>, because Apple loves nesting archives for no
reason!). However many files you find, you can just:</p>
<ol class="arabic simple">
<li><p>Copy <code class="docutils literal">Install macOS Catalina.app</code> to a read-write volume.</p></li>
<li><p>Copy the contents of <code class="docutils literal">/Volumes/TARGET/macOS Install Data</code> to <code class="docutils literal">Install
macOS Catalina.app/Content/SharedSupport</code>. Make sure you account for hidden
files, if any (copy the entire directory). If you did this correctly,
<code class="docutils literal">InstallESDDmg.pkg</code> (or <code class="docutils literal">InstallESD.dmg</code> on older verisons) is in the <code class="docutils literal">SharedSupport</code>
directory (not in a subdirectory).</p></li>
<li><p>Run <code class="docutils literal">createinstallmedia</code>. It should now consider the installer valid. The
available options differ slightly depending on the OS version.</p></li>
</ol>
</section>
</section>
<section id="el-capitan-installer-cant-be-verified">
<h1>El Capitan installer can’t be verified</h1>
<p>If you get this error, it might be because Apple’s signing keys expired, or
because of other date/time weirdness. Regardless, you can force an install if
you are sure the installer is not damaged with this command <a class="reference external" href="https://apple.stackexchange.com/questions/216730/this-copy-of-the-install-os-x-el-capitan-application-cant-be-verified-it-may-h">(source)</a>:</p>
<div class="code"><pre class="code console"><a id="rest_code_e9c19fefd716419597578cd44c42b942-1" name="rest_code_e9c19fefd716419597578cd44c42b942-1" href="https://chriswarrick.com/blog/2020/06/03/reinstalling-macos-what-to-try-when-all-else-fails/#rest_code_e9c19fefd716419597578cd44c42b942-1"></a><span class="gp"># </span>installer<span class="w"> </span>-pkg<span class="w">  </span>/Volumes/Mac<span class="se">\ </span>OS<span class="se">\ </span>X<span class="se">\ </span>Install<span class="se">\ </span>DVD/Packages/OSInstall.mpkg<span class="w"> </span>-target<span class="w"> </span>/Volumes/<span class="s2">&quot;XXX&quot;</span>
</pre></div>
</section>
<section id="bonus-tidbit-1-how-the-download-works">
<h1>Bonus tidbit 1: how the download works</h1>
<p>While messing with all the installer stuff, I found out a few
interesting/worrying things about the download process.</p>
<p>The first one is that the macOS installer uses plain HTTP without encryption to
download files. That opens you to all the standard issues — an attacker can
replace files you download, and the protocol doesn’t do anything to detect
errors (the installer will verify files, but where do the checksums come
from?).</p>
<p>The second one is how the download happens. You might have noticed it to be a
bit slower than usual traffic. The download happens in 10 MB chunks, using the
<code class="docutils literal">Range</code> HTTP header. The installer asks for 10 MB, gets it, saves, asks for
another chunk. Repeat that over 800 times, and the overhead of the entire HTTP
dance becomes noticeable. (I haven’t checked, but I hope the installer at least
uses Keep-Alive. I wouldn’t be particularly surprised if it didn’t, though.)</p>
<p>But this raises another question. The servers clearly support partial downloads.
And yet, if your network disconnects during the download, your download
progress for that file is reset, and in Catalina, you can go from 8 GB back to
500 MB if you’re particularly unlucky. The question is, why? This
infrastructure should make it trivial to continue the download, perhaps
discarding the most recent chunk if you’re concerned about that download of it
being unsuccessful.</p>
</section>
<section id="bonus-tidbit-2-using-terminal-from-setup-assistant">
<h1>Bonus tidbit 2: using Terminal from Setup Assistant</h1>
<p>The first time you boot a Mac after a clean install, it starts the Setup
Assistant. This app asks for basic OS settings (locale, date/time, user
accounts), and also lets you restore user data from backups.</p>
<p>Sometimes, you might want to access the Terminal or Console from that screen.
You can do that with Ctrl + Opt + Cmd + T and Ctrl + Opt + Cmd + C respectively <a class="reference external" href="https://chris-collins.io/2018/03/15/Using-Terminal-At-macOS-Setup-Assistant/">(source)</a>.</p>
<p>How could that come in handy? For example, if you want to check if the backup
drive still worked and if the process isn’t stuck (I wrote a test file and also
checked <code class="docutils literal">top</code>).</p>
</section>
<section id="bonus-tidbit-3-creating-an-image-of-the-install-media-might-not-work">
<h1>Bonus tidbit 3: creating an image of the install media might not work</h1>
<p>A few months later, in December, I upgraded to Big Sur and then installed Windows 10
alongside it in Boot Camp. I then did some more hacks, which led to
two unbootable OSes.</p>
<p>As part of the upgrade, I had prepared install media and used it to install (so
it wouldn’t fail, as it did last time), and made a <code class="docutils literal">.dmg</code> of it with Disk
Utility. (Also, Apple won’t tell you this, but you need to give Disk Utility
<em>Full Disk Access</em> for disk imaging to work. Otherwise, you get a cryptic
error.) I erased the USB drive after installing, but hey, I could get it back.
I booted into Internet Recovery and restored my image. Big Sur failed to boot
and showed a <a class="reference external" href="https://support.apple.com/en-us/HT210901">🚫 sign</a>. I tried
restoring my Catalina image from the previous reinstall, and that didn’t work
due to a size mismatch. I used a different USB drive than these months ago (I
didn’t have that one with me at the moment), and apparently the one I used had
a different size (both are marketed as 16 GB). The images could be mounted
fine, and <code class="docutils literal">createinstallmedia</code> should have worked, likely producing a
bootable drive.</p>
</section>
<section id="bonus-tidbit-4-dont-bother-restoring-a-time-machine-backup">
<h1>Bonus tidbit 4: don’t bother restoring a Time Machine backup</h1>
<p>Time Machine is Apple’s magical backup solution. Time Machine saves snapshots
of your entire disk. It’s supposed to help restore files that were deleted or
changed in an unwanted way, or help you restore a full macOS install.</p>
<p>Time Machine is great at file recovery, but none of my 3 system restore
attempts were successful. Attempt #1 was a full Time Machine System Restore,
from Recovery, back in June. It failed partway through, it couldn’t read
everything from the disk. There might have been underlying hardware issues with
that failure, so I had another attempt.</p>
<p>Attempt #2 was a Migration Assistant restore, as part of the initial setup.
This one succeeded, and things worked… except for one fairly important app.
This app requires online activation with the vendor, and it wouldn’t reactivate
after the install. Whatever the third-party vendor is doing didn’t like the
reinstall. I tried to nuke all the things in ~/Library related to their
software, and ran their nuke-everything uninstaller, but that didn’t work.
I reinstalled from scratch and copied over my files, settings and apps from the
Time Machine drive.</p>
<p>Attempt #3 involved the System Restore again, this time for the December
reinstall. The hardware issues were all fixed in the meantime, so I went for a
Time Machine System Restore.</p>
<p><strong>Issue #1:</strong> Internet Recovery booted into Catalina. There was an issue on Apple’s
side, <a class="reference external" href="https://mjtsai.com/blog/2020/12/30/no-more-big-sur-internet-recovery/">Big Sur was unavailable in Internet Recovery in December</a>. TM
Recovery will not restore a backup created with a newer version of macOS than
you’re booted into, so I was forced to restore a slightly older Catalina
backup. (I spent most of my time in Windows during that weekend, so other than
the need to upgrade macOS to Big Sur again, I didn’t really lose any data due
to this.)</p>
<p><strong>Issue #2:</strong> It wasted time computing an inaccurate size estimate. Before
restoring a backup, macOS first checks if it will fit on your drive. When it
does that, an indeterminate progress bar is shown. macOS won’t tell you the
result of that computation, but you can read the final value from the full
Installer Log (Cmd + L). On my Mac, the value was 96.2 GB. I was at the Mac
when it was getting close to that value. 94, 95, 96, 96.1, 96.2, 96.3… hold on
a second, 96.3 GB? Hopefully that’s just a bunch of extra things that are
installed from the system image directly, or something like that, right? Of
course, since the progress bar is based on the pre-computed size, it became
indeterminate and I couldn’t tell when it would end. 98, 100, 110, 120, 121.2
GB is where it ultimately ended. So, not only did it waste 20+ minutes
computing a size, it was off by 25 GB.</p>
<p><strong>Issue #3:</strong> The restore didn’t work. The System Restore finished and claimed to
have succeeded, but macOS wouldn’t boot. It showed an <em>Unrecoverable error</em>,
<em>SecurityAgent was unable to create requested mechanism</em>. Most people who had a
similar error had it caused by a botched TeamViewer uninstall; I didn’t have
that installed, and it was referring to a different component. So, wipe and
fresh reinstall it is.</p>
<p>I copied my stuff from the TM drive, and it was acting weird. Some apps failed
to load their settings copied into Library, others started with a “Move to
/Applications?” prompt (even though they were in that directory). For some
reason, those files had some hidden attribute set on it. I worked around it by
putting files in a <code class="docutils literal">.zip</code> archive with Keka, and then unzipping them;
<code class="docutils literal">xattr</code> might also help. (The attribute was likely <code class="docutils literal">com.apple.quarantine</code>.)</p>
<p>After I got the Mac to work, I reinstalled Windows and set up rEFInd, and it
now works fine. (I only use rEFInd because I want virtualization in Windows,
and that doesn’t work unless you’re warm-rebooting from macOS. I don’t need
anything more advanced than the Option key boot menu, but Apple made me use a
third-party bootloader.)</p>
<p><em>We now go back to the original post from June.</em></p>
</section>
<section id="an-open-letter-to-progress-bar-designers">
<h1>An Open Letter to Progress Bar Designers</h1>
<p>Dear Progress Bar Designers: can you please make your progress bars
functional? The macOS progress bar might look sleek at just 7 px (non-Retina)/6
pt = 12 px (Retina) high, but at the same time, you’re looking at individual
pixels if you need to know if it works or if it’s stuck. I have had to point my
mouse cursor at the end of the filled-in part just to know if it’s working or
not. Or sometimes, put a piece of paper in front of my screen, because there is
no mouse cursor when macOS installs on the black screen. How to make
that progress bar easier to use and more informative? Just add numbers on top of
it. For long-running processes, I wouldn’t mind progress bars that said
“12.34%”. That specific Setup/Migration Assistant window should be changed (it
only has a remaining time estimate and transfer speed, it should also show
moved data/total size), but wouldn’t more things benefit from a clear
indication of the progress? Yes, perhaps it looks less sleek, perhaps it
requires more space for the bar.</p>
<p>Just compare: which is easier to parse? Which is more informative?</p>
<div class="mb-3">
<div class="progress" style="height: 6.5px; border-radius: 6.5px;">
  <div class="progress-bar" role="progressbar" style="width: 42.42%;" aria-valuenow="42.42" aria-valuemin="0" aria-valuemax="100"></div>
</div>
</div><div class="mb-3">
<div class="progress" style="height: 20px; border-radius: 20px;">
  <div class="progress-bar" role="progressbar" style="width: 42.42%;" aria-valuenow="42.42" aria-valuemin="0" aria-valuemax="100">42%</div>
</div>
</div><div class="mb-3">
<div class="progress" style="height: 20px; border-radius: 20px;">
  <div class="progress-bar" role="progressbar" style="width: 42.42%;" aria-valuenow="42.42" aria-valuemin="0" aria-valuemax="100">42.4%</div>
</div>
</div><div class="mb-3">
<div class="progress" style="height: 20px; border-radius: 20px;">
  <div class="progress-bar" role="progressbar" style="width: 64.64%;" aria-valuenow="64.64" aria-valuemin="0" aria-valuemax="100"></div>
  <div style="position: absolute; text-align: center; left: 0; right: 0; margin-top: 10px;">64.64% (6.7 GB/10 GB copied)</div>
</div>
</div><p>I’d honestly be happy enough with option 2, at least it can be read easily and
you can remember the number instead of a vague position.</p>
</section>
<section id="in-the-end">
<h1>In the end…</h1>
<p>After all this, I managed to get macOS Catalina installed. After various
failures in built-in El Capitan recovery and Catalina Internet Recovery, I first
installed El Capitan with this hack, then jumped to Mojave because I thought
the new Software Update would help (it didn’t, same installer, same
failed-to-extract-package issue), then made a Catalina USB stick, and it
finally clean-installed, but I was worried about the backup disk’s operation,
and I used a proxy on my local network to try and speed up Catalina downloads
without much improvement… but hey, at least it works. Apple should really make
it easier to install their OS and to make boot media even when stuff doesn’t
work, even from Windows. The Hackintosh folks can just find someone with a
working Mac and ask them to download from App Store and make install media, or
find less legitimate sources, they probably don’t care as much. But if my own
system crashes, I’d probably want to get working install media immediately,
myself, and from Apple. Without all this mess.</p>
</section>
]]></content:encoded><category>Apple</category><category>Apple</category><category>install</category><category>Mac</category><category>macOS</category></item></channel></rss>