[Solved] Grub update problem - minimal bash

Questions about software.
jaw2
Posts: 5
Joined: 04 Nov 2018 01:06
Location: Chile
Contact:

[Solved] Grub update problem - minimal bash

Postby jaw2 » 31 Jul 2020 01:22

Hello,
From time to time I get stuck on minimal bash after updates. Then I usually run live version of solydxk, mount partitions, chroot, reinstall grub and everything is normal after that. But yesterday I run update and now the usual process doesn't work. Today I followed the steps of this post viewtopic.php?f=5&t=7649#p71156 to get into my solydx partition, but I don't want to manually enter those commands every time I turn on my laptop :P. After check a lot of sites I still have no idea how to solve the grub issue, any help? My laptop is a dual system with Windows10 + soldyx.
These are the steps that I usually run to get grub working again:

Code: Select all

sudo su -
mount /dev/sda8 /mnt
mount /dev/sda6 /mnt/boot/efi
mount -t proc proc /mnt/proc
mount -t sysfs sys /mnt/sys
mount -o bind /dev /mnt/dev
chroot /mnt /bin/bash

sudo apt-get install --reinstall grub-efi
Where /dev/sda6 is the EFI partition and /dev/sda8 root (there is no other partition for linux).
I think i have a mess on grub :P
Here how looks my boot folder today:

Code: Select all

total 115M
drwxr-xr-x 3 root root 4,0K jul 30 19:29 boot
-rw-r--r-- 1 root root 202K jun  7 11:42 config-4.19.0-9-amd64
-rw-r--r-- 1 root root 183K jun  7 17:34 config-4.9.0-12-amd64
drwxr-xr-x 5 root root 4,0K dic 31  1969 efi
drwxr-xr-x 5 root root 4,0K jul 29 18:49 grub
-rw-r--r-- 1 root root  58M jun 12 21:08 initrd.img-4.19.0-9-amd64
-rw-r--r-- 1 root root  42M jun 12 19:15 initrd.img-4.9.0-12-amd64
-rw-r--r-- 1 root root 179K jun 25  2015 memtest86+.bin
-rw-r--r-- 1 root root 181K jun 25  2015 memtest86+_multiboot.bin
-rw-r--r-- 1 root root 3,3M jun  7 11:42 System.map-4.19.0-9-amd64
-rw-r--r-- 1 root root 3,1M jun  7 17:34 System.map-4.9.0-12-amd64
-rw-r--r-- 1 root root 5,1M jun  7 11:42 vmlinuz-4.19.0-9-amd64
-rw-r--r-- 1 root root 4,1M jun  7 17:34 vmlinuz-4.9.0-12-amd64
I think the update is taking /boot/boot for something, because that have date of today (when I tried to fix it).

User avatar
ilu
Posts: 2711
Joined: 09 Oct 2013 12:45

Re: Grub update problem - minimal bash

Postby ilu » 31 Jul 2020 14:39

Can you please do ls -al on the EFI partition when it's mounted?
And when did you first install your system (i.e. how old is your install)?

jaw2
Posts: 5
Joined: 04 Nov 2018 01:06
Location: Chile
Contact:

Re: Grub update problem - minimal bash

Postby jaw2 » 31 Jul 2020 17:00

sda6 is the efi partition:

Code: Select all

mount -l | grep sda
...
/dev/sda6 on /boot/efi
...
Here how it looks:

Code: Select all

ls -la /boot/efi/
drwxr-xr-x 5 root root 4096 dic 31  1969 .
drwxr-xr-x 5 root root 4096 jul 30 19:29 ..
drwxr-xr-x 5 root root 4096 jul 30 19:29 boot
drwxr-xr-x 5 root root 4096 nov 11  2015 EFI
drwxr-xr-x 2 root root 4096 oct  6  2015 grub

ls -la /boot/efi/boot/
drwxr-xr-x 5 root root 4096 jul 30 19:29 .
drwxr-xr-x 5 root root 4096 dic 31  1969 ..
drwxr-xr-x 5 root root 4096 sep 27  2015 EFI
drwxr-xr-x 2 root root 4096 jul 30 19:29 grub
drwxr-xr-x 2 root root 4096 sep 27  2015 snapshots

ls -la /boot/efi/EFI
drwxr-xr-x 5 root root 4096 nov 11  2015 .
drwxr-xr-x 5 root root 4096 dic 31  1969 ..
drwxr-xr-x 3 root root 4096 jul 30 19:30 Boot
drwxr-xr-x 4 root root 4096 sep 28  2015 Microsoft
drwxr-xr-x 2 root root 4096 jun 13 10:42 solydx

