When upgrading from 10.12 to 10.13 I hit an error in the installer: “Filesystem verify or repair failed”. The only option was to reboot, and then there was a different error which persisted after rebooting: “The path /System/Installation/Packages/OSInstall.mpkg appears to be missing”.
cmd+r while rebooting provided access to Disk Utility and Terminal. Disk Utility could see the locked, encrypted volume but failed to mount it, with no error message. In Terminal I found the volume with
diskutil corestorage list, unlocked it with
diskutil corestorage unlockVolume [uuid] (where [uuid] is the UUID of the volume containing the system), then tried to mount it with
diskutil mount [disk] (where [disk] is the id of the unlocked volume, e.g.
disk17), but mounting failed.
This is when I found out what the problem was:
ps aux | grep disk showed that
fsck_hfs -fy had started running automatically on the volume, so it wouldn’t mount as it was busy. After waiting (a long time) for fsck to finish, the volume mounted successfully with
diskutil mount [disk].
The problem, it seems, was that the filesystem on my large replacement internal drive was taking a long time to verify after being unlocked, so the installer wasn’t able to mount it.
After rebooting once more the rest of the installation process went smoothly.