Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[Installation] trouble getting grub installed on dual boot system

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
geotechtribe
Posts: 26
Joined: 2022-10-01 01:45

[Installation] trouble getting grub installed on dual boot system

#1 Post by geotechtribe »

I am new to Debian coming from openSUSE... on my ASUS Zenbook laptop, I have the hard drive formatted with 2 root partitions, one for running suse and the other for running Debian.

On the initial install, it installed grub fine and booted into Debian. But I was still getting used to Debian and needed access to opensuse so I ran the openSUSE restore grub procedure. This set it up so that now on my grub menu from initial boot up, openSUSE is the first choice and Debian is the 2nd. But I am now familiar enough with Debian that I am probably not going back to opensuse and will move fully into Debian.

When I run sudo update grub on my laptop in Debian, it says it updates grub with no errors, but when I reboot, it still uses the grub setup that I had with opensuse. So I think grub is pointing to the original Debian setup that I had, and whenever there is an update to Debian that requires grub to point to something different, like a kernel upgrade, I am not able to boot into that with the grub setup I have, because it was setup by openSUSE and the 2nd grub menu option points to the kernel that came with Debian at the time I installed it.

I want to make it so my computer goes to Debian's grub setup instead of opensuse. But when I run sudo update grub, even though it says grub is installed with no errors, nothing changes on the grub menu. It is still very clearly an opensuse based grub menu with opensuse as the default option and a non-updated debian as the 2nd.

How do I get my system to point to a newly updated grub installed by Debian and not by opensuse?

User avatar
sunrat
Administrator
Administrator
Posts: 6382
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 115 times
Been thanked: 456 times

Re: [Installation] trouble getting grub installed on dual boot system

#2 Post by sunrat »

update-grub updates GRUB's configuration files but does not install it. Assuming you are on a Bullseye UEFI system, run

Code: Select all

grub-install
which should work in most cases. Post back if it doesn't.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

geotechtribe
Posts: 26
Joined: 2022-10-01 01:45

Re: [Installation] trouble getting grub installed on dual boot system

#3 Post by geotechtribe »

Thank you, it's a start. The installation failed - here is the output:

Code: Select all

$ sudo grub-install
Installing for i386-pc platform.
grub-install: error: install device isn't specified.

$ sudo fdisk -l
Disk /dev/nvme0n1: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: WDS100T3X0C-00SJG0                      
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: gpt
Disk identifier: 5ED813F1-0012-48F5-9615-CF120E3D10ED

Device              Start        End    Sectors   Size Type
/dev/nvme0n1p1       2048    1026047    1024000   500M Microsoft basic data
/dev/nvme0n1p2    1026048   55711743   54685696  26.1G Linux filesystem
/dev/nvme0n1p3   55711744  110397439   54685696  26.1G Linux filesystem
/dev/nvme0n1p4  110397440 1943756799 1833359360 874.2G Linux filesystem
/dev/nvme0n1p5 1943756800 1953523711    9766912   4.7G Linux swap

$ sudo grub-install /dev/nvme0n1
Installing for i386-pc platform.
grub-install: warning: this GPT partition label contains no BIOS Boot Partition; embedding won't be possible.
grub-install: warning: Embedding is not possible.  GRUB can only be installed in this setup by using blocklists.  However, blocklists are UNRELIABLE and their use is discouraged..
grub-install: error: will not proceed with blocklists.

$ mount | grep nvme
/dev/nvme0n1p3 on / type ext4 (rw,relatime,errors=remount-ro)
/dev/nvme0n1p4 on /home type ext4 (rw,relatime)
/dev/nvme0n1p1 on /boot/efi type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro)
So my current grub installation looks to the mounted partition, which is nvme0n1p1, as the BIOS boot partition, even though the partition type is labeled as Microsoft basic data. Is there a way to get Debian's grub installer to do the same thing?

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: [Installation] trouble getting grub installed on dual boot system

#4 Post by p.H »

