Issue with Grub after packages update

Kernels & Hardware, configuring network, installing services

Issue with Grub after packages update

Postby Pyloux » 2021-02-06 15:13

Hello,

I have an error with grub after doing an upgrade package, can I get some help please ? :roll:

Here the error during installing

Code: Select all
Setting up grub-common (2.02+dfsg1-20+deb10u3) ...
Setting up grub-efi-amd64-bin (2.02+dfsg1-20+deb10u3) ...
Setting up grub-efi-amd64-signed (1+2.02+dfsg1+20+deb10u3) ...
Setting up grub2-common (2.02+dfsg1-20+deb10u3) ...
Setting up grub-pc-bin (2.02+dfsg1-20+deb10u3) ...
Setting up grub-pc (2.02+dfsg1-20+deb10u3) ...
Installing for i386-pc platform.
grub-install: warning: this GPT partition label contains no BIOS Boot Partition; embedding won't be possible.
grub-install: error: embedding is not possible, but this is required for RAID and LVM install.
You must correct your GRUB install devices before proceeding:

  dpkg-reconfigure grub-pc
dpkg: error processing package grub-pc (--configure):
 installed grub-pc package post-installation script subprocess returned error exit status 1
Processing triggers for dbus (1.12.20-0+deb10u1) ...
Processing triggers for mime-support (3.62) ...
Processing triggers for libc-bin (2.28-10) ...
Processing triggers for systemd (241-7~deb10u6) ...
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for ntp (1:4.2.8p12+dfsg-4) ...
Processing triggers for ca-certificates (20200601~deb10u2) ...
Updating certificates in /etc/ssl/certs...
0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
done.
Processing triggers for initramfs-tools (0.133+deb10u1) ...
update-initramfs: Generating /boot/initrd.img-4.19.0-8-amd64
I: The initramfs will attempt to resume from /dev/sdb3
I: (UUID=4400e9c5-936f-46c9-8da6-4acc5f8b97af)
I: Set the RESUME variable to override this.
Processing triggers for dovecot-core (1:2.3.4.1-5+deb10u6) ...
Errors were encountered while processing:
 grub-pc
E: Sub-process /usr/bin/dpkg returned an error code (1)


Here's some commands if that helps:

Code: Select all
> fdisk -l
Disk /dev/sda: 3.7 TiB, 4000787030016 bytes, 7814037168 sectors
Disk model: HGST HUS724040AL
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: 2DB59B16-136E-40F9-A322-D5235563FB9B
Device          Start        End    Sectors  Size Type
/dev/sda1        2048    1048575    1046528  511M EFI System
/dev/sda2     1048576 7812980735 7811932160  3.7T Linux RAID
/dev/sda3  7812980736 7814027263    1046528  511M Linux swap
/dev/sda4  7814035215 7814037134       1920  960K Linux filesystem
Disk /dev/sdb: 3.7 TiB, 4000787030016 bytes, 7814037168 sectors
Disk model: HGST HUS724040AL
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: 8D2D6667-FC64-4EFF-BD18-81871D1C99FE
Device          Start        End    Sectors  Size Type
/dev/sdb1        2048    1048575    1046528  511M EFI System
/dev/sdb2     1048576 7812980735 7811932160  3.7T Linux RAID
/dev/sdb3  7812980736 7814027263    1046528  511M Linux swap
Disk /dev/md2: 3.7 TiB, 3999709200384 bytes, 7811932032 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

