iMac Linux
Getting Linux on this old iMac was a bit of a bear, but I've learned some things in the process, I'll share them here for anyone who might be trying to do the same thing and/or myself in the future.
Some general points:
- Macs (iMac or otherwise) from different years can be much simpler to setup with Linux, compatibility problems are not consistent. This info is specific to my iMac model (mid-2010) but may be useful for other models.
- Ubuntu and Elementary (an offshoot OS) have a lot of built-in support for Mac hardware
- My issue was having to do with the boot up process, iMac's non-standard UEFI (so much for the U) and understanding how to work with Grub.
Below is a compiled transcript of what I did in a general sense. In reality I ended up giving up with installing just Elementary, and changed tactics to see if Ubuntu would be simpler. I ended up getting the boot process working with Ubuntu, however if I was starting over, I believe I could have done the same with Elementary. In the end, I decided to keep Ubuntu because Elementary allowed me to adjust the partition with an easy to use GUI so I could run them both. If you're trying to get just Elementary running, I don't think you'd need to do this.
Here's the transcript:
- You'll want a USB flash drive, and wired USB keyboard and mouse.
- Setup flash drive with ISO for installer, using Balena Etcher for example
- Put flash drive in the Mac
- Boot Mac holding "Alt" to get EFI boot picker, pick the flash drive (if two show up, either one works).
- As you see the boot screen, press an arrow key to stop the timeout
- Press 'e' to enter grub's option mode
- Add the word 'nomodeset' at end of the line that has the word "splash"
- F10 or CTRL-x to boot
- Pick "Install Elementary" and follow the prompts
After this, I'm prompted to remove the flash drive to restart, but it boots into a black screen. So we repeat the process, but this time we pick "Try Elementary" so we can get into a working OS (running off the flash drive). Then we'll do our boot modifications to the main install from this temporary one.
- Shut down computer
- Put the flash drive back in and power it up
- During boot up hold "Alt" to get EFI boot picker, pick the flash drive (if two show up, either one works).
- As you see the boot screen, press an arrow key to stop the timeout
- Press 'e' to enter grub's option mode
- Add the word 'nomodeset' at end of the line that has the word "splash"
- F10 or CTRL-x to boot
- Pick "Try Elementary" this time, to boot into the live USB OS
- Open terminal from applications
sudo -i
to work as root user
fdisk -l
to see what the drives are, find the one who's size is measured in Gigabytes (e.g. /dev/sda2). Now we are going to mount that main drive and associated OS folders so we can apply changes.
mount /dev/sda2 /mnt/
for i in /dev /dev/pts /proc /sys /run; do mount -B $i /mnt$i; done
cd /mnt
Now we chroot to emulate like we are operating in the main OS drive.
chroot /mnt
pico /etc/default/grub
to edit the grub file, add 'nomodeset' after "splash"
CTRL-X
to exit, choose "y" to save when prompted. Next we run "update-grub" so the changes will stick.
update-grub
Restart computer. You may be done now, but if you're thrown into grub prompt, then:
ls
to see the drives e.g. (hd0) (hd0, gpt2), (hd1)... or something like that
ls (hd0)
to see what type of drive it is, look for the super large ext* one. Note "(hd0, gpt2)" is a fake example name.
set boot=(hd0, gpt2)
set prefix=(hd0, gpt2)/boot/grub
insmod normal
normal
This should get you booted in. Then open terminal and
sudo -i
grub-install /dev/sda2
apt-get udpate
apt-get upgrade
Now you should be able to shut down and restart as needed.
The above is a pseudo transcript of what I (sort of) did. If you have updates or additional info you think should be added, let me know and I'll add notes.