Today I installed Linux on my Mac, on an external hard-drive. I encountered only one undocumented hitch, which I'm detailing here for my own reference and in case anyone else runs into it.
Basically, the steps I followed were:
- Boot Devuan installer from USB
- Install Devuan to external disk (I went with the "use the whole disk" option)
- Try to boot Devuan by holding
Alt
key... doesn't work... search a little, work out that I need the rEFInd bootloader - Boot into OS X and try to install rEFInd. No luck, system integrity protection forbids it. Installer suggests booting into recovery mode
- Boot into recovery mode by holding
Command-R
. - Run
./refind-install --usedefault /dev/disk3s1
, get something like the following error:
$ ./refind-install --usedefault /dev/disk3s1
mkdir: /tmp/refind_install: device is read-only
...<some other errors from mount and rmdir>...
I just had to set InstallDir=/private/var/tmp/refind_install
in the MountDefaultTarget
function, so it now looks like this:
# Mount the partition the user specified with the --usedefault or --ownhfs option
MountDefaultTarget() {
InstallDir=/private/var/tmp/refind_install
mkdir -p "$InstallDir"
UnmountEsp=1
if [[ $OSTYPE == darwin* ]] ; then
if [[ $OwnHfs == '1' ]] ; then
Temp=`diskutil info "$TargetPart" | grep "Mount Point"`
InstallDir=`echo $Temp | cut -f 3-30 -d ' '`
if [[ $InstallDir == '' ]] ; then
InstallDir=/tmp/refind_install
mount -t hfs "$TargetPart" "$InstallDir"
else
UnmountEsp=0
fi
else
mount -t msdos "$TargetPart" "$InstallDir"
fi
elif [[ $OSTYPE == linux* ]] ; then
mount -t vfat "$TargetPart" "$InstallDir"
fi
if [[ $? != 0 ]] ; then
echo "Couldn't mount $TargetPart ! Aborting!"
rmdir "$InstallDir"
exit 1
fi
} # MountDefaultTarget()
Looks like /private/var/tmp
is the writable tempdir in a Sierra recovery boot-up.
- macOS 10.12.3 (16D32)
- rEFInd 0.10.4
- Hardware: Macbook Pro Retina (Early 2015), aka MacBookPro12,1