ls -la /boot/efi/grub/
drwxr-xr-x 2 root root 4096 oct  6  2015 .
drwxr-xr-x 5 root root 4096 dic 31  1969 ..

Is an old installation, I remember that I installed Solydx 8 and 9 from scratch, then this year I used the script to upgrade version. I have the same issue with grub then, but with the usual steps grub started to work without problems till the update of wednesday :(

jaw2
Posts: 5
Joined: 04 Nov 2018 01:06
Location: Chile
Contact:

Re: Grub update problem - minimal bash

Postby jaw2 » 01 Aug 2020 14:31

Reading some more sites, I finally found the combination that solved my problem to get grub working again :D
I have to manually indicate the boot folder and the root folder, then voila :D
Here the steps that get grub working again from live system:

Code: Select all

sudo su -
mount /dev/sda8 /mnt
mount /dev/sda6 /mnt/boot/efi
for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done
chroot /mnt /bin/bash

#open new console and run:
sudo apt install grub-efi
sudo grub-install --target=x86_64-efi /dev/sda --efi-directory=/mnt/boot/efi --boot-directory=/mnt/boot
I leave it in case someone else have the same problem.
Now I'll search for some way of do some restore from some file configuration or something like that and compare if that is better than run commands from live system or not. I'm open to suggestions too :P

User avatar
ilu
Posts: 2711
Joined: 09 Oct 2013 12:45

Re: [Solved] Grub update problem - minimal bash

Postby ilu » 01 Aug 2020 16:04

There was a grub2 update, see https://www.debian.org/security/2020-GR ... ecureBoot/ which might have been the cause.

Since you have an really old system and a lot has changed with EFI in debian, I would recommend a clean reinstall as soon as you have the opportunity.
Backup your home directory or reuse it if you have a separate partition.
Make a list of software you would like to keep - if you installed everything with Synaptic (I strongly recommend to do that) there are logs of installed packages under /root/.synaptic/log/ and you can export a list in Synaptic which can be edited and imported into Synaptic after reinstall.

Arjen, grizzler: When transitioning to Debian 11 next year or so we need to add a disclaimer that the update script should not be used on very old EFI systems. Debian has gotten so much better on that front. We'll need to have a closer look at the cited debian announcement.

jaw2
Posts: 5
Joined: 04 Nov 2018 01:06
Location: Chile
Contact:

Re: [Solved] Grub update problem - minimal bash

Postby jaw2 » 01 Aug 2020 19:16

ilu wrote:
01 Aug 2020 16:04
There was a grub2 update, see https://www.debian.org/security/2020-GR ... ecureBoot/ which might have been the cause.
I think you are right, as the problem was with the update that I run on July 30th.
Today I saw there was a new update related to grub and other system things, so I run it again a dist-upgrade to confirm if there are new issues... and no! there was no need of do anything manual, I was able to restart and use grub as usual :D

Refugee
Posts: 49
Joined: 17 Apr 2014 00:32

Re: [Solved] Grub update problem - minimal bash

Postby Refugee » 02 Aug 2020 01:17

Confirming that the most recent Grub update broke things with "grub_calloc" not found.

Used Arjen's chroot-live fix from 2018 and grub installed successfully but ironically only Windows options appeared within (dual-boot).

Had to use a grub repair tool in PartedMagic to fully restore.

Disaster averted... :)

Refugee
Posts: 49
Joined: 17 Apr 2014 00:32

Re: [Solved] Grub update problem - minimal bash

Postby Refugee » 02 Aug 2020 01:21

First post in forever...

6 years using Solyd, how'd that happen??? :P

marshall
Posts: 8
Joined: 01 Nov 2017 15:46

Re: [Solved] Grub update problem - minimal bash

Postby marshall » 02 Aug 2020 23:25

The Grub update bollixed my dual boot (with Win7) system. Like Refugee, I have used SolydXK for years, six in my case and, earlier, another Debian-based distro for much longer. Never had a problem with updates.
I'm away from home and don't have as many fix-it tools as usual with me so I had to reinstall. That's a nuisance but it worked fine.
I remember over the years reading regularly about seriously botched updates from Microsoft. This was a first for Debian in my experience. Nobody's perfect but Debian is close. SolydXK too.

User avatar
ilu
Posts: 2711
Joined: 09 Oct 2013 12:45

Re: [Solved] Grub update problem - minimal bash

Postby ilu » 03 Aug 2020 11:06

This was not a botched updated. This was Debian fixing a serious security issue in grub2 where they had to ignore backwards compatibility. Sometimes it's not possible.


Return to “Software”

Who is online

Users browsing this forum: No registered users and 9 guests