Remove other linux from dual boot-keep O-suse

Hi All
For the last month I have been dual booting LM(first os) and O-suse. Time has come to remove LM as I am very happy with O-suse.

gde@linux-raih:~> sudo efibootmgr
BootCurrent: 0003
Timeout: 2 seconds
BootOrder: 0003,0000,0001,0004,0005,0002,0006,0007
Boot0000* ubuntu
Boot0001* ubuntu
Boot0002* UEFI:CD/DVD Drive
Boot0003* opensuse-secureboot
Boot0004* opensuse
Boot0005* UEFI OS
Boot0006* UEFI:Removable Device
Boot0007* UEFI:Network Device

Not sure why Ubuntu is listed and just guessing that I mucked around when LM only was installed.
I have searched a lot and there are mainly answers re removing linux from Win dual booting.
What would be the best way to go about it? Thanks

sudo parted -l

sudo parted -l
Model: ATA Micron_M600_MTFD (scsi)
Disk /dev/sda: 256GB
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
 2      538MB   42.5GB  41.9GB  ext4
 4      42.5GB  85.4GB  43.0GB  btrfs           primary
 5      85.4GB  128GB   43.0GB  xfs             primary
 3      248GB   256GB   8487MB  linux-swap(v1)

You can remove entries in the UEFI table with efibootmgr (see man efibootmgr for details)

You can reuse the partition I’m guessing sda2 reformat it mount it some where…whatever you want to do with it

Edit the efi boot partition. /boot/efi and remove any reference to OS you don’t want

You will need to re build grub2 so that the OS does not show there easiest way in Yast-bootloader make a change and then reverse it so that yast thinks a change is made accept and grub will be rebuilt

I’m assuming that “LM” stands for “Linux Mint”.

Mint is a derivative of ubuntu, and a Mint install does call the installed system “ubuntu”. They are using the “ubuntu” shim for booting, and to allow secure boot. Possibly, the ubuntu shim requires that it be named “ubuntu” in order to work.

You should be able to remove the “ubuntu” UEFI boot entries with:


# efibootmgr -b 0000 -B
# efibootmgr -b 0001 -B

However, this depends somewhat on the firmware (or BIOS). On one of my computers, those entries will come back after a reboot, unless I also do:

# rm -rf /boot/efi/EFI/ubuntu

(that is, remove the “ubuntu” directory from the EFI partition).

thanks@ **nrickert
**I did check the Yast2 Boot loader and have here below an image of the entries. There are more than two entries and I’m nervous which ones are the right ones . Those that you mention makes sense to me also.
https://s28.postimg.org/rhhcpdm21/20170105_081411.jpg](https://postimg.org/image/rhhcpdm21/)

The options shown in your image do not come from those UEFI entries. Rather, when generating the grub boot menu, it probes what is in the various partitions. So those entries for Mint will still appear until you remove the Mint partition(s) (or reformat them). And they will probably still work.

If you remove those partitions, then regenerate the boot menu

# grub2-mkconfig -o /boot/grub2/grub.cfg

(run that in opensuse)
then the entries will disappear.

If you don’t currently have another use for the disk space, then just ignore the Mint boot entries. Treat them as just a little visual clutter.

Thanks@nrickert
I have managed some of the things you suggested though haven’t had enough courage to remove one boot entry(more below).
this is how it looks now:
https://s28.postimg.org/gb3ggn2ft/efi_late_2_010117.jpg](https://postimg.org/image/gb3ggn2ft/)I still seem to have my LM 18 on there. I wonder if it is Boot0005 UFEI OS? It is also there in the boot options when I boot the system. Is there a way to figure out if Boot0005 is the Linux Mint(18)?

Your UEFI boot entries look okay.

Your grub update is still finding Mint and adding an entry to the grub boot menu. Personally, I would ignore that. When you re-use “/dev/sda2” for something else, it will go away.

The “UEFI OS” entry is standard. It’s the fallback boot entry for when everything else goes wrong.

Yes, it is possible that it boots Mint. If so, you can change that to make it a fallback for opensuse.

But maybe first check. Compute the md5sum of that file “bootx64.efi” (in “/boot/efi/EFI/Boot”). And compare it with the md5sum for both “shim.efi” and “grubx64.efi” in the directory “/boot/efi/EFI/opensuse”. If it matches one of those, then you already have the right fallback.

Thanks!
The md5sum of “bootx64.efi” and “shim.efi” in “/boot/efi/EFI/opensuse” do match. Is there a specific way to make the LM 18 the fallback?
https://s27.postimg.org/c9xj701ov/md5sum.jpg](https://postimg.org/image/c9xj701ov/)

Okay. That was my guess. That directory (“/boot/efi/EFI/Boot”) was probably empty, so shim-install filled it it as a fallback.

Is there a specific way to make the LM 18 the fallback?

If you are not using secure-boot (and I think you are not), then simply copy the “grubx64.efi” from the ubuntu directory to “bootx64.efi” in the “/boot/efi/EFI/Boot” directory.

If you have lost that “grubx64.efi” (deleted the ubuntu directory in the EFI partition), then no worries. It’s the same file as “/boot/grub/x86_64-efi/core.efi” relative to your Mint installed system.

Thank you.
I have just tried to boot LM 18 and it booted normal. I did not change or copy anything across. Interestingly I get a new splash screen.
Magic lol.
https://s30.postimg.org/6kbxyy0ot/IMG_20170108_142109.jpg
If there is no major problem with the above change I’ll leave it for good now.