2

I'm not a beginner with creating a dual booting system, but I guess I have a lot to learn still because I have been struggling with the current system for days.

I started off with a Windows 7 system that occupied two physical disks. I took the second and made it into an Ubuntu system. Currently, it looks like this:

/dev/sda1     NTFS    (labeled as "system reserved")
/dev/sda2     NTFS    Windows 7
/dev/sda3     NTFS    (Data for Windows 7 system to access)

/dev/sdb1     FAT32   Mounted on /boot/efi (flags "boot" and "esp")
/dev/sdb3     Ext4    Mounted on /

(There was a /dev/sdb2, but I deleted it and merged it into /dev/sdb3 with gparted.)

I installed Ubuntu 19.04 and it is working fine. But I cannot boot into Windows 7. I want to add Windows 7 to the grub menu or at least access it; I can't even do that now.

So, I've tried the following:

  • Run sudo update-grub.
  • Run sudo os-prober after mounting /dev/sda2.
  • Running boot-repair on the computer and also with a bootable live disk.
  • Running grub-customizer.

None of them work.

For boot-repair, I've tried several things such as "Reinstall GRUB" and "Restore MBR". If I do the "Recommended repair", I get a "GPT detected. Please create a BIOS-Boot partition (>1 MB, unformatted filesystem, ...). ...Alternatively, you can retry after activating the [Separate /boot/efi partition:] option." After running boot-repair for many years on other systems, this is the first time I've seen this message.

With grub-customizer, it created these lines for /dev/sda2 (Chainloader):

set root='(hd0,2)'
search --no-floppy --fs-uuid --set XXX
drivemap -s (hd0) ${root}
chainloader +1

When I reboot, I get errors like "no such device: XXX", "can't find command drivemap", and "disk hd0,2 not found".

Of all the times I've gone through this problem with other computers, I guess this is the oldest I've had. (It has Windows 7, after all.) Likewise, the BIOS is old as well. So, that is stumping me. I'm also a bit concerned I've some how destroyed the (Windows) system. I tried the "Restore MBR" option of boot-repair and wrote the MBR to /dev/sda2 and I still couldn't boot into Windows -- it goes to grub instead. (When I realised this, then I thought I need to ask others for help...this feels bad now.)

The Ubuntu side is a fresh install and if I need to somehow destroy that to undo a mistake I made in order to get it to dual boot, I'm fine with that.

Can anyone offer suggestions on what I should try? As I'm honestly guessing, I'm sure the answer is right in front of me but some suggestions on what I should try and perhaps the order would help.

Ray
  • 2,071
  • 1
    You mixed up boot modes, Windows is installed in legacy mode, Ubuntu in UEFI mode. One way to solve this is to reinstall Ubuntu in legacy mode. Make sure you boot installer in legacy mode. – mook765 May 10 '19 at 07:17
  • @mook765 Thank you very much! That was my problem! I didn't even realise that mattered. I've spent several days this week trying and repeating the various suggestions above. I even re-installed Ubuntu, but without knowing the cause, I was picking Ubuntu in UEFI mode over and over again. Feel free to provide a proper answer for me to accept -- thank you! – Ray May 10 '19 at 15:40
  • You should be able to boot, but only from UEFI boot menu. You may have to turn on/off UEFI/BIOS boot mode to match how system is installed, but most UEFI will boot ok and auto switch mode to match what you are booting. UEFI & BIOS are not compatible and once you start to boot in one mode, you cannot switch. And converting Windows is not particularly easy, but reinstalling grub can convert an Ubuntu install. Since Windows 7 expires next year, you may want to consider a full reinstall in UEFI mode, but only have really good backups. – oldfred May 10 '19 at 18:49
  • @oldfred I checked the BIOS and there wasn't a way to switch boot modes. I think the BIOS is old enough to not have that option (I know more recent computers do). As for the Windows 7 part, it's not my choice. It's a computer that was handed to me to use and there is a tiny chance its former user will want her Windows files again. So, I don't expect to use Win7 myself. But I need to make sure it's accessible until that person says she doesn't want her data back. Thanks for the additional info! – Ray May 12 '19 at 10:25
  • Microsoft required vendor to let users turn UEFI secure boot on/off. If UEFI Secure boot is on, then it will be UEFI only (will not boot in BIOS mode). If off they you should be able to boot in UEFI (without Secure boot) or BIOS. Have you updated UEFI from vendor, most systems need that. And if responsible for data, you must back up the Windows partition(s). Usually best to use Windows tools for that backup. What brand/model system? – oldfred May 12 '19 at 13:41
  • @oldfred Thanks for the follow-up! But I really don't know what Microsoft requires. I do know that this computer is old. It's Windows 7, but it doesn't mean it came with Windows 7 -- it could have been upgraded from an older OS version. In any case, there is no UEFI/legacy on/off button in the BIOS. I can choose to boot a USB drive in UEFI or legacy mode, though. And I haven't updated the BIOS; I guess the previous owners may not have as well. – Ray May 13 '19 at 15:26
  • As for backing up the data, I'm not interested in backing up the Windows data. I'm sorry if somehow my previous message implied that. I just want it accessible in case the previous owner of the computer asks for it. In short, I don't want them to blame my installation of Ubuntu for hindering access to their data. Even so, thank you for your suggestions! – Ray May 13 '19 at 15:28

1 Answers1

0

Boot mode (legacy vs EFI) matters. Grub is not able to chainload a bootloader in a different boot mode, so to achieve a proper multi-boot, all OS's must be installed in the same boot mode. It seems to be a common mistake to install in the wrong boot mode.

From the little information in the question I couldn't be 100% sure, but it looked like your Windows is installed in legacy mode, while Ubuntu appeared to be installed in EFI mode.

You can solve this in different ways, one way is to reinstall Ubuntu in legacy mode. You have to make sure to boot the installer in legacy mode, that's all.

Another way is to reinstall only the bootloader (Grub). Just boot into your installed Ubuntu (in EFI-mode) and run

sudo apt update
sudo apt install grub-pc

This will remove grub-efi (the EFI version of Grub) and install grub-pc (the BIOS version of Grub). During installation you will be asked where to place the bootloader. This is interesting as you have multiple disks and you don't need to overwrite Windows bootloader which should reside in sda. So you should place Grub on sdb. In BIOS you will have to check the boot order then. Additional clean-up is not absolutely necessary but removing the line regarding /boot/efi from /etc/fstab makes sense, it's not needed anymore.

Another thing you should know:

If the disk where you want to place Grub uses GPT you need to create a small (2MB) partition with bios-boot flag and leave it unformatted (no file system). Grub's core.img will be placed there.

mook765
  • 15,925
  • Thanks again for your help and the extensive answer here! Indeed, just to clarify that I gave "little information" in my original question because I didn't know that was the problem. So thanks for going out on a limb and guessing what my problem was. I have been using Ubuntu since the legacy boot days, but this is the first time I encountered a mixed system -- now I know what it looks like. Thanks! – Ray May 12 '19 at 10:21