> od -tx1z -Ax -N 446 /dev/sda1
000000 eb 58 90 6d 6b 66 73 2e 66 61 74 00 02 08 20 00  >.X.mkfs.fat... .<
000010 02 00 00 00 00 f8 00 00 3f 00 ff 00 00 08 00 00  >........?.......<
000020 00 f8 0f 00 fc 03 00 00 00 00 00 00 02 00 00 00  >................<
000030 01 00 06 00 00 00 00 00 00 00 00 00 00 00 00 00  >................<
000040 80 00 29 a8 83 38 13 45 46 49 5f 53 59 53 50 41  >..)..8.EFI_SYSPA<
000050 52 54 46 41 54 33 32 20 20 20 0e 1f be 77 7c ac  >RTFAT32   ...w|.<
000060 22 c0 74 0b 56 b4 0e bb 07 00 cd 10 5e eb f0 32  >".t.V.......^..2<
000070 e4 cd 16 cd 19 eb fe 54 68 69 73 20 69 73 20 6e  >.......This is n<
000080 6f 74 20 61 20 62 6f 6f 74 61 62 6c 65 20 64 69  >ot a bootable di<
000090 73 6b 2e 20 20 50 6c 65 61 73 65 20 69 6e 73 65  >sk.  Please inse<
0000a0 72 74 20 61 20 62 6f 6f 74 61 62 6c 65 20 66 6c  >rt a bootable fl<
0000b0 6f 70 70 79 20 61 6e 64 0d 0a 70 72 65 73 73 20  >oppy and..press <
0000c0 61 6e 79 20 6b 65 79 20 74 6f 20 74 72 79 20 61  >any key to try a<
0000d0 67 61 69 6e 20 2e 2e 2e 20 0d 0a 00 00 00 00 00  >gain ... .......<
0000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  >................<
*
0001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00        >..............<
0001be
> od -tx1z -Ax -N 446 /dev/sdb1
000000 eb 58 90 6d 6b 66 73 2e 66 61 74 00 02 08 20 00  >.X.mkfs.fat... .<
000010 02 00 00 00 00 f8 00 00 3f 00 ff 00 00 08 00 00  >........?.......<
000020 00 f8 0f 00 fc 03 00 00 00 00 00 00 02 00 00 00  >................<
000030 01 00 06 00 00 00 00 00 00 00 00 00 00 00 00 00  >................<
000040 80 01 29 c2 3d 7e 13 45 46 49 5f 53 59 53 50 41  >..).=~.EFI_SYSPA<
000050 52 54 46 41 54 33 32 20 20 20 0e 1f be 77 7c ac  >RTFAT32   ...w|.<
000060 22 c0 74 0b 56 b4 0e bb 07 00 cd 10 5e eb f0 32  >".t.V.......^..2<
000070 e4 cd 16 cd 19 eb fe 54 68 69 73 20 69 73 20 6e  >.......This is n<
000080 6f 74 20 61 20 62 6f 6f 74 61 62 6c 65 20 64 69  >ot a bootable di<
000090 73 6b 2e 20 20 50 6c 65 61 73 65 20 69 6e 73 65  >sk.  Please inse<
0000a0 72 74 20 61 20 62 6f 6f 74 61 62 6c 65 20 66 6c  >rt a bootable fl<
0000b0 6f 70 70 79 20 61 6e 64 0d 0a 70 72 65 73 73 20  >oppy and..press <
0000c0 61 6e 79 20 6b 65 79 20 74 6f 20 74 72 79 20 61  >any key to try a<
0000d0 67 61 69 6e 20 2e 2e 2e 20 0d 0a 00 00 00 00 00  >gain ... .......<
0000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  >................<
*
0001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00        >..............<
0001be

> blkid
/dev/sda1: LABEL_FATBOOT="EFI_SYSPART" LABEL="EFI_SYSPART" UUID="1338-83A8" TYPE="vfat" PARTLABEL="primary" PARTUUID="f70faeba-7221-4637-96b8-a47a9579d3fd"
/dev/sda2: UUID="b8df49cb-3565-aab8-a4d2-adc226fd5302" TYPE="linux_raid_member" PARTLABEL="primary" PARTUUID="989ce6a1-286c-4d9d-8413-c093135d43c2"
/dev/sda3: LABEL="swap-sda3" UUID="f2a4c1c1-07af-473c-abee-e323d456aa5a" TYPE="swap" PARTLABEL="primary" PARTUUID="a3234ad6-2524-4ca8-aa9c-81dde53fca78"
/dev/sda4: UUID="2020-04-07-10-42-57-00" LABEL="config-2" TYPE="iso9660" PARTLABEL="config-drive" PARTUUID="bca400b9-8cff-4a69-88e4-1431b0d2f07c"
/dev/sdb1: LABEL_FATBOOT="EFI_SYSPART" LABEL="EFI_SYSPART" UUID="137E-3DC2" TYPE="vfat" PARTLABEL="primary" PARTUUID="69cec58c-cd38-4129-85e9-f701c931506d"
/dev/sdb2: UUID="b8df49cb-3565-aab8-a4d2-adc226fd5302" TYPE="linux_raid_member" PARTLABEL="primary" PARTUUID="803642da-2c63-41b1-ab96-8e9e6fa57197"
/dev/sdb3: LABEL="swap-sdb3" UUID="4400e9c5-936f-46c9-8da6-4acc5f8b97af" TYPE="swap" PARTLABEL="primary" PARTUUID="51e5fc3f-eaa1-4e3d-9c29-8ba88481e4d4"
/dev/md2: LABEL="/" UUID="2088258e-06ac-4de8-b63e-29e0a741760d" TYPE="ext4"

