Re: HOW TO: Backup and clear MBR (uninstall GRUB)

Hi guys.

Cyber. My mac is not doing it good at all. I was tired of all that .. (no any bootable Tux icon). So i tough, ill just reinstall OSX, and everything is going to be ok. But, huh, no. I still get elilo Tux in rEFIt. Now i dont even care aboutbooting linux up yet. But how do i get this elilo off my mac.

Re: HOW TO: Backup and clear MBR (uninstall GRUB)

Originally Posted by Nikolai D.

Hi guys.

Cyber. My mac is not doing it good at all. I was tired of all that .. (no any bootable Tux icon). So i tough, ill just reinstall OSX, and everything is going to be ok. But, huh, no. I still get elilo Tux in rEFIt. Now i dont even care aboutbooting linux up yet. But how do i get this elilo off my mac.

elilo is likely a efi executable that was copied somewhere. Since I do not know much about it, I can't really tell you where to go... How did you install it? maybe you can search for a file ending in .efi to find it?

Originally Posted by mabovo

Burned an Intrepid iso and will start another ammusement. Who knows if Intel driver gets better and iSight doesn't freeze !

You seem to be the only one having a problem with the iSight freezing.

Re: HOW TO: Backup and clear MBR (uninstall GRUB)

Hellow World =]

Cyber, When i was installing Debian GRUB failed as usual. So i tryed elilo. And after that i cant get that unbootable efi tux outta here, also cant get toehr tux to boot. However before just a matual grub install did it. =]

I started another thread with auestion if OSX stays installable if i delete 200mb fat (efi?) partition.

Ok i understand that its pointing exactly to root partition. But how comes the first methode worked for me then. Cuz for me second methode looks more right.
Why am i asking is because i just 'bootcamped' my hd. And installed Debian agane. But chose to not install grub. So nowi have to install grub manually. And its second methode as i understand, but i keep asking myself how does the other worked for me then.

Re: HOW TO: Backup and clear MBR (uninstall GRUB)

Originally Posted by Nikolai D.

Ok i understand that its pointing exactly to root partition. But how comes the first methode worked for me then. Cuz for me second methode looks more right.
Why am i asking is because i just 'bootcamped' my hd. And installed Debian agane. But chose to not install grub. So nowi have to install grub manually. And its second methode as i understand, but i keep asking myself how does the other worked for me then.

I am not sure why installing to the root partition was not working for you, but if it works the other way then do it. The only time that installing to the MBR is an issue is when windows gets involved because it's bootloader will take over the MBR.

The 'root' command tells grub where the grub files are (stage2, menu.lst).
The 'setup' command actually copies the stage1 bootcode into the header of the partition your specify (hd0,2), or the MBR if you just point to the disk (hd0).

For some reason refit was not seeing the bootcode you installed to the root partition. Maybe elilo / another install of grub was confusing it.

Re: HOW TO: Backup and clear MBR (uninstall GRUB)

If you happen to be one of several people that somehow end up with two different icons in rEFIt that boot GRUB for Ubuntu, then this will show you how to remove one of them.

Background
The issue is that the Ubuntu installer by default installs GRUB to the MBR of the Hard Drive. This is OK for most PCs as this will make it easiest to dual-boot with Windows. On Macs, however, We usually use rEFIt or Hold the Option Key at startup to select which partition to boot from, and having GRUB in the MBR means that you have to use both rEFIt and GRUB to get to windows (for a triple-boot), so most guides tend to install GRUB to the Ubuntu partition and that is OK, but with the advent of a installer bug. The MBR becomes corrupted and many users unknowingly reinstall GRUB to the Ubuntu partition after it has already been installed to the MBR, and thus you get two instances of GRUB to boot.

WARNING: The following commands can easily wipe out your entire hard drive if you are not very careful (make a typo). Please make sure you have everything backed up before proceeding.

Now, the Good StuffBefore you do any of the following, make a backup of the entire MBR:

Code:

sudo dd if=/dev/sda of=/home/username/mbr_backup bs=512 count=1

Now complete the appropriate step below to clear the portion of the MBR you need.

In order to Clear out the MBR except the partition table (Literally, write zeros over the current MBR contents):

Code:

sudo dd if=/dev/zero of=/dev/sda bs=446 count=1

To clear the complete MBR, including the partition table (On a Mac, the partition table can be recovered by syncing your partition tables with rEFIt):

Code:

sudo dd if=/dev/zero of=/dev/sda bs=512 count=1

If you have issues after clearing a portion of the MBR. These commands show you how to restore it.
To restore only the Bootsector (not including the partition table):

Code:

sudo dd if=/home/username/mbr_backup of=/dev/sda bs=446 count=1

To restore the entire MBR:

Code:

sudo dd if=/home/username/mbr_backup of=/dev/sda bs=512 count=1

I've ended up with not being able to read /dev/sda after clearing the MBR. I've tried running from Ubuntu LiveCD. Is there a way to restore my MBR, or do I have to reinstall OSX and Ubuntu?