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
-
- Posts: 26
- Joined: 2022-10-01 01:45
[Installation] trouble getting grub installed on dual boot system
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?
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?
- sunrat
- Administrator
- Posts: 6412
- Joined: 2006-08-29 09:12
- Location: Melbourne, Australia
- Has thanked: 116 times
- Been thanked: 462 times
Re: [Installation] trouble getting grub installed on dual boot system
update-grub updates GRUB's configuration files but does not install it. Assuming you are on a Bullseye UEFI system, run which should work in most cases. Post back if it doesn't.
Code: Select all
grub-install
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ” Remember to BACKUP!
Those who have lost data
...and those who have not lost data YET ” Remember to BACKUP!
-
- Posts: 26
- Joined: 2022-10-01 01:45
Re: [Installation] trouble getting grub installed on dual boot system
Thank you, it's a start. The installation failed - here is the output:
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?
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)
-
- 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
You need to run update-grub from openSUSE, not Debian.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.
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.
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.geotechtribe wrote: ↑2022-10-24 18:17Code: 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
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*
What do you mean by "current grub installation" ? openSUSE or Debian ?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
A BIOS boot partition has no filesystem and is not mounted. Also, it has the "BIOS boot" type, not Microsoft basic data.
- sunrat
- Administrator
- Posts: 6412
- Joined: 2006-08-29 09:12
- Location: Melbourne, Australia
- Has thanked: 116 times
- Been thanked: 462 times
Re: [Installation] trouble getting grub installed on dual boot system
OP wants to change to Debian GRUB.p.H wrote: ↑2022-10-24 21:17You need to run update-grub from openSUSE, not Debian.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.
Perhaps no ESP is present.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.
Code: Select all
sudo blkid
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ” Remember to BACKUP!
Those who have lost data
...and those who have not lost data YET ” Remember to BACKUP!
-
- Posts: 26
- Joined: 2022-10-01 01:45
Re: [Installation] trouble getting grub installed on dual boot system
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:
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.
-
- Posts: 26
- Joined: 2022-10-01 01:45
Re: [Installation] trouble getting grub installed on dual boot system
oops, the efi boot manager command output on Debian is here:
And here is the output of these commands, running from openSUSE to compare:
Again, apologies for taking so long. Any help to get this little problem rectified will be greatly appreciated.
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
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"
-
- 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
Please properly type the commands exactly as I posted them.
PS: do not run dpkg on openSUSE, obviously it won't work.
Code: Select all
ls /boot/efi/EFI
dpkg -l grub*
-
- Posts: 26
- Joined: 2022-10-01 01:45
Re: [Installation] trouble getting grub installed on dual boot system
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)
-
- 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
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).
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).
-
- Posts: 26
- Joined: 2022-10-01 01:45
Re: [Installation] trouble getting grub installed on dual boot system
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:
Thank you for your help! My system is much better now that the default boot is Debian.
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