My power supply came in the mail this week for my Toshiba A200 notebook so I decided to add Windows 7 to the installed OS list (currently booting Leopard 10.5.2 and Ubuntu 9.04).  As always Windows hijacked the master boot record with it’s inferior boot manager – I had to fix this immediately.

GRUB is not as complicated as people make it out to be. In fact it is a very elegant solution to handling multi-boot platforms. Here’s a quick guide to steal your MBR space back from Windows :

  1. Boot into live CD such as Ubuntu or Knoppix – DSL works well and is fast.
  2. Open a terminal, if your live CD boots into a GUI – press ALT+CTRL+F2 to access a different console.
  3. type “cfdisk”

This part is tricky – you must find where GRUB currently lives – in the case of the image below (my rig) sda5 is where Ubuntu is installed – in GRUB this is equal to hd0,4 – since GRUB counts from 0, not 1.

Screenshot

Once you have determined what partition holds grub root files – close cfdisk (q) and type :

grub

root (hd0,X) <– where X is the grub count from 0 to your current Linux installation*

setup (hd0,0)

This will opverwrite Windows MBR installation and give access back to GRUB hooray!  Next step would be adding Windows boot back to grub which has already been covered in my “How To Dual Boot Hackintosh + Ubuntu” article.

* I have a difficult time expressing this simple idea – if Linux is installed on SD5 then grub should say (hd0,4).  If your boot partition is /dev/sda87, GRUB would be (hd0,86) – I hope this helps.

EDIT : I forgot to mention a huge congratulations to Microsoft for making an operating system that looks and feels like Vista with the intermittent stability of XP – huge upgrade IMO.. still far from Leopard.

I wrote an article a few months back about Time Machine over TCP to a Linux NAS.  I linked to a few how-to’s that walked you through compilation and setting up your mac to accept remote volumes for backup devices.

I have little experience creating deb packages – but I figured I would release my working Ubuntu specific deb for others to test out and see how it goes.  I have tested it on a fresh install :

Linux laptop 2.6.28-14-generic #47-Ubuntu SMP Sat Jul 25 00:28:35 UTC 2009 i686 GNU/Linux

Here is what I had to do to install it :

wget http://geekhut.org/downloads/netatalk_2.0.4~beta2-5ubuntu1_i386.deb
sudo dpkg -i netatalk_2.0.4~beta2-5ubuntu1_i386.deb
sudo apt-get -f install

You can edit your shares in /etc/netatalk/AppleVolumes.default
For instance, the last two lines of mine look like :

/media/shared/Backups/ "Time Machine"
/media/shared/ "Shared"

You will also want to add the following to the bottom of /etc/netatalk/afpd.conf :

- -transall -uamlist uams_randnum.so,uams_dhx.so -nosavepassword -advertise_ssh

Once you have it all set up, you will probably want to advertise this service on the network as an Apple device. Copy this file into /etc/avahi/services/afpd.service.

Restart avahi : sudo /etc/init.d/avahi restart
Restart netatalkd : sudo /etc/init.d/netatalk restart

You should now see your new AFP server in your apple’s finder sidebar.  If not click Finder => Go => Connect to Server and type afp://your-hostname.

Anyway I hope the file works for you, I can not guarantee anything and assume NO liability if it shits the bed.  Give it a shot and let me know how it turns out for you.

So often after installing VMWare on my Debian based hosts I get this error :

