2

I've just installed Windows 11 on the first partition of my disk,that's partitioned like this :

# fdisk /dev/sdb -l

Disk /dev/sdb: 465.76 GiB, 500107862016 bytes, 976773168 sectors Disk model: Samsung SSD 860 Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x1967ba67

Device Boot Start End Sectors Size Id Type /dev/sdb1 * 2048 273092607 273090560 130.2G 7 HPFS/NTFS/exFAT /dev/sdb2 273092608 274454527 1361920 665M 27 Hidden NTFS WinRE /dev/sdb3 274456576 276553727 2097152 1G 82 Linux swap / Solaris /dev/sdb4 276553728 976772477 700218750 333.9G 83 Linux

As you can see, Ubuntu 18.04 is installed on /dev/sdb3 and /dev/sdb4.

Previously Windows 10 was installed instead of Windows 11.

The problem is that the installation of Windows 11 broke grub2 that was installed on top of the disk /dev/sdb and now I want to reinstall it. I've tried to do like this :

# sudo grub-install --recheck --no-floppy --root-directory=/ /dev/sdb

But it gives this error :

Installing for x86_64-efi platform.
grub-install: error: cannot find EFI directory.

I think that it is a bug, because it detects an EFI partition, which isn't there. The disk has been formatted with MBR and it is DOS style and I have installed Windows 11 using RUFUS using the MBR method. Even /dev/sda is not EFI style :

# fdisk /dev/sda -l

Disk /dev/sda: 465.76 GiB, 500107862016 bytes, 976773168 sectors Disk model: CT500MX500SSD4
Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disklabel type: dos Disk identifier: 0xa6e39599

Device Boot Start End Sectors Size Id Type /dev/sda1 * 2048 976767672 976765625 465.8G 83 Linux

What's the right procedure here to reinstall grub2?

cipricus
  • 4,066
  • 4
  • 47
  • 106
Marietto
  • 635
  • 4
  • 13
  • 40

2 Answers2

1

I've used ubuntu 21.04 in "try" mode and I have installed Boot-Repair. I've chosen to reinstall grub2 on the /dev/sdb and it did all the necessary steps correctly. After rebooting I was able to boot ubuntu 18.04 installed on /dev/sdb4

Marietto
  • 635
  • 4
  • 13
  • 40
0

Use the --target=i386-pc flag.

Source: https://wiki.archlinux.org/title/GRUB#Master_Boot_Record_(MBR)_specific_instructions