5

I am trying to dual boot Windows and Linux. I would like to continue using the Windows bootloader in my MBR.

I installed Windows 7 first. During the install I left some unallocated space that I intended to install Linux.

I found this guide: http://neosmart.net/wiki/display/EBCD/Linux

It says to install GRUB to the bootsector of the partition that Linux is being installed to and not the MBR of your hard drive.

I am trying to install Linux Mint Debian to the second partition. When the installer gets to where you are asked to install GRUB the only option is to install GRUB to /dev/sda which I believe is the MBR.

I decided just not to install GRUB and proceeded with the installation.

How can I install GRUB to the bootsector of my Linux partition?

3 Answers 3

5

Typically if you want to install GRUB or lilo or any of the bootloaders to the partition rather than the MBR you simply substitute the actual partition in place of the drive identifier.

e.g where you would use

grub-install /dev/sda

to install it to the drive (bootsector/MBR), you instead use

grub-install /dev/sda3

to install it to the bootsector of the third partition of that drive.

To then set up the Windows bootloader to be able to boot Linux How to dual-boot Vista with Linux (Vista installed first) looks like it will show you how to set up the bootloader properly. It is for Vista but the bootloader is the same for Windows 7 and should Just Work.

1
  • In case the link dies: You have to update the Windows MBR boot sector with info from the grub config file. The link refers to a tool a called easy BCD to help do that.
    – jiggunjer
    Jan 28, 2016 at 1:16
2

I'm not especially familiar with the Linux Mint system, but my understanding is that it's derived from Ubuntu and uses the same Ubiquity installation system. There is a reported bug with Ubiquity's bootloader install process which seems to match what you described.

My suggestion is that it may be easier to allow Linux Mint to overwrite the MBR and then reinstate the Windows bootloader afterwards. The site that you linked to publishes a tool called EasyBCD (a no cost download) that is well reviewed, it looks like a good tool that can reinstall the Windows bootloader and edit the boot menu.

I think recent versions of Linux Mint are using GRUB2 which should have no problem detecting your existing Windows partition. GRUB will add Windows to its boot menu, and once the Linux install is done you can reboot into Windows and use EasyBCD to reinstall the Windows bootloader and edit the Windows boot menu.

You might have already seen it, but on the site you linked to, there are some more specific instructions for an Ubuntu/Windows Vista dual-boot configuration that should be similar enough to adapt to your Windows 7/Linux Mint setup.

0

I remember having encountered such issue with Mint and I'm currently encountering it with Ubuntu (version 16.04): the installer is tyrannical enough to not allow any other choice than /dev/sda as the location for Grub.

Furthermore, trying to set Grub, afterwards to Linux's root partition on /dev/sdaX using the rescue mode from the installation CD fails with a fatal error.

Other distributions are much more flexible in this regard, like CentOS (and probably also Debian, although I cannot remember well).

Does anyone know if the following procedure could work?

  1. cloning the MBR after Window's install to a file "WindowsBootloader.img"
  2. installing Ubuntu/Mint and accepting Grub being written to the MBR (/dev/sda)
  3. cloning the MBR a file "GrubBootloader.img"
  4. cloning back the file done at step 1 to the MBR.
  5. using the Bcdedit native utility (or third-party EasyBCD) and use the file stored at step 4.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .