Removing MBR on a Mac

Setting up a dual boot Mac and Ubuntu requires using GPT for the Mac and MBR for Ubuntu. rEFIt is commonly used to sync these. The Ubuntu bootloader should be written to the first Ubuntu partition but occasionally it can get written to the MBR. In my case it appeared in both the MBR and the Ubuntu partition rendering Ubuntu unbootable. So how can this be fixed? Start with backing up everything just in case. If you have one hard disk the following is the command to use to remove the bootloader from the MBR:

fdisk -u /dev/disk0