> cat /proc/mdstat
Personalities : [raid1] [linear] [multipath] [raid0] [raid6] [raid5] [raid4] [raid10]
md2 : active raid1 sdb2[1] sda2[0]
      3905966016 blocks [2/2] [UU]
      bitmap: 13/30 pages [52KB], 65536KB chunk
unused devices: <none>


It is a dedicated server on Debian 10 running Webmin 1.962
Kernel CPU Linux 4.19.0-8-amd64 on x86_64

Thank you a lot in advance for your help
Pyloux
 
Posts: 4
Joined: 2021-02-06 15:09

Re: Issue with Grub after packages update

Postby Head_on_a_Stick » 2021-02-06 15:25

Why do you have the grub-pc package installed in a UEFI system?

Perhaps try
Code: Select all
# apt install grub-pc{,-bin}- grub-efi-amd64

Not sure about the RAID stuff though so wait for forum member @p.H to reply before continuing. They know more than me about this sort of thing.

Pyloux wrote:Kernel CPU Linux 4.19.0-8-amd64 on x86_64

You need to update your kernel, Debian 10 is on the 4.19.0-14 ABI version now.
Code: Select all
# apt install linux-image-amd64
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 13280
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Issue with Grub after packages update

Postby Pyloux » 2021-02-06 15:33

Thank you for your quickly response Head_on_a_Stick

Head_on_a_Stick wrote:Why do you have the grub-pc package installed in a UEFI system?

I don't really know, this is a dedicated server rent at ovh. I do not have install the system myself, I just chose the Debian version.

So, I'll wait @p.H, thank you :)
Pyloux
 
Posts: 4
Joined: 2021-02-06 15:09

Re: Issue with Grub after packages update

Postby p.H » 2021-02-07 19:46

I hope you have not been waiting too long...
The disk layout suggests a UEFI boot setup, but GRUB packages for both BIOS and UEFI boot are installed. This is unusual. Most packages for multiple "flavours" of GRUB can be installed simultaneously, but only one package which is actually in charge of installing and upgrading the GRUB boot loader can be installed, such as grub-pc for PC BIOS boot or grub-efi-amd64 for 64-bit PC UEFI boot.

Here grub-pc is installed, so a GRUB package upgrade will (try to) install the GRUB boot loader for BIOS boot. /boot is inside a RAID array and the disks have GPT partition tables so GRUB requires a dedicated (unformatted) "BIOS boot" partition. Lack of this partition causes the boot loader installation failure.

First, you should check whether the system currently booted in UEFI or BIOS mode. Presence of /sys/firmware/efi means UEFI, absence means BIOS. You can also install boot-info-script and run bootinfoscript to gather boot information such as the presence of GRUB in the disk MBR. You can also check where grub-pc is supposed to install the boot loader with
Code: Select all
debconf-show grub-pc | grep install_devices


If the system booted in UEFI mode, grub-efi-amd64 should be installed instead of grub-pc.
If the system booted in UEFI mode, "BIOS boot" partitions should be created on both disks. 1 MB is more than enough.
p.H
 
Posts: 1674
Joined: 2017-09-17 07:12

Re: Issue with Grub after packages update

Postby Pyloux » 2021-02-08 14:52

Hello p.H

Thank you for your reply ! Don't worry, better late than never ! But it's not too late so it's ok :D

Apparently it's UEFI, the efi folder exist

