Put GRUB on MBR of external USB HDD during install?

Is there any way to have GRUB put on the MBR of the external USB HDD during install?

My computer’s BIOS can boot from USB HDDs, and I know I’ve been able to do this with Ubuntu, but couldn’t find any such option while installing opensuse 11. The only MBR specific option puts it to the MBR on the main system drive.

I’m hoping there’s a way to do this during install without having to open the computer and unplug the internal HDDs.

Oh well, maybe this guide will help

Installing SuSE on External USB Drive - openSUSE

Still a bit perterbing that there’s not an option to specifically install it to the MBR of a chosen disk. IIRC, the 10.x installers allowed this.

Hi. Well, we should keep in mind that when we talk about Grub, we’re actually talking about a Grub-based script (“Grub-Install”) and not about the program as such. If you want a more powerful interface to experiment with, you can always start the Grub program and work at the Grub prompt. That way, you bypass all the limits and weaknesses of the install script and cut directly “to the chase”. Anything that can be done with the script can also be done with Grub, moreover there are at least one exhaustive Grub manual and many tutorials on the Internet. It’s excellently documented and an enjoyable workout for your brain cells.:slight_smile:

You’re right - it used to be possible in YaST but AFAIK in 11.0 that is no longer an option.

There are several ways to go about this. I can give you instructions to replicate what Ubuntu does; you would need to do this from the DVD Rescue System after installation, disabling the installation of grub during install.

I can also give you instructions to install grub from its shell using the DVD Rescue System after installation, again having previously disabled the installation of grub during openSUSE install.

Or, I can give you what I believe is the most reliable and simplest - and what I use to boot a USB external - the Windows boot code in the MBR. During openSUSE installation, you install grub to the root partition’s boot sector and mark that partition “active”. After installation you use the DVD Rescue System to copy the Windows code to the external’s MBR: The drive will now boot exactly as your internal Windows drive does.

As I said, I have found the 3rd method works best. How do you want to proceed?

I would be happy to learn your third option. I’ve installed, installed grub to root (not sure how to tell if it’s been marked active)…tried what that guide said, but to no avail.

The guide is very useful but can be a bit difficult, and the grub section does not work in all cases for the reason described re the bios.

I hadn’t expected you to go ahead with the install. So, before I give you the MBR installation instructions, I need to see the partition table - you need to have installed root on one of the primaries, excluding the “extended” primary. This will also tell us if the partition has been marked active . . .

Boot from the DVD into Rescue System. Login as root. Then do

fdisk -l

Post back the output here. Copying over the MBR boot code requires only one simple command, but it is absolutely critical it be done exactly right.

Actually, I was working restoring my brother-in-law’s laptop, late last night. So in between downtime/installing updates for him, I went ahead and reinstalled Opensuse on my machine. I just resized the restore partition (an HP) and made 500MB for a /boot partition on the primary system drive, and installed the bootloader to the MBR.

This solution, mentioned in that guide I posted, does work.

However, since I know I’m not the first person on the internet to have asked this question, I think you should go ahead and post your method. Hopefully someone experiencing the same difficulties can stumble across this thread and use your solution.

There are several methods described in that USB External howto. Which did you use?

The “grub-install” script is not the same in openSUSE; it actually calls the script previously generated by YaST. The original Debian grub-install that Ubuntu uses is in openSUSE as “grub-install.unsupported”. Grub-install and grub-install.unsupported can work if the external drive has been defined in /boot/grub/device.map as (hd0), i.e., the first boot disk (this will happen automatically during openSUSE installation with some bios’s when the bios is configured to boot from the external).

The method I was referring to using the Windows MBR boot code, requires this, which just copies the code from the internal’s MBR to the external’s MBR:

dd if=/dev/<windows disk> of=/dev/<USB external disk> bs=440 count=1

This method also requires grub be installed to the root (or if separate, /boot) partition, that such partition be a primary (excluding the “extended” primary), and that such partition have its “boot flag” set (making it “active”) - all of which are also required by Windows.