geotechtribe wrote: 2022-10-24 11:39 When I run sudo update grub on my laptop in Debian, it says it updates grub with no errors, but when I reboot, it still uses the grub setup that I had with opensuse.
You need to run update-grub from openSUSE, not Debian.
sunrat wrote: 2022-10-24 13:18 Assuming you are on a Bullseye UEFI system
If it is a UEFI system, you do not need to reinstall GRUB. You can just change the EFI boot order to make Debian first with efibootmgr or even the UEFI firmware setup if it allows it.
geotechtribe wrote: 2022-10-24 18:17

Code: Select all

$ sudo grub-install
Installing for i386-pc platform.
/dev/nvme0n1p1       2048    1026047    1024000   500M Microsoft basic data
/dev/nvme0n1p1 on /boot/efi type vfat
Weird. grub-install does not detect a UEFI setup but a FAT partition is mounted on /boot/efi (as an EFI partition would be) but this partition does not have the expected "EFI system partition" type.
Please post the output of the following commands in Debian and openSUSE:

Code: Select all

ls /sys/firmware
ls /boot/efi/EFI
efibootmgr
cat /etc/fstab
dpkg -l grub*
geotechtribe wrote: 2022-10-24 18:17 So my current grub installation looks to the mounted partition, which is nvme0n1p1, as the BIOS boot partition
What do you mean by "current grub installation" ? openSUSE or Debian ?
A BIOS boot partition has no filesystem and is not mounted. Also, it has the "BIOS boot" type, not Microsoft basic data.

User avatar
sunrat
Administrator
Administrator
Posts: 6382
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 115 times
Been thanked: 456 times

Re: [Installation] trouble getting grub installed on dual boot system

#5 Post by sunrat »

p.H wrote: 2022-10-24 21:17
geotechtribe wrote: 2022-10-24 11:39 When I run sudo update grub on my laptop in Debian, it says it updates grub with no errors, but when I reboot, it still uses the grub setup that I had with opensuse.
You need to run update-grub from openSUSE, not Debian.
OP wants to change to Debian GRUB.
Weird. grub-install does not detect a UEFI setup but a FAT partition is mounted on /boot/efi (as an EFI partition would be) but this partition does not have the expected "EFI system partition" type.
Perhaps no ESP is present.

Code: Select all

sudo blkid
would be helpful.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

geotechtribe
Posts: 26
Joined: 2022-10-01 01:45

Re: [Installation] trouble getting grub installed on dual boot system

#6 Post by geotechtribe »

Apologies for taking a month to follow up with this. Work requirements pulled me away for a while. So, to review, I have a laptop that was originally installed with openSUSE, and I have now switched to Debian, running Bullseye. The grub setup, however is from openSUSE, and I am not able to get the grub that was installed with Debian to work. When I boot up, the boot process points to the grub that was installed with openSUSE, and no amount of updating my system in Debian has switched grub over to Debian's version of grub. So, the grub that I boot up with has openSUSE as the default option, and Debian as the 2nd option.

Here are the outputs you requested, first from Debian:

Code: Select all

$ ls /sys/firmware/
acpi  dmi  efi  memmap

$ ls /boot/efi/
$RECYCLE.BIN/              EFI/                       System Volume Information/

$ efibootmgr
bash: efibootmgr: command not found

$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# systemd generates mount units based on this file, see systemd.mount(5).
# Please run 'systemctl daemon-reload' after making changes here.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/nvme0n1p3 during installation
UUID=94116ed5-32ec-42f3-965c-ebb9dda88abf /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/nvme0n1p1 during installation
UUID=9B45-3631  /boot/efi       vfat    utf8            0       0
# /home was on /dev/nvme0n1p4 during installation
UUID=342de0ec-612b-4ec3-bef9-1cea3927e9a3 /home           ext4    defaults        0       2
# swap was on /dev/nvme0n1p5 during installation
UUID=73e8a34e-22e2-4afd-98ae-112926cb379e none            swap    sw              0       0