Code: Select all
> ls -alh /sys/firmware/efi/
total 0
drwxr-xr-x   6 root root    0 Feb  8 11:15 .
drwxr-xr-x   6 root root    0 Feb  8 11:15 ..
-r--r--r--   1 root root 4.0K Feb  8 11:15 config_table
drwxr-xr-x   2 root root    0 Nov 16 10:28 efivars
drwxr-xr-x   3 root root    0 Feb  8 11:15 esrt
-r--r--r--   1 root root 4.0K Feb  8 11:15 fw_platform_size
-r--r--r--   1 root root 4.0K Feb  8 11:15 fw_vendor
-r--r--r--   1 root root 4.0K Feb  8 11:15 runtime
drwxr-xr-x  14 root root    0 Feb  8 11:15 runtime-map
-r--------   1 root root 4.0K Feb  8 11:15 systab
drwxr-xr-x 125 root root    0 Feb  8 11:15 vars


Code: Select all
> ls -alh /boot/grub/
total 2.4M
drwxr-xr-x 6 root root 4.0K Jul 31  2020 .
drwxr-xr-x 5 root root 4.0K Feb  6 15:13 ..
drwxr-xr-x 2 root root 4.0K Mar 28  2020 fonts
-r--r--r-- 1 root root 6.0K Jul 31  2020 grub.cfg
-rw-r--r-- 1 root root 1.0K Mar 28  2020 grubenv
drwxr-xr-x 2 root root  20K Feb  6 15:13 i386-pc
drwxr-xr-x 2 root root 4.0K Feb  6 15:13 locale
-rw-r--r-- 1 root root 2.3M Jul 31  2020 unicode.pf2
drwxr-xr-x 2 root root  12K Apr  7  2020 x86_64-efi


So, I need to uninstall grub-pc and install grub-efi-amd64, like that ?
Code: Select all
> apt-get purge grub-pc
> apt-get grub-efi-amd64
> grub-install /dev/sda1
> update-grub

It's the same thing to install on /dev/sda1 or /dev/sdb1 ?
Maybe after install on sda1 I need to do some command for the /dev/sdb1 ? Or just like that is ok cause it's a RAID ?

Then I can reboot the server without issue ?

I waiting your confirmation if it's ok, I must admit that I'm a little scared, I don't want to crash my server :oops:

Sorry, I don't know much in this domain :(

Thank you very much to take your time to help me !

Have a great day.
Pyloux
 
Posts: 4
Joined: 2021-02-06 15:09

Re: Issue with Grub after packages update

Postby Head_on_a_Stick » 2021-02-08 20:55

You don't need to reinstall GRUB if the server is already booting and anyway the UEFI version doesn't accept a block device as an argument.

Just run the commands I suggested earlier, they will uninstall grub-pc and the -bin package and install grub-efi-amd64 and the kernel metapackage (to keep your kernel updated).
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 13280
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Issue with Grub after packages update

Postby p.H » 2021-02-08 21:18

Pyloux wrote:Apparently it's UEFI, the efi folder exist


Then you can check how exactly it booted. First, check the EFI boot variables :
Code: Select all
efibootmgr -v


Then check the contents of the EFI system partitions. One should be mounted on /boot/efi
Code: Select all
grep /boot/efi /proc/mounts
find /boot/efi


Mount the other one on /mnt, e.g. /dev/sdb1
Code: Select all
mount /dev/sdb1 /mnt
find /mnt


This will show if your setup has boot redundancy.

Pyloux wrote:So, I need to uninstall grub-pc and install grub-efi-amd64, like that ?


You do not need to uninstall grub-pc ; installing grub-efi-amd64 will do it as both packages conflict with each other.

Pyloux wrote:It's the same thing to install on /dev/sda1 or /dev/sdb1 ?


Yes, it is the same thing because in UEFI mode grub-install ignores the /dev/whatever argument, as boot sectors are not used by UEFI boot. By default it installs the boot loader in whatever partition is mounted on /boot/efi and registers or updates a boot entry in the EFI non-volatile memory. Software RAID has not been taken into account, the EFI partitions must be plain partitions and cannot be part of a software RAID array. For UEFI boot redundancy, I manually install GRUB in both EFI partitions in the "removable device path" :

Code: Select all
grub-install --force-extra-removable
grub-install --force-extra-removable --no-nvram --efi-directory=/path/to/other/efi