desktop gregory # vmware
/usr/lib/vmware/bin/vmware: /usr/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_3.4′ not found (required by /usr/lib/libcairo.so.2)
/usr/lib/vmware/bin/vmware: /usr/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_4.2.0′ not found (required by /usr/lib/libstdc++.so.6)
/usr/lib/vmware/bin/vmware: /usr/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_3.4′ not found (required by /usr/lib/libcairo.so.2)
/usr/lib/vmware/bin/vmware: /usr/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_4.2.0′ not found (required by /usr/lib/libstdc++.so.6)
/usr/lib/vmware/bin/vmware: /usr/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_3.4′ not found (required by /usr/lib/libcairo.so.2)
/usr/lib/vmware/bin/vmware: /usr/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1: version `GCC_4.2.0′ not found (required by /usr/lib/libstdc++.so.6)

You have probably seen this yourself if running any Ubuntu flavored distributions, heres my fix :

desktop gregory # rm /usr/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1
desktop gregory # ln -s /usr/lib/gcc/i486-linux-gnu/4.2/libgcc_s.so /usr/lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1

Now I wil never forget…

I just downloaded a bunch of older Moneen torrents and wanted to put them up on Radio Free Geekhut, unfortunately my crappy Windows Encoding box doesn’t support m4a playback.  After a quick google search I found a link as to how to convert these puppies in Ubuntu / Debian since soundconverter wont do it for me.

Quick and dirty -
$ sudo apt-get install -f -y faad lame

Open a terminal and switch to your directory with the m4a files in it.

Run this :

for i in *.m4a
do
faad -o – “$i” | lame -h -b 192 – “${i%m4a}mp3″
done

Took me a couple minutes per song but was worth it being able to play Moneen on RFG.
You can also make a script in /usr/local/bin (or wherever) called “m4a2mp3″ or something like that.
Don’t forget to make it executable using $ chmod +x <file name>

I wrote this post before geekhut recently crashed so I decided to repost the google cache because of the articles popularity.

Well because it is the holidays and I have nothing better to do than drink, I decided to have a few and install OSX86 on my Toshiba Satellite. The problem is Zend Development Environment is not yet available for OSX so I would have to dual boot.

Dual booting was truly a trivial task. There are many forums (Link) with some decent information as to how dual booting any OS with OSX86 can be done. I am comfortable with most Linux flavors so I figured grub would be my best bet. Unfortunately you can’t just point to your darwin mach_kernel and intramfs in /boot/grub/menu.lst, you actually have to chainload the darwin bootloader (which still isn’t so bad). This meant that I would have to install OSX86 first to ensure I could properly tell grub to pass on the bootstrap to darwin bootloader.

So heres how I did it.

PART I – Installing OSX86

1.Get Hackintosh, just search “ToH” on any torrent site and you should be able to find the second release candidate (in ISO format)

2. Burn ISO to DVD and set BIOS to boot from CD (Duhh)

3. Open the OSX Disk Utility and create say a 20 GB Partition, leave enough room for Ubuntu (another 20 gb). Format it for HFS+ Journalized and give it a cool name, like Hard_Disk ( I named mine sda1, remember this name for the next step).

4. Follow the on screen instructions until installation completes, but don’t reboot yet! There is a good chance you’ll end up with a blinking cursor. Open a terminal under the “Utilities” Menu and type :
#/usr/misc/script.sh Hard_Disk (or whatever you named your apple formated disc). Read the scripts output, you may see errors. If so the easiest way to make sure it will work is to unmount the drive, verify it, repair it (using the disc utility) and then run the script again.

5. Once you reboot you will be greeted by a gray screen with a white apple logo (hopefully) and you can proceed to configure your new apple Hackintosh as you wish.

PART II – Installing Ubuntu and configuring grub

1. Boot Ubuntu 7.10 into the live CD environment and follow through with a standard installation. When asked for a partitioning schema, select “Manual”
- This is how your current partition table may look

/dev/sda1 EFI (I am guessing apples boot partition, usually about 200 Mb)
/dev/sda2 Where OSX86 is already installed
/dev/sda3 unformatted / raw, this is where we will install Ubuntu

- Create a swapspace on dev hda3 to a standards size (Double the amount of your RAM)

- Create a root partition with whatever is left, it should be at least 10 – 20 GB

2. Once Ubuntu is installed, we will not immediately reboot, instead lets configure grub while were in a safe environment.

- Open a terminal (alt + f2 -> gnome-terminal)
- Make a directory to hold your Ubuntu partition
$ sudo mkdir /media/ubuntu
- Mount your Ubuntu partition
$ sudo mount /dev/sda4 /media/ubuntu
(sda4 may actually be sda3 depending on how you partitioned your Ubuntu side)
- List the contents of /media/ubuntu to make sure you mounted the correct drive
$ ls /media/ubuntu

If you see :

bin cdrom etc initrd lib media opt root srv tmp var
boot dev home initrd.img lost+found mnt proc sbin sys usr vmlinuz

You are on the right track.

else, try a different partition (hda2 / 3 / 4)

3. Great we’ve mounted our fresh Ubuntu installation and now we are going to edit our boot menu, type :
$ sudo gedit /media/ubuntu/boot/grub/menu.lst
A text editor will popup
- place a # before the “hidemenu” option so you will not have to press escape to access your boot menu.
- you will then look for the section where it lists your installed kernels (usually right at the bottom), at this point it should look something like :
i. your default ubuntu system
ii. your failsafe ubuntu system
iii. your memtest (memory test)
lets add the below text after the default ubuntu block (next line after “quiet”)

title Hackintosh
root (hd0,1)
chainloader +1

If you followed my partitioning scheme, this should work beautifully for you. (NOTE you can change “Hackintosh” to whatever you prefer)

That should be it, once you reboot the livecd, grub should popup and you will have the option to boot ubuntu or “Hackintosh” Enjoy!

Troubleshooting

Problem : When I select Hackintosh from the boot menu, I get an error.
Solution : Try changing /boot/grub/menu.lst to read :
title Hackintosh
root (hd0,2)
chainloader +1
You may have partitioned things weird but youll have to play with the (hd0,1,2,3,4) until it works for you.

Problem : I am still getting an error after changing the root parameter in menu.lst

Solution : Were you actually able to boot into OSX? if yes then keep playing with grub. If no, follow this tutorial closer.