$ dpkg -l grub *
dpkg-query: no packages found matching bin
dpkg-query: no packages found matching birinen
dpkg-query: no packages found matching CalibreLibrary
dpkg-query: no packages found matching Desktop
dpkg-query: no packages found matching displaymanager
dpkg-query: no packages found matching Documents
dpkg-query: no packages found matching Downloads
dpkg-query: no packages found matching Downloads_nosync
dpkg-query: no packages found matching Dropbox
dpkg-query: no packages found matching dwhelper
dpkg-query: no packages found matching ebooks
dpkg-query: no packages found matching fonttest
dpkg-query: no packages found matching GitDatProj
dpkg-query: no packages found matching Jody's CLA
dpkg-query: no packages found matching Jts
dpkg-query: no packages found matching LinuxNotes
dpkg-query: no packages found matching linux_signing_key.pub
dpkg-query: no packages found matching lshw.html
dpkg-query: no packages found matching Music
dpkg-query: no packages found matching MyData
dpkg-query: no packages found matching net.downloadhelper.coapp-1.6.3
dpkg-query: no packages found matching nohup.out
dpkg-query: no packages found matching Pictures
dpkg-query: no packages found matching podcastsDellSync
dpkg-query: no packages found matching Public
dpkg-query: no packages found matching qanon-2021-11-17_14.50.58.mkv
dpkg-query: no packages found matching simplesc_test-2021-11-17_14.49.08.mkv
dpkg-query: no packages found matching simplesc_test-2021-11-17_14.50.04.mkv
dpkg-query: no packages found matching TagalogStart1109
dpkg-query: no packages found matching temp
dpkg-query: no packages found matching Templates
dpkg-query: no packages found matching tempSDbak
dpkg-query: no packages found matching thinkorswim
dpkg-query: no packages found matching Videos
dpkg-query: no packages found matching windocs
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
un  grub           <none>       <none>       (no description available)

$ sudo blkid
/dev/nvme0n1p1: SEC_TYPE="msdos" LABEL_FATBOOT="ESP" LABEL="ESP" UUID="9B45-3631" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="1d32dc52-2c48-45ec-9609-356aeb2a0df5"
/dev/nvme0n1p2: LABEL="root1" UUID="ba22e191-6161-418b-8fa4-9e9736bbaf26" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="b250f42e-ca58-452f-9bc1-b38a34f2beb6"
/dev/nvme0n1p3: LABEL="rootdb" UUID="94116ed5-32ec-42f3-965c-ebb9dda88abf" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="rootdb" PARTUUID="038d51bf-0b0e-49ea-b54f-db1d33753c6c"
/dev/nvme0n1p4: LABEL="data" UUID="342de0ec-612b-4ec3-bef9-1cea3927e9a3" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="data" PARTUUID="3771b859-c75f-4d7e-a869-e7aba8d2aace"
/dev/nvme0n1p5: UUID="73e8a34e-22e2-4afd-98ae-112926cb379e" TYPE="swap" PARTUUID="c323e7e0-bf0e-4e43-afbb-ba7db3e1989f"
Last edited by geotechtribe on 2022-11-26 13:44, edited 1 time in total.

geotechtribe
Posts: 26
Joined: 2022-10-01 01:45

Re: [Installation] trouble getting grub installed on dual boot system

#7 Post by geotechtribe »

oops, the efi boot manager command output on Debian is here:

Code: Select all

$ efibootmgr
BootCurrent: 0001
Timeout: 1 seconds
BootOrder: 0001,0002,0000,0003,0004,0005
Boot0000* Windows Boot Manager
Boot0001* opensuse
Boot0002* opensuse-secureboot
Boot0003* UEFI:CD/DVD Drive
Boot0004* UEFI:Removable Device
Boot0005* UEFI:Network Device
And here is the output of these commands, running from openSUSE to compare:

Code: Select all

> ls /sys/firmware/
acpi  dmi  efi  memmap

> ls /boot/efi/
$RECYCLE.BIN  EFI  System Volume Information

> sudo efibootmgr
[sudo] password for root:
BootCurrent: 0001
Timeout: 1 seconds
BootOrder: 0001,0002,0000,0003,0004,0005
Boot0000* Windows Boot Manager
Boot0001* opensuse
Boot0002* opensuse-secureboot
Boot0003* UEFI:CD/DVD Drive
Boot0004* UEFI:Removable Device
Boot0005* UEFI:Network Device

> cat /etc/fstab
LABEL=root1     /          ext4  defaults      0  1
LABEL=data      /home      ext4  data=ordered  0  2
UUID=9B45-3631  /boot/efi  vfat  utf8          0  2
UUID=73e8a34e-22e2-4afd-98ae-112926cb379e      swap       swap  defaults      0  0
#LABEL=swap      swap       swap  defaults      0  0