But whenever I can, I rather setup redundant BIOS/legacy boot because it is simpler and more reliable. All it takes is a BIOS boot partition on each disk.

Head_on_a_Stick wrote:You don't need to reinstall GRUB if the server is already booting

This upgrade does not seem to address any vulnerability, so indeed running grub-install is not required. However installing grub-efi-amd64 will run grub-install automatically.
p.H
 
Posts: 1674
Joined: 2017-09-17 07:12

Re: Issue with Grub after packages update

Postby Pyloux » 2021-02-12 10:39

Hey !

Sorry for my long response time :?

I have run your commands:
Code: Select all
> efibootmgr -v
BootCurrent: 0007
Timeout: 1 seconds
BootOrder: 0007,0009,000B,000D,000E,000C,0000
Boot0000* ubuntu        VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)
Boot0007* UEFI: PXE IP4 P0 Intel(R) Ethernet Controller X550    PciRoot(0x0)/Pci(0x1b,0x4)/Pci(0x0,0x0)/MAC(d05099d50975,1)/IPv4(0.0.0.00.0.0.0,0,0)..BO
Boot0009* UEFI: PXE IP4 P1 Intel(R) Ethernet Controller X550    PciRoot(0x0)/Pci(0x1b,0x4)/Pci(0x0,0x1)/MAC(d05099d50974,1)/IPv4(0.0.0.00.0.0.0,0,0)..BO
Boot000B* UEFI: Built-in EFI Shell      VenMedia(5023b95c-db26-429b-a648-bd47664c8012)..BO
Boot000C* UEFI: PXE IP4 P0 American Megatrends Inc.     PciRoot(0x0)/Pci(0x14,0x0)/USB(7,0)/USB(2,1)/MAC(0e89673f05c5,0)/IPv4(0.0.0.00.0.0.0,0,0)..BO
Boot000D* debian        HD(1,GPT,f70faeba-7221-4637-96b8-a47a9579d3fd,0x800,0xff800)/File(\EFI\DEBIAN\GRUBX64.EFI)..BO
Boot000E* debian        HD(1,GPT,69cec58c-cd38-4129-85e9-f701c931506d,0x800,0xff800)/File(\EFI\DEBIAN\GRUBX64.EFI)..BO

> grep /boot/efi /proc/mounts
/dev/sdb1 /boot/efi vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro 0 0
> find /boot/efi
/boot/efi
/boot/efi/EFI
/boot/efi/EFI/debian
/boot/efi/EFI/debian/shimx64.efi
/boot/efi/EFI/debian/grubx64.efi
/boot/efi/EFI/debian/mmx64.efi
/boot/efi/EFI/debian/fbx64.efi
/boot/efi/EFI/debian/BOOTX64.CSV
/boot/efi/EFI/debian/grub.cfg

> mount /dev/sda1 /mnt
> find /mnt
/mnt
/mnt/EFI
/mnt/EFI/debian
/mnt/EFI/debian/BOOTX64.CSV
/mnt/EFI/debian/fbx64.efi
/mnt/EFI/debian/grub.cfg
/mnt/EFI/debian/grubx64.efi
/mnt/EFI/debian/mmx64.efi
/mnt/EFI/debian/shimx64.efi


What should I do next ?

Simply this ?
Code: Select all
> apt-get grub-efi-amd64
> grub-install /dev/sda1
> update-grub


Thank you for your help really appreciated !

Have a geat day :)
Pyloux
 
Posts: 4
Joined: 2021-02-06 15:09

Re: Issue with Grub after packages update

Postby p.H » 2021-02-13 10:14

According to efibootmgr, the default boot entry (0007) is using PXE (boot from network), and the system actually booted from it, not from GRUB on either EFI partition (000D and 000E). I do not know why it is set up this way, nor what will happen if installing grub-efi-amd64 or running grub-install changes the boot order and makes GRUB the default. Maybe this is why grub-efi-amd64 is not installed. You may check with OVH support. Anyway I think it is safe to remove grub-pc.
p.H
 
Posts: 1674
Joined: 2017-09-17 07:12


Return to System configuration

Who is online

Users browsing this forum: No registered users and 17 guests

fashionable