Jump to content

Remove Grub


Bagel
 Share

5 posts in this topic

Recommended Posts

Im having troubles removing grub from my previous ubuntu install. Heres the situation: i have a 120gb hdd with vista and a now osx partitions (the latter was originally ubuntu which installed grub onto my machine). I replaced the ubuntu partition with osx but whenever i try to boot of the hard drive, grub will try to boot up and fails. How can i purge the grub bootloader so i can boot directly into osx?

Link to comment
Share on other sites

It's not something you "erase" if grub has been installed in the Master Boot Record of the hard drive. You have to "replace" it. If the grub screen is what you see when you first turn on the computer then it is installed in the MBR.

 

Ideally you would have backed up the disk's MBR before playing with grub. In fact, when you run the grub install it makes a backup for you (it's only 512 bytes long). If you blew away ubuntu then the backup is history.

 

If you have a USB flash drive you should first back up whatever is currently in your MBR and save the file on the flash drive. That way you can at least get back to your current state of affairs in case you run into problems.

 

You say you have XP on another hard drive? You could try copying the MBR from that partition to your main disk. You will need to boot Linux from a live CD (or DVD) to do that.

 

dd if=/dev/whatever_your_xp_disk_is of=/dev/whatever_your_main_disk_is bs=512 count=1

 

That should let Vista boot at least.

 

If you want to boot only into OSX then you should boot from your OSX DVD into single-user mode and do a similar "dd" operation except "if=..." should be a file called "boot1h". You have to find that file first on the OSX DVD. Most of the recent OSX DVD distros have it somewhere. Sometimes it's in the /usr/standalone directory. You can find it by doing

 

find / -type f -name boot1h

 

Then "cd" to that directory and try these steps...

 

dd if=./boot1h of=/dev/rdisk0 bs=512 count=1

startupfiletool -v /dev/rdisk0 ./boot

bless -device /dev/disk0 -setBoot -verbose

 

Re-booting should then get you straight to OSX. Give that a shot. If you run into problems then do some searching on these forums. Amidst all the noise there are other discussions about how to set up your boot sector with OSX/grub/Windows etc.

Link to comment
Share on other sites

It's not something you "erase" if grub has been installed in the Master Boot Record of the hard drive. You have to "replace" it. If the grub screen is what you see when you first turn on the computer then it is installed in the MBR.

 

Ideally you would have backed up the disk's MBR before playing with grub. In fact, when you run the grub install it makes a backup for you (it's only 512 bytes long). If you blew away ubuntu then the backup is history.

 

If you have a USB flash drive you should first back up whatever is currently in your MBR and save the file on the flash drive. That way you can at least get back to your current state of affairs in case you run into problems.

 

You say you have XP on another hard drive? You could try copying the MBR from that partition to your main disk. You will need to boot Linux from a live CD (or DVD) to do that.

 

dd if=/dev/whatever_your_xp_disk_is of=/dev/whatever_your_main_disk_is bs=512 count=1

 

That should let Vista boot at least.

 

If you want to boot only into OSX then you should boot from your OSX DVD into single-user mode and do a similar "dd" operation except "if=..." should be a file called "boot1h". You have to find that file first on the OSX DVD. Most of the recent OSX DVD distros have it somewhere. Sometimes it's in the /usr/standalone directory. You can find it by doing

 

find / -type f -name boot1h

 

Then "cd" to that directory and try these steps...

 

dd if=./boot1h of=/dev/rdisk0 bs=512 count=1

startupfiletool -v /dev/rdisk0 ./boot

bless -device /dev/disk0 -setBoot -verbose

 

Re-booting should then get you straight to OSX. Give that a shot. If you run into problems then do some searching on these forums. Amidst all the noise there are other discussions about how to set up your boot sector with OSX/grub/Windows etc.

 

thanks a lot for the guide. Ill try that right away and see if it works.

Link to comment
Share on other sites

 Share

×
×
  • Create New...