0

After installing Ubuntu again (after failed 18.04 update), I am now in a state where I think I have two GRUB installs.

My intent was to have Windows 10 on the Samsung SSD and Ubuntu on the WDC HD. During Ubuntu installation, I picked "Something Else" and chose the /dev/sda which was the HD disk.

After all that, here is what my UEFI BIOS sees. So to me it looks like GRUB was installed on both disks. And looking at the partitions, I can see an EFI partition on the Windows SSD now.

UEFI Disks

Both Ubuntu options load to the same GRUB screen, so I want to get rid of the one on the SSD.

GRUB

How do I remove the ubuntu (SATA6G_2: WDC WD10EZEX-22MFCA0) option? And is this possible without having to run any kind of boot repair programs? I don't want to risk losing my BitLocker encrypted Windows.

EDIT: Here is the output of sudo parted -l from Ubuntu side.

Model: ATA WDC WD10EZEX-22M (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system     Name                  Flags
 1      1049kB  538MB   537MB   fat32           EFI System Partition  boot, esp
 2      538MB   983GB   983GB   ext4
 3      983GB   1000GB  17.1GB  linux-swap(v1)


Model: Linux device-mapper (crypt) (dm)
Disk /dev/mapper/cryptswap1: 17.1GB
Sector size (logical/physical): 512B/4096B
Partition Table: loop
Disk Flags: 

Number  Start  End     Size    File system     Flags
 1      0.00B  17.1GB  17.1GB  linux-swap(v1)


Model: NVMe Device (nvme)
Disk /dev/nvme0n1: 512GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name                          Flags
 1      17.4kB  16.8MB  16.8MB               Microsoft reserved partition  msftres
 2      16.8MB  512GB   512GB                Basic data partition          msftdata


Model: NVMe Device (nvme)
Disk /dev/nvme1n1: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End    Size    File system  Name                          Flags
 1      1049kB  473MB  472MB   ntfs         Basic data partition          hidden, diag
 2      473MB   577MB  104MB   fat32        EFI system partition          boot, esp
 3      577MB   593MB  16.8MB               Microsoft reserved partition  msftres
 4      593MB   499GB  499GB                Basic data partition          msftdata
 5      499GB   500GB  842MB   ntfs                                       hidden, diag
mvd
  • 171
  • May be best to see details, use ppa version with your live installer or any working install, not older Boot-Repair ISO, report is somewhat limited with newer NVMe drives, but still shows a lot. Please copy & paste link to the Boot-info summary report ( do not post report), the auto fix sometimes can create more issues. https://help.ubuntu.com/community/Boot-Repair Normally UEFI has two entries, one for grubx64.efi and one for shimx64.efi. Shim is for UEFI secure boot but works with Secure boot off. Not sure why then there also is the grub entry. – oldfred Apr 11 '19 at 02:32
  • I wouldn't worry about it. You only have one grub file. Grub 2.2 is showing 2 entries for Ubuntu (main one is first), and what looks like 6 alternatives for Windows. You can clean all that up if you want. It would be more useful to run sudo parted -l to look at your partitions from Ubuntu. – Paul Benson Apr 11 '19 at 03:04
  • @PaulBenson Added the output. – mvd Apr 11 '19 at 22:23
  • Like I said, you only have 1 grub, installed on your Western Digital HDD (sda). What you have are 2 ESP partitions, 1 on sda and the other on your M2/SSD (nvme1n1) , where it looks like W10 is installed. Only 1 ESP is used for booting and in a dual Windows boot it's usually the ESP on the Windows disk. – Paul Benson Apr 12 '19 at 01:14

1 Answers1

1

I am reproducing Part-IV of my answer from the post Dual Boot Windows 10 and Linux Ubuntu on Separate SSD in order to answer this current post. For screenshots, please refer above post (Part-IV).

The answer is split into two sections such as Section-1 (The action at Windows-10) and Section-2 (The action at Ubuntu side).

Section-1

Now, the action begins from Windows-10.

Step-1.1:

Press Windows + X and select Command Prompt (Admin) and run diskpart command.

diskpart

Step-1.2:

Issue the following commands to list available disks:

DISKPART>list disk

Now select the target disk which contains Windows installation.

DISKPART>sel disk 0

Step-1.3:

Now list the partitions in the disk, so that the partition (volume) that corresponds to the Boot EFI folder can be identified.

DISKPART>list vol

Now find out partition (volume) with label EFI and System in the info column.

Warning: Please select correct volume based on the above input. If you make a mistake, you may harm the selected partition (volume).

DISKPART>sel vol 3

Now Volume 3 is the selected volume.

After it has been identified and selected, you assign it an unused drive letter to make it easier to work with. Here drive letter 'G' was assigned.

DISKPART>assign letter=G:

Step-1.4:

Now issue cd to 'g' drive, by this command

DISKPART>cd /d g:

Now list the contents by dir command

DISKPART>dir /B

You will obeserve a folder EFI in the list, issue the command to cd to EFI:

DISKPART>cd /d efi

Now, list the contents of directory efi and you will see a folder in the name something like ubuntu. To remove it issue the following command:

DISKPART>rmdir /S ubuntu

To make sure that ubuntu has been removed, issue dir command again:

DISKPART>dir /B

The output will show only two entries.

Exit from diskpart command.

DISKPART>exit

Section-2

Now, the action shifts to Ubuntu side.

Step-2.1:

Now restart computer and login into Ubuntu system.

Open up terminal by hitting Ctrl+Alt+T and run following command to show boot entries:

$ sudo efibootmgr 

You will see the following similar output:

BootCurrent: 0001
Timeout: 1 seconds
BootOrder: 0001,0000,0002
Boot0000* Windows Boot Manager
Boot0001* ubuntu
Boot0002* Ubuntu

Boot entry 2 should be removed. How to confirm this?

Step-2.2:

Issue the following verbose command :

$ sudo efibootmgr -v                    # issue this verbose command

Whose output is as follows:

BootCurrent: 0001
Timeout: 1 seconds
BootOrder: 0001,0000,0002
Boot0000* Windows Boot Manager  HD(1,GPT,74ab4c2d-3660-4780-a9a1-f3cad2a533c0,0x800,0x32000)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}...M................
Boot0001* ubuntu    HD(1,GPT,55a574ce-441a-4032-b8ea-5009b5bc4222,0x800,0xf3800)/File(\EFI\UBUNTU\SHIMX64.EFI)
Boot0002* ubntu     HD(1,GPT,74ab4c2d-3660-4780-a9a1-f3cad2a533c0,0x800,0x32000/File(\EFI\UBUNTU\SHIM.EFI)..BO

Boot entry 2 has the same UID for SSD disk as boot entry 0 which is windows loader.

For example, 74ab4c2d-3660-4780-a9a1-f3cad2a533c0 matches entry 0 as well as entry 2.

Step-2.3:

Issue the following command to remove entry 2:

$ sudo efibootmgr -b 2 -B               # where 2 is the boot entry Boot0002.

Now the entry 2 has been removed.

Warning: Please select correct extraneous boot entry for removal. If you make a mistake, you may harm a needed bootloader.

Step-2.4:

To confirm the removal, just issue the following command:

$ sudo efibootmgr                   # issue this command to display boot entries

Whose output is as follows:

BootCurrent: 0001
Timeout: 1 seconds
BootOrder: 0001,0000
Boot0000* Windows Boot Manager
Boot0001* ubuntu

You can observe that only two entries are present rather than three.

Just see the entries marked with *.

Step-2.5:

Reboot the system and press del key and enter into BIOS setup screen.

Now you will find only two bootloaders viz., Windows boot loader and Ubuntu boot loader.

Marmayogi
  • 2,488
  • I don't think you can run Step-1.4 from within DISKPART. You can exit DISKPART and run the script though. – Moobie Nov 20 '22 at 07:10