> zypper se grub
Repository 'brave-browser' is out-of-date. You can run 'zypper refresh' as root to update it.
Repository 'Visual Studio Code' is out-of-date. You can run 'zypper refresh' as root to update it.
Repository 'google-chrome' is out-of-date. You can run 'zypper refresh' as root to update it.
Repository 'packman' is out-of-date. You can run 'zypper refresh' as root to update it.
Repository 'openSUSE-Tumbleweed-Non-Oss' is out-of-date. You can run 'zypper refresh' as root to update it.
Repository 'openSUSE-Tumbleweed-Oss' is out-of-date. You can run 'zypper refresh' as root to update it.
Repository 'openSUSE-Tumbleweed-Update' is out-of-date. You can run 'zypper refresh' as root to update it.
Loading repository data...
Reading installed packages...

S  | Name                       | Summary                                                | Type
---+----------------------------+--------------------------------------------------------+--------
i  | grub2                      | Bootloader with support for Linux, Multiboot and more  | package
i  | grub2-branding-openSUSE    | openSUSE Tumbleweed branding for GRUB2                 | package
   | grub2-branding-upstream    | Upstream branding for GRUB2's graphical console        | package
   | grub2-i386-efi             | Bootloader with support for Linux, Multiboot and more  | package
   | grub2-i386-efi-debug       | Debug symbols for i386-efi                             | package
i  | grub2-i386-pc              | Bootloader with support for Linux, Multiboot and more  | package
   | grub2-i386-pc-debug        | Debug symbols for i386-pc                              | package
   | grub2-i386-xen             | Bootloader with support for Linux, Multiboot and more  | package
i  | grub2-snapper-plugin       | Grub2's snapper plugin                                 | package
i  | grub2-systemd-sleep-plugin | Grub2's systemd-sleep plugin                           | package
   | grub2-theme-breeze         | Plasma branding for GRUB2's graphical console          | package
i+ | grub2-x86_64-efi           | Bootloader with support for Linux, Multiboot and more  | package
   | grub2-x86_64-efi-debug     | Debug symbols for x86_64-efi                           | package
   | grub2-x86_64-xen           | Bootloader with support for Linux, Multiboot and more  | package
   | grubby                     | Command line tool for updating bootloader configs      | package
   | ignition-dracut-grub2      | Files to trigger ignition firstboot with grub2         | package
   | libostree-grub2            | GRUB2 integration for OSTree                           | package
   | live-grub-stick            | Tool for creating multiboot live USB stick using grub2 | package
i  | ruby3.1-rubygem-cfa_grub2  | Models for GRUB2 configuration files                   | package
   | trustedgrub2               | Bootloader with TCG (TPM) support                      | package
   | trustedgrub2-i386-pc       | Bootloader with TCG (TPM) support                      | package

> sudo blkid
/dev/nvme0n1p5: UUID="73e8a34e-22e2-4afd-98ae-112926cb379e" TYPE="swap" PARTUUID="c323e7e0-bf0e-4e43-afbb-ba7db3e1989f"
/dev/nvme0n1p3: LABEL="rootdb" UUID="94116ed5-32ec-42f3-965c-ebb9dda88abf" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="rootdb" PARTUUID="038d51bf-0b0e-49ea-b54f-db1d33753c6c"
/dev/nvme0n1p1: SEC_TYPE="msdos" LABEL_FATBOOT="ESP" LABEL="ESP" UUID="9B45-3631" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="1d32dc52-2c48-45ec-9609-356aeb2a0df5"
/dev/nvme0n1p4: LABEL="data" UUID="342de0ec-612b-4ec3-bef9-1cea3927e9a3" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="data" PARTUUID="3771b859-c75f-4d7e-a869-e7aba8d2aace"
/dev/nvme0n1p2: LABEL="root1" UUID="ba22e191-6161-418b-8fa4-9e9736bbaf26" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="b250f42e-ca58-452f-9bc1-b38a34f2beb6"
Again, apologies for taking so long. Any help to get this little problem rectified will be greatly appreciated.

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: [Installation] trouble getting grub installed on dual boot system

