Archive for the ‘mac’ Category

One thing that I always found annoying was that in Parallels, I would hit Control-Option to get back to the mac, but the parallels screen would stay there (in my case CentOS 64bit). I generally have goo separation of tasks between Mac and CentOS, so when I switch, I want all of the Parallels windows to go away. Turns out the solution is really easy: Apple Spaces. This post describes how I set it up.

1. Select Apps -> Utilities

2. Select Spaces

3. The first time a message appears saying that Spaces is not setup. Click “Set Up Spaces”.

4. Next check “Enable Spaces”, check “Show Spaces in menu bar”.  Next, I really just wanted two screens so that I can easily toggle between them, so I hit – on  Rows (Whoops, I highlighted the wrong one 🙂 ). Then click the “+” to add an application, and choose Other…

5. Click on Parallels Desktop, and click “Add”.

Next I clicked just to the right of Parallels Desktop, and changed the space to Space 2. And I wanted to use the “alt” key (the option key), to do the switching, so I changed “To switch between spaces:” and “To switch directly to a space” to use the alt key (see picture).

So now when I want to switch between CentOS and mac, I use the arrow keys “Alt-Right” and “Alt-Left”.

So much better now.

You can enable the debug menu by doing the following command:

Apps -> Utilities -> Terminal

Then type:

defaults write IncludeDebugMenu 1

and then restart safari.  Then you will get a develop menu which has “Show Error Console” and many other options.

I needed to mount an ext3 file system which is on my dual boot mac (I’m doing that to allow parallels to run from “boot camp”). So my idea is to just mount the drive.  To do that:

  • I installed macfuse, then fuse-ext2 from:

Once downloaded and extracted, then

cd fuse-ext2-0.0.7
sudo make install
mkdir -p /mnt/sda3
fuse-ext2 /dev/sda3 /mnt/sda3

Segmentation fault

damn, there is a bug in fuse-ext2.c, first line! edit fuse-ext2/fuse-ext2.c, comment out this (line 324)

//debugf("version:'%s', fuse_version...

And I see there is a file, so lets do this instead:

make distclean
sh ./

then double click on the installer from the finder: fuse-ext2-0.0.7.dmg

sudo fuse-ext2 /dev/disk0s3 /mnt/sda3
cd /mnt/sda3


Note that it is mounted as ext2 (and ext3 is backward compatible with ext2), and the net effect is that you lose the journal.  That sounds bad I hear the non-techies (and some techies) say. Well, the best thing about ext3 is the journal, and what it does is provide a fast way to recover the file system if (and when) it is not shut down cleanly (like power out). The downside of not having the journal is that after an unclean shutdown, it can take a while to go through all the files and make the file system clean again.

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/
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.

  • Hit Shift-Apple-3.  This will capture the desktop and save in a file called Screen shot <date time>.png
  • Hit Shift-Apple-4.  This will allow you to drag out an error and save that to a file.  If instead you hit space, will will let you pick what window to capture.

placeholder for centos 5.4 install on macbook pro.

Why CentOS 5.4 64bit you ask? Because that is the production system that I use for my website.  As I have mentioned on some other posts, I try not to live on the bleeding edge  unless there is good reason.  I had previously ran fedora on a live system, and the updates just killed me.

My macbook pro is a late 2009 model (I got in in October) 2.8 GHz with 4Gb mem and 320Gb drive (soon to be 120Gb patriot SSD).

First of all partition the disk ahead of time.  Just roughly the command is:

sudo diskutil resizeVolume disk0s2 200G "MS-DOS" "CentOS" 80G "MS-DOS" "Windows 7" 30G

put in centos disk into drive

boot the computer, and hold down ‘c’

enter (default install)




Choose create custom layout (from the top combo box)


click on /dev/sda3

click edit

set mount point to /

change format partition to ext3

click ok

click next

click yes

click format

click next


choose location Next

root pass next

pick packages

next (does the install)

(cd will eject when done)

click Reboot

My system hun on “Restarting system.” so after a few minutes I held the power button down for5 seconds to power it down.

the started back up

synced the gpt

click reboot on the refit menu

I setup a partition for linux on my macbook, but mad the mistake of letting bootcamp make the parituion.

you need to do it manually, and once I started the process, I’ve so far been unable to undo it.

This is a placeholder entry for when I solve it 🙂

I get the following error when trying to use boot camp to resttore to a single partition

“The statup disk cannot be partitioned or restored to a single partition.

The startup disk must be formatted as a single Mac IS Extended (journaled) volume or already  partiioned by Boot Camp Assistant for installing Windows


I thought I’d be brave and just go ahead and install CentOS 5.4 linux on my macbook pro (late 2009 edition). Part of the thinking was that if I have problems, I’ll get to learn more about the macbook. I backed up my drive, and I plan to replace the drive with an SSD anyway, so I was feeling pretty fearless.

After a few tiny hiccups, It was installed (I decided not to install grub figuring it might mess with the boot loader (and I had already installed refit).  But reboot .. nothing .. just a dreaded error

No bootable device insert boot disk and press any key

I tried a few keys to see if I could get any kind of bios settings. Nadda. So a little googling, and holding down the “option” key when booting gave me a nice looking icon with Macintosh HD, so clicked on that, and bingo. Back in mac land. And then the mac continued to reboot just fine after that.

I imagine other people might have the same problems when installing Windows XP, vista or windows 7.  I also imagine that I did something not quite right.