I want to get linux running natively, as well as from parallels. So the first step is to install linux direct to the hard drive. This one would think is straight forward, but the grub bootloader fails with CentOS install (silently) so you have to go back in and do this yourself.

The Setup:

  • on a 15″ 2.8Ghz MacBook Pro that I bought in late 2009 (from HongKong if it matters).
  • 4G of memory (2x2G)
  • 320G, 7200 RPM drive.
  • MacOS 10.6.2,
  • Parallels 5.0 build 9310
  • BootCamp 3.0.1 (uh oh, maybe that was a source of problems .. 3.1 is available)
  • Install MacFuse and fuse-ext. This will save you a lot of pain.
  • Partition your drive. Strangely, just don’t use BootCamp, use disk util.
  • Parition your drive. Strangely, just don’t use BootCamp, there is no need.

Using diskutil to partition:

This is certainly the recommended way.  You can resize, and repartition all in the one go.

diskutil blah blah .. TODO

Using Bootcamp to partition:

  • applications -> utilities -> boot camp assistant, click continue

insert pic

  • drag size to be 200GB for windows .. 97 gb for windows, click partition

insert pic

  • If you have problems partitioning, kill the parallels processes (which are prl_.. and prl_…)
  • Click Quit and Install Later

Now for the CentOS install.

  • put centos 5.4 CD into the drive and reboot (apple -> Restart…)
  • hold down the ‘c’ key. This will boot from the CD.
  • hit Enter – (see other article on the CentOS setup)
  • When you get to the partitioning part, chose a custom layout.  You don’t need a swap (although you can have one). You just need /. Which is what I did.
  • Delete the /dev/sda3 vfat parttion  (click on it, then click delete, then click delete)
  • Click “New”
  • Set the mount point to /
  • Set the size to maximum allowable size (or pick a size)
  • Click OK
  • Click Next
  • ignore swap partition (click yes).
  • You can install the bootloaded on sda3 if you want, but it’s going to fail anyway. So pick no bootloader.
  • Click Next (install takes 12-15 minutes once started on my 320Gb 7200 pm drive).
  • click reboot after CD comes out.
    • hmm .. again the linux is hung there, so 5 seconds pressing the power button to power it down, then press again to turn it back on.

Now if we reboot into linux (using refit, or holding down the option key on startup), we probably see that it fails with “Can’t find operating system” or similar.  This is because grub failed to install, so we need to reinstall it.

  • Place the CentOS 5.4 CD (mine is 64bit) in to the CD, reboot, and hold down ‘c’.
  • At the prompt type linux rescue.
  • Choose all the default options (no need for network) and finally get to a shell prompt
# chroot /mnt/sysimage
# grub-install /dev/sda3
Installation finished. No error reported.
This is the contents of the device map /boot/grub/device.map.
Check if this is corrrect or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.

# this device map was generated by anaconda
(hd0)     /dev/sda
#

Which was infact correct. I many times did get the error that it couldn’t load the stage1 file.

2 Comments

  1. John T. Vonachen says:

    I followed these instructions but I still get the error “The file /boot/grub/stage1 not read correctly” I’ve tried probably 20 times with 20 different ideas over the past two days straight. I’m at my wits end. I really need this to work. I don’t know what else to do.

  2. cameron says:

    can you run it under macos (not sure it matters, just trying to collect some more info on what the problem might me).

    when it says stage1 not read correctly it is more than likely that grub is not installed correctly. Check that /dev/sda is the right drive …

    did you have any errors when running grub-install?

    cameron

Leave a Reply