// Installing CentOS 5 on a mac pro | Light At The End Of The Tunnel Installing CentOS 5 on a mac pro – Light At The End Of The Tunnel

Light At The End Of The Tunnel

systems administration meanderings

Installing CentOS 5 on a mac pro

Not as easy as the title suggests, what a surprise!

Before I went and overwrote the existing OS on the Mac Pro, I downloaded the CentOS 5 live CD to see whether it worked. There were good signs from this wikipedia article. First thing is how to get the Mac Pro to boot from the CD:-

  1. Turn on the Mac Pro
  2. Hold down the left button on the mouse
  3. The CD tray is opened, place the CD in
  4. Away you go

Fortuantely, CentOS 5 booted with no issues at all. Unlike the Ubuntu live CD, you can’t install from theCentOS live CD, this is due to change in CentOS 6 apparently.

So I decided to go full on and install CentOS 5.5, cleared all the existing partitions, created new ones, and it all installed nicely. Next check - turn the unit off and boot it back up. Nothing but a flashing grey folder on a white background was the result. The Mac Pro could not find the boot partition, due to the fact it uses EFI, which also means that it uses GPT for partitioning hard drives. Looking around I found out that grub supplied by CentOS does not support gpt. This left me with a couple of options:-

  1. Patch grub to support gpt - apparently there are issues with this patch
  2. Install grub2 support into [CentOS](http://www.centos.org/)
  3. Install an OS that supports grub2 and then use that to boot [CentOS](http://www.centos.org/)

I choose the latter option, choosing to use a spare Kubuntu 9.10 live CD I had lying around. This was a bit of a mistake as I should have used an alternate live CD, due to the alternate image having support for lvm and raid.

I chose to partition the disk with the following layout:-

  * small efi boot partition
  * Kubuntu - 40G - have everything installed under /
  * swap
  * [CentOS](http://www.centos.org/) root partition - 40G
  * data partition using lvm
  * backup partition on different disks

Installing Kubuntu was a breeze, as it should be, and I created the partition layout I required. CentOS install was equally painless, creating the same partition layout I required. In test I did this procedure correctly, going to the production disks. I thought I’d be safe missing out the last step, and doing this partition later, bad mistake, as I’m not used to parted as much as I am fdisk. Ended up deleting the swap partition and recreating it, plus making the backup partition. This was a mistake as I then needed to reinstall Kubuntu as I didn’t have time to figure out the issue for recovering grub2. Lessons learnt, next time I’ll use a Ubuntu server image which has lvm and raid support, and define all the partitions from this and then just install CentOS into the correct partition.

So now Kubuntu is installed and so is CentOS. I needed to tell Kubuntu about how to boot CentOS. Booted into Kubuntu, and then realised I needed support for lvm and raid, you therefore have to sudo apt-get install lvm2 and mdadm

grub2 still doesn’t recognise the CentOS partitions, so :-

  1. cd /etc/grub.d/
  2. vi 40_custom
  3. Add an entry as shown:-

menuentry "CentOS 5.5" { insmod ext2 lvm raid set root='(hd1,4)' linux /boot/vmlinuz-2.6.18-194.el5 root=/dev/sdb4 initrd /boot/initrd-2.6.18-194.el5.img } Install Ubuntu Install lvm2 mdadm Now we are done. Reboot and then in the Grub menu select CentOS, you will now see it boot successfully.


Share

#