#8 Post by p.H »

Please properly type the commands exactly as I posted them.

Code: Select all

ls /boot/efi/EFI
dpkg -l grub*
PS: do not run dpkg on openSUSE, obviously it won't work.

geotechtribe
Posts: 26
Joined: 2022-10-01 01:45

Re: [Installation] trouble getting grub installed on dual boot system

#9 Post by geotechtribe »

Ok, here is the output:

Code: Select all

$ ls /boot/efi/EFI
boot  opensuse

Code: Select all

$ dpkg -l grub*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name             Version        Architecture Description
+++-================-==============-============-=====================================================
un  grub             <none>         <none>       (no description available)
un  grub-cloud-amd64 <none>         <none>       (no description available)
ii  grub-common      2.06-3~deb11u4 amd64        GRand Unified Bootloader (common files)
un  grub-coreboot    <none>         <none>       (no description available)
un  grub-doc         <none>         <none>       (no description available)
un  grub-efi         <none>         <none>       (no description available)
un  grub-efi-amd64   <none>         <none>       (no description available)
un  grub-efi-arm     <none>         <none>       (no description available)
un  grub-efi-arm64   <none>         <none>       (no description available)
un  grub-efi-ia32    <none>         <none>       (no description available)
un  grub-efi-ia64    <none>         <none>       (no description available)
un  grub-emu         <none>         <none>       (no description available)
un  grub-ieee1275    <none>         <none>       (no description available)
un  grub-legacy      <none>         <none>       (no description available)
un  grub-legacy-doc  <none>         <none>       (no description available)
un  grub-linuxbios   <none>         <none>       (no description available)
ii  grub-pc          2.06-3~deb11u4 amd64        GRand Unified Bootloader, version 2 (PC/BIOS version)
ii  grub-pc-bin      2.06-3~deb11u4 amd64        GRand Unified Bootloader, version 2 (PC/BIOS modules)
un  grub-uboot       <none>         <none>       (no description available)
un  grub-xen         <none>         <none>       (no description available)
un  grub-yeeloong    <none>         <none>       (no description available)
un  grub2            <none>         <none>       (no description available)
ii  grub2-common     2.06-3~deb11u4 amd64        GRand Unified Bootloader (common files for version 2)

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: [Installation] trouble getting grub installed on dual boot system

#10 Post by p.H »

openSUSE installed GRUB for EFI boot.
Debian installed GRUB for BIOS/legacy boot, either because you forced it or booted the installer in legacy mode.

If you want to boot Debian's GRUB you can either:
- force the UEFI firmware to boot in legacy mode (assuming GRUB is installed in the MBR, not in a partition boot sector) by disabling native EFI boot or giving legacy boot a higher priority in boot setings, or removing/renaming openSUSE's GRUB
- install Debian's GRUB for EFI boot with the package grub-efi-amd64 and make sure it is first in the boot order (efibootmgr).

geotechtribe
Posts: 26
Joined: 2022-10-01 01:45

Re: [Installation] trouble getting grub installed on dual boot system

#11 Post by geotechtribe »

Ok, thank you for the help. I finally got things working the way they are supposed to. Here is what I did:

First I installed grub-efi-amd64 as you suggested.

Then I booted into a rescue system in UEFI mode (non graphical) and went to a BASH shell. In setting up the shell, the prompts offered to allow me to set up the shell within the partition that I run debian on, so I said that was ok. Apparently what that does is it takes care of mounting and binding the existing partitions to the running file system that has been executed in the rescue system.

It also mounted the efi partition. So without needing to do anything else I ran the following:

# grub-install
# update-grub

This installed grub from Debian properly and when I rebooted, Debian's grub was one of the options. To make it the default option I had to go into BIOS and set Debian's grub as the first boot priority. I did not end up having to use efibootmgr, but when I checked it after the installation it showed up the way it was supposed to, like this:

Code: Select all

$ sudo efibootmgr
BootCurrent: 0003
Timeout: 1 seconds
BootOrder: 0003,0001,0002,0000
Boot0000* Windows Boot Manager
Boot0001* opensuse
Boot0002* opensuse-secureboot
Boot0003* debian
Thank you for your help! My system is much better now that the default boot is Debian.

Post Reply