2

I have now three hard disks in my desktop. A Samsung SSD that boots Win7, a Toshiba HDD which is not bootable, and yesterday I added a Crucial SSD which boots Ubuntu 21.04.

If I now simply start my computer, Linux on the Crucial will boot..

If at startup I press F11 this allows to choose between these three and surprisingly, a non-existing fourth named "Ubuntu"(?). If I click on the Samsung then Windows will boot, if I click on the Crucial (or Ubuntu) Ubuntu will boot. As you can see on the left of the two pictures:

https://ibb.co/ctB75g0

The right picture shows what I get when press F2, the boot order setting at the ASRock Motherboard, while booting, I only get to "choose" between the identical Crucial and Ubuntu...

I want the Samsung to boot Win7 as default. From what I have heard, I have to do this in Ubuntu, and I know absolutely nothing about it. How do I make this change?

It was suggested to use grub-customizer for this, but as the picture shows, it does not even see the Samsung disk with the Windows.

https://ibb.co/fq1bKZC

My Win7 is not an UEFI, it is a legacy installation. Could that be the reason?

4
  • 1
    Does this answer your question? Unable to boot into Windows after installing Ubuntu, how to fix? May 29, 2021 at 8:34
  • 1
    I am NOT unable to boot into Windows, I want it to be the default...
    – rossdorn
    May 29, 2021 at 9:04
  • 2
    Your Win7 is legacy, your Ubuntu is UEFI. You will not be able to boot them both from a single grub menu. Your simplest solution is to reinstall Ubuntu in Legacy mode.
    – PonJar
    May 29, 2021 at 9:35
  • Thank you, that is what I thought too, but of course I have no idea how to do that. I can boot both from the normal BIOS of my ASRock motherboard, and it ...... me off, that Ubuntu simply overrides settings on my computer without asking! Arer there instructions for this, that are understandable for some new to Ubuntu?
    – rossdorn
    May 29, 2021 at 9:50

2 Answers 2

0

You can convert an existing installation of Ubuntu from legacy to UEFI and vice versa. You need to reinstall GRUB to the device hosting grub, in my case this is /dev/nvme0n1

Legacy to UEFI

sudo grub-install --boot-directory=/boot --bootloader-id=ubuntu  --target=x86_64-efi --efi-directory=/boot/efi  /dev/nvme0n1

UEFI to Legacy

sudo grub-install --boot-directory=/boot --bootloader-id=ubuntu /dev/nvme0n1

Then update grub sudo update-grub

Now you can list grub entries by using this command:

grep -E "^(menuentry|submenu)" /boot/grub/grub.cfg | cut -d"'" -f2 | nl -v0

In my case it will show the following

     0  Ubuntu
     1  Advanced Options for Ubuntu
     2  Windows Boot Manager (sur /dev/nvme1n1p2)
     3  UEFI Firmware Settings

After you have to edit /etc/default/grub and set the corresponding number to GRUB_DEFAULT=0.

In my case Windows is entry n°2 so it will be GRUB_DEFAULT=2

Then you have to use sudo update-grub to update your grub, and now your computer will always boot windows by default.

Cheers

9
  • Thank You... As far as I have understood PonJar's comment, I need to change the ubuntu installation from UEFI to legacy ??? You mention the other way around.... ?
    – rossdorn
    May 29, 2021 at 12:12
  • I've edited my comment, you can change from legacy to uefi and vice versa.
    – Fractalyse
    May 29, 2021 at 13:09
  • UEFI drive should be partitioned as gpt, not older MBR. And with gpt you need a bios_grub partition 1MB unformatted with bios_grub flag for correct BIOS/CSM/Legacy install of grub (grub-pc). Or you need an ESP - efi system partition as FAT32 300 to 500MB with esp/boot flags for UEFI install of grub (grub-efi-amd64). When I was first converting drives to new UEFI install I added both bios_grub & ESP as first two partitions. I already had started using gpt with all BIOS installs on old system several years before.
    – oldfred
    May 29, 2021 at 14:33
  • Fractalyse.... What does: "^(menuentry|submenu)" mean in this line:grep -E "^(menuentry|submenu)" /boot/grub/grub.cfg | cut -d"'" -f2 | nl -v0 As I wrote, I am new to Linux and I did not know that installing ubuntu would upset the other half of my computer and not mention windows in its boot options...
    – rossdorn
    May 30, 2021 at 9:00
  • It's a bash command, that shows you the entries of grub menu. If you are not familiar with Linux and terminal commands, the simplest way for you is to reinstall Ubuntu in legacy mode by disabling UEFI in your BIOS.
    – Fractalyse
    May 30, 2021 at 14:09
0

I've searched similar solution recently and this is the best I've found

boot loader configure last saved in ubuntu terminal

So according to this answer you can change the boot loader to load the last os you opened! also if you're not comfortable with gedit you can select for nano editor. This video shows to do with nano editor in very precise explaination.

You must log in to answer this question.

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