Page 1 of 1

GRUB broken on newly updated MX-21

Posted: Fri Oct 14, 2022 1:22 pm
by theprofa325
I upgraded my daily driver desktop MX-21 system with synaptic and it broke the NVidia graphics. It would boot but only to a text screen. Then trying to follow web instructions to fix this, I somehow broke GRUB and now it will not boot at all (stops with "grub rescue>" prompt. I can boot and run fine with an MX-21 live usb.



MX Boot Repair cannot seem to reinstall GRUB and get me running again.
I think all the help I need is detailed instructions to get MX Boot Repair to successfully reinstall a bootable GRUB.

Thank you for creating/maintaining MX and for any assistance with this problem.


The hard disk is mountable and readable from the live-usb system. Here is its partition table:

Code: Select all

Disk /dev/sda: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: CT1000MX500SSD1 
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0xfc6cd71c

Device     Boot      Start        End    Sectors   Size Id Type
/dev/sda1  *          2048    1953791    1951744   953M 83 Linux
/dev/sda2          1955838 1907783679 1905827842 908.8G  5 Extended
/dev/sda3       1907783680 1953523711   45740032  21.8G 82 Linux swap / Solaris
/dev/sda5        126955520  142579711   15624192   7.5G ef EFI (FAT-12/16/32)
/dev/sda6        142581760 1907363839 1764782080 841.5G 83 Linux
/dev/sda7          1957888  126953471  124995584  59.6G 83 Linux

Partition 2 does not start on physical sector boundary.
Partition table entries are not in disk order.




I post below the system information I can get, considering that in the live-usb system neither lspci nor Quick System Info works.

attempting to boot from HD:

Code: Select all

GRUB loading.
Welcome to GRUB!

error: file `grub/i386-pc/normal.mod not found.
grub rescue> _

=============================================================
Running from mx live usb (perfectly good running system):

Code: Select all

$ more /etc/mx-version 
MX-21.2.1_x64 Wildflower September 18, 2022
=============================================================
Attempted to invoke Quick System Info from menu in live-usb session, got this error:

Code: Select all

PerlIO.pm did not return a true value at /usr/local/bin/inxi line 4037.
BEGIN failed--compilation aborted.

Boot Mode: BIOS (legacy, CSM, MBR)
=============================================================
Attempted to use lspci in live-usb session for system information:

Code: Select all

$ sudo lspci
Bus error
$ lspci -A linux-proc
lspci: I/O error at /usr/share/misc/pci.ids, line 0


$ sudo lspci -A intel-conf1
Bus error
demo@mx1:~
$ sudo lspci -A intel-conf2
Bus error
demo@mx1:~
$ sudo lspci -A linux-sysfs
Bus error
demo@mx1:~
$ sudo lspci -A linux-proc
Bus error
=============================================================
Getting system info in live-usb session from /proc:

Code: Select all

$ more /proc/bus/pci/input/devices
I: Bus=0003 Vendor=046d Product=400a Version=0111
N: Name="Logitech M325"
P: Phys=usb-0000:00:1a.0-1.2/input2:1
S: Sysfs=/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.2/0003:046D:C52B.0006/0003:046D:400A.0009/input/input10
U: Uniq=400a-61-8e-ee-30
H: Handlers=mouse0 event0 
B: PROP=0
B: EV=17
B: KEY=ffff0000 0 0 0 0
B: REL=1943
B: MSC=10

I: Bus=0003 Vendor=046d Product=401b Version=0111
N: Name="Logitech M215 2nd Gen"
P: Phys=usb-0000:00:1a.0-1.1/input2:1
S: Sysfs=/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1:1.2/0003:046D:C52B.0003/0003:046D:401B.0007/input/input11
U: Uniq=401b-f6-42-75-31
H: Handlers=mouse1 event1 
B: PROP=0
B: EV=17
B: KEY=ffff0000 0 0 0 0
B: REL=1943
B: MSC=10

I: Bus=0003 Vendor=046d Product=4016 Version=0111
N: Name="Logitech K330"
P: Phys=usb-0000:00:1a.0-1.1/input2:2
S: Sysfs=/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1:1.2/0003:046D:C52B.0003/0003:046D:4016.0008/input/input12
U: Uniq=4016-ab-61-ac-c5
H: Handlers=sysrq kbd leds event2 
B: PROP=0
B: EV=12001f
B: KEY=3f000307ff 0 0 483ffff17aff32d bfd4444600000000 1 130ff38b17d007 ffff7bfad941dfff ffbeffdfffefffff fffffffffffffffe
B: REL=1040
B: ABS=100000000
B: MSC=10
B: LED=1f

I: Bus=0019 Vendor=0000 Product=0001 Version=0000
N: Name="Power Button"
P: Phys=PNP0C0C/button/input0
S: Sysfs=/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0C:00/input/input13
U: Uniq=
H: Handlers=kbd event3 
B: PROP=0
B: EV=3
B: KEY=10000000000000 0

I: Bus=0019 Vendor=0000 Product=0001 Version=0000
N: Name="Power Button"
P: Phys=LNXPWRBN/button/input0
S: Sysfs=/devices/LNXSYSTM:00/LNXPWRBN:00/input/input14
U: Uniq=
H: Handlers=kbd event4 
B: PROP=0
B: EV=3
B: KEY=10000000000000 0

I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="HDA NVidia HDMI/DP,pcm=3"
P: Phys=ALSA
S: Sysfs=/devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1/input15
U: Uniq=
H: Handlers=event5 
B: PROP=0
B: EV=21
B: SW=140

I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="HDA NVidia HDMI/DP,pcm=7"
P: Phys=ALSA
S: Sysfs=/devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1/input16
U: Uniq=
H: Handlers=event6 
B: PROP=0
B: EV=21
B: SW=140

I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="HDA NVidia HDMI/DP,pcm=8"
P: Phys=ALSA
S: Sysfs=/devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1/input17
U: Uniq=
H: Handlers=event7 
B: PROP=0
B: EV=21
B: SW=140

I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="HDA NVidia HDMI/DP,pcm=9"
P: Phys=ALSA
S: Sysfs=/devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1/input18
U: Uniq=
H: Handlers=event8 
B: PROP=0
B: EV=21
B: SW=140

I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="HDA NVidia HDMI/DP,pcm=10"
P: Phys=ALSA
S: Sysfs=/devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1/input19
U: Uniq=
H: Handlers=event9 
B: PROP=0
B: EV=21
B: SW=140

I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="HDA NVidia HDMI/DP,pcm=11"
P: Phys=ALSA
S: Sysfs=/devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1/input20
U: Uniq=
H: Handlers=event10 
B: PROP=0
B: EV=21
B: SW=140

I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="HDA Intel PCH Front Mic"
P: Phys=ALSA
S: Sysfs=/devices/pci0000:00/0000:00:1b.0/sound/card0/input21
U: Uniq=
H: Handlers=event11 
B: PROP=0
B: EV=21
B: SW=10

I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="HDA Intel PCH Rear Mic"
P: Phys=ALSA
S: Sysfs=/devices/pci0000:00/0000:00:1b.0/sound/card0/input22
U: Uniq=
H: Handlers=event12 
B: PROP=0
B: EV=21
B: SW=10

I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="HDA Intel PCH Line Out"
P: Phys=ALSA
S: Sysfs=/devices/pci0000:00/0000:00:1b.0/sound/card0/input23
U: Uniq=
H: Handlers=event13 
B: PROP=0
B: EV=21
B: SW=40

I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="HDA Intel PCH Front Headphone"
P: Phys=ALSA
S: Sysfs=/devices/pci0000:00/0000:00:1b.0/sound/card0/input24
U: Uniq=
H: Handlers=event14 
B: PROP=0
B: EV=21
B: SW=4

I: Bus=0003 Vendor=0000 Product=0000 Version=0004
N: Name="ACPI Virtual Keyboard Device"
P: Phys=
S: Sysfs=/devices/virtual/input/input25
U: Uniq=
H: Handlers=sysrq kbd event15 rfkill 
B: PROP=0
B: EV=3
B: KEY=ffffffffffffffff ffffffffffffffff ffffffffffffffff fffffffffffffffe
==============================================================
more sytem information in live-usb session:

Code: Select all

more /proc/bus/pci/devices
0000	80860c00	0	               0	               0	               0	               0	               0	               0	               0	               0	               0	               0	               0	               0	               0	               0	hsw_uncore
0008	80860c01	19	               0	               0	               0	               0	               0	               0	               0	               0	               0	               0	               0	               0	               0	               0	pcieport
00a0	80868c31	1d	        f7120004	               0	               0	               0	               0	               0	               0	           10000	               0	               0	               0	               0	               0	               0	xhci_hcd
00b0	80868c3a	1e	        f713c004	               0	               0	               0	               0	               0	               0	              10	               0	               0	               0	               0	               0	               0	mei_me
00c8	8086153a	1f	        f7100000	        f7139000	            f041	               0	               0	               0	               0	           20000	            1000	              20	               0	               0	               0	               0	e1000e
00d0	80868c2d	10	        f7138000	               0	               0	               0	               0	               0	               0	             400	               0	               0	               0	               0	               0	               0	ehci-pci
00d8	80868c20	20	        f7130004	               0	               0	               0	               0	               0	               0	            4000	               0	               0	               0	               0	               0	               0	snd_hda_intel
00e0	80868c10	1a	               0	               0	               0	               0	               0	               0	               0	               0	               0	               0	               0	               0	               0	               0	pcieport
00e1	80868c12	1b	               0	               0	               0	               0	               0	               0	               0	               0	               0	               0	               0	               0	               0	               0	pcieport
00e8	80868c26	17	        f7137000	               0	               0	               0	               0	               0	               0	             400	               0	               0	               0	               0	               0	               0	ehci-pci
00f8	80868c4e	0	               0	               0	               0	               0	               0	               0	               0	               0	               0	               0	               0	               0	               0	               0	lpc_ich
00fa	80868c02	1c	            f091	            f081	            f071	            f061	            f021	        f7136000	               0	               8	               4	               8	               4	              20	             800	               0	ahci
00fb	80868c22	12	        f7135004	               0	               0	               0	            f001	               0	               0	             100	               0	               0	               0	              20	               0	               0	i801_smbus
0100	10de11c4	21	        f6000000	        e800000c	               0	        f000000c	               0	            e001	           c0002	         1000000	         8000000	               0	         2000000	               0	              80	           20000	nouveau
0101	10de0e0b	11	        f7080000	               0	               0	               0	               0	               0	               0	            4000	               0	               0	               0	               0	               0	               0	snd_hda_intel
0300	104c8240	0	               0	               0	               0	               0	               0	               0	               0	               0	               0	               0	               0	               0	               0	               0	

Re: GRUB broken on newly updated MX-21

Posted: Fri Oct 14, 2022 1:39 pm
by Huckleberry Finn
Since it's:

Boot Mode: BIOS (legacy, CSM, MBR)

Select MBR when reinstalling Grub on live session with MX Boot Repair.

Location: sda

Select /boot (or /root) location: (Where MX is ... sda6 or 7 .. )


Just btw. put the boot flag on MX's partition, or on the ESP partition together with the esp flag.

Re: GRUB broken on newly updated MX-21

Posted: Fri Oct 14, 2022 2:04 pm
by fehlix
theprofa325 wrote: Fri Oct 14, 2022 1:22 pm I upgraded my daily driver desktop MX-21 system with synaptic and it broke the NVidia graphics. It would boot but only to a text screen. Then trying to follow web instructions to fix this, I somehow broke GRUB and now it will not boot at all (stops with "grub rescue>" prompt. I can boot and run fine with an MX-21 live usb.



MX Boot Repair cannot seem to reinstall GRUB and get me running again.
I think all the help I need is detailed instructions to get MX Boot Repair to successfully reinstall a bootable GRUB.
* Depends what you have already done, b/c "cannot seem to reinstall GRUB" is not much info. Any error message?

* Also, you have not mentioned what version and architecture are involved. There seems to be an EFI partition on a mbr/dos drive, which is rather unusual, but doable. What BOOT mode are you booting in UEFI or BIOS mode on the installed system ( the LIVE USB shows BIOS boot mode)

* the error message on QSI perl related is also a bit unusual, is this a customized ISO/USB ?
or can you get latest ISO

* Are you able to use "Chroot Rescue Scan" tool found in the menu,
and try to get a chroot-terminal on the installed system-
If yes, try to fix pending any configuration of packages like

Code: Select all

dpkg --configure -a 
With chroot you could:
* depending now on what boot mode UEFI or BIOS are involved reinstall GRUB
* fix NVIDIA , either reinstal or remve first and try with build in nouveau first
...
but give some details first, before going into much different directions.

Re: GRUB broken on newly updated MX-21

Posted: Fri Oct 14, 2022 3:09 pm
by theprofa325
...amazingly quick response, thanks.

I tried first what Huckleberry suggested. Now instead of what I reported before when attempting to boot from HD:

Code: Select all

GRUB loading.
Welcome to GRUB!

error: file `grub/i386-pc/normal.mod not found.
grub rescue> _
I now get :

Code: Select all

GNU GRUB version 2.06-3~deb11u1

Minimal BASH-like line editing is supported.  For the first word, TAB
lists possible command completions.  Anywhere else TAB lists possible
device or file conpletions.

grub>
In answer to Fehlix's questions:
=======================================
* Depends what you have already done, b/c "cannot seem to reinstall GRUB" is not much info. Any error message?

The MX Boot Repair tool does not give any error message, it reports success. However the system is not bootable. I have gone through the tool serially trying most of the options. It appears that it installs a version of GRUB that requires files that are not present on the installed system.

* Also, you have not mentioned what version and architecture are involved. There seems to be an EFI partition on a mbr/dos drive, which is rather unusual, but doable. What BOOT mode are you booting in UEFI or BIOS mode

Sorry but I don't understand the first part of this question. Version and architecture of what?
Using the chroot scan tool, I can see that the installed system is:

Code: Select all

more /etc/mxversion  
MX-21-x64 Wildflower Oct. 20, 2021

I am a bit ashamed to admit that I don't know whether the thing was booting UEFI or BIOS- I simply did a vanilla install of MX-21 from live usb (over my previous MX-19) and it is what it is. The hardware is a 2014 Dell Optiplex 9080 with a new-ish 1 TB SSD, if that gives any indication.

* the error message on QSI perl related is also a bit unusual, is this a customized ISO/USB ?
or can you get latest ISO

This USB was produced with the MX usb-making utility from a freshly downloaded MX ISO. No customizations, no persistence.

* Are you able to use "Chroot Rescue Scan" tool found in the menu,

I can access it and it finds my install on the HD. Entering the command you suggest (dpkg --configure -a) completes silently- no output at all.

Hoping to get this fixed, thanks for any more help.

Re: GRUB broken on newly updated MX-21

Posted: Fri Oct 14, 2022 3:28 pm
by Huckleberry Finn
Just chroot as you did and:

Code: Select all

grub-install /dev/sda

Re: GRUB broken on newly updated MX-21

Posted: Fri Oct 14, 2022 3:40 pm
by fehlix
Ah .. ok and oops.., the architecture was already shown in /etc/mx-version as amd64 64 bit
and also indicate it is Xfce version not KDE or fluxbox.
So now let try manual fix the grub-loader:
go into chroot again from live USB make sure/verify /dev/sda is still you boot device
so run

Code: Select all

lsblk -f

b/c the kernel may have reordered/reassigned different names due the the LiveUSB is plugged in.
Now, do install the GRUB loader into MBR:

Code: Select all

sudo grub-install --target=i386-pc  --recheck  /dev/sda
make sure if /dev/sda is show als the internal partition other adjust accordingly to the lsblk -f output.
post any output or errors.
and

Code: Select all

update-grub
Next run

Code: Select all

apt update
and

Code: Select all

apt full-upgrade
you may see some further updates.
Let's see so far any issue ...

+++EDIT+++
OK, and if there is a update of grub shown please run again:
in chroot'ed terminal

Code: Select all

grub-install --target=i386-pc  --recheck  /dev/sda
and

Code: Select all

update-grub
* in case you get any error message pleas post.
* also if you do still see grub-rescue prompt when booted do try this within chroot:

Code: Select all

grub-install --target=i386-pc  --recheck --modules=normal /dev/sda
this would (hopefully) make normal.mod loaded early.

Re: GRUB broken on newly updated MX-21

Posted: Sat Oct 15, 2022 6:40 am
by theprofa325
Alas, still no joy. Still boots to the grub> prompt.

I did the grub reinstall and update in chroot:

Code: Select all


chroot> sudo grub-install --target=i386-pc --recheck /dev/sdb
Installing for i386-pc platform.
Installation finished. No error reported.

(MX_21_Wildflower_) Sat Oct 15 06:07:44 /
chroot> update-grub
Generating grub configuration file ...
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
done

Then the update and upgrade. During upgrade received some suspicious messages that I don't know enough to interpret:

Code: Select all


Preconfiguring packages ...
(Reading database ... 536156 files and directories currently installed.)
Removing linux-headers-5.10.0-14-amd64 (5.10.113-1) ...
Removing linux-image-5.10.0-14-amd64 (5.10.113-1) ...
/etc/kernel/prerm.d/dkms:
dkms: removing: 8812au 4.2.2 (5.10.0-14-amd64) (x86_64)

-------- Uninstall Beginning --------
Module:  8812au
Version: 4.2.2
Kernel:  5.10.0-14-amd64 (x86_64)
-------------------------------------

Status: Before uninstall, this module version was ACTIVE on this kernel.

8812au.ko:
 - Uninstallation
   - Deleting from: /lib/modules/5.10.0-14-amd64/kernel/drivers/net/wireless/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

depmod....

DKMS: uninstall completed.
dkms: removing: broadcom-sta 6.30.223.271 (5.10.0-14-amd64) (x86_64)

-------- Uninstall Beginning --------
Module:  broadcom-sta
Version: 6.30.223.271
Kernel:  5.10.0-14-amd64 (x86_64)
-------------------------------------

Status: Before uninstall, this module version was ACTIVE on this kernel.

wl.ko:
 - Uninstallation
   - Deleting from: /lib/modules/5.10.0-14-amd64/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

depmod...

Warning: Unable to find an initial ram disk that I know how to handle.
Will not try to make an initrd.

DKMS: uninstall completed.
dkms: removing: rtl8821ce 5.5.2.1 (5.10.0-14-amd64) (x86_64)

-------- Uninstall Beginning --------
Module:  rtl8821ce
Version: 5.5.2.1
Kernel:  5.10.0-14-amd64 (x86_64)
-------------------------------------

Status: Before uninstall, this module version was ACTIVE on this kernel.

rtl8821ce.ko:
 - Uninstallation
   - Deleting from: /lib/modules/5.10.0-14-amd64/updates/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

/etc/modprobe.d/dkms.conf: removed 'blacklist rtw88_8821ce'
depmod...

DKMS: uninstall completed.
dkms: removing: rtl8821cu 5.4.1 (5.10.0-14-amd64) (x86_64)

-------- Uninstall Beginning --------
Module:  rtl8821cu
Version: 5.4.1
Kernel:  5.10.0-14-amd64 (x86_64)
-------------------------------------

Status: Before uninstall, this module version was ACTIVE on this kernel.

8821cu.ko:
 - Uninstallation
   - Deleting from: /lib/modules/5.10.0-14-amd64/kernel/drivers/net/wireless/realtek/rtl8821cu/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

depmod...

DKMS: uninstall completed.
W: Last kernel image has been removed, so removing the default symlinks
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-5.10.0-14-amd64
/etc/kernel/postrm.d/zz-update-grub:
Generating grub configuration file ...
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
done

During the update, grub was upgraded and gave suspicious messages:

Code: Select all

Installing for i386-pc platform.
grub-install: warning: File system `ext2' doesn't support embedding.
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..
Installation finished. No error reported.
Generating grub configuration file ...
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
done
Setting up dbus-user-session (1.12.24-0+deb11u1) ...
Setting up libreoffice-style-sifr (1:7.0.4-4+deb11u4) ...
Setting up libuno-cppu3 (1:7.0.4-4+deb11u4) ...


Processing triggers for hicolor-icon-theme (0.17-2) ...


After upgrade I did the grub-install again as directed and it ran without error:

Code: Select all



(MX_21_Wildflower_) Sat Oct 15 06:11:50 /
chroot> sudo grub-install --target=i386-pc --recheck /dev/sdb
Installing for i386-pc platform.
Installation finished. No error reported.

(MX_21_Wildflower_) Sat Oct 15 06:12:23 /
chroot> update-grub
Generating grub configuration file ...
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
done

(MX_21_Wildflower_) Sat Oct 15 06:13:08 /

However, the system STILL boots to the grub> prompt. As directed I then did :

Code: Select all

grub-install --target=i386-pc  --recheck --modules=normal /dev/sda
This also ran without error, but the system STILL boots to grub> prompt.

I'm at a loss here.

Thanks for any additional help.

Re: GRUB broken on newly updated MX-21

Posted: Sat Oct 15, 2022 7:07 am
by Huckleberry Finn
Enter Bios settings, change boot mode to Uefi (or at least have a check...) save & exit.

Chroot the same way, this time:

Code: Select all

grub-install --force-extra-removable --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=MX21 --recheck
Open GParted and right click on sda5 (in fact, that's too big, no harm but just waste of space: 7.5 GiB .. You can create a smaller one if you like, say 100-250 MiB and use that one) and put both boot and esp flags there.
____________________________

... Or (don't do the above), just open GParted and create a very tiny (say, 2 MiB) partition, (purposely) leave it unformatted, then right click on it: "Manage Flags": flag as bios_grub

Re: GRUB broken on newly updated MX-21

Posted: Sat Oct 15, 2022 7:41 am
by fehlix
OK, Huck recommend to switch to UEFI, probably a valid consideration.

Now, comming back to your last post.
I'm missing information about what is actually your boot drive,
which normally you would set within the BIOS settings of the motherboard
or select at boot up.

To figure this out:
within chroot list the drives and post here:

Code: Select all

lsblk -f
b/c as already mentioned the drive name sda or sdb can be differently
assigned at every boot depending whether some other drive like USB are plugged in.
Now,the error mesages indicate a wrong debconf entry:
pls post with chroot:

Code: Select all

debconf-show grub-pc
and this in chroot

Code: Select all

cat /etc/fstab
and this

Code: Select all

find /boot/grub /grub -name 'grub*' -ls
Thanks

Re: GRUB broken on newly updated MX-21

Posted: Tue Oct 18, 2022 12:10 pm
by theprofa325
OK, here we go.

Code: Select all

(MX_21_Wildflower_) Tue Oct 18 12:00:46 /
chroot> lsblk -f
NAME   FSTYPE   FSVER LABEL       UUID                                 FSAVAIL FSUSE% MOUNTPOINT
loop0  squashfs 4.0                                                                   
sda                                                                                   
├─sda1 ext4     1.0   boot        d7cfca98-066b-412d-9ce1-61ac30fecdd9  841.3M     2% /boot
├─sda2                                                                                
├─sda3 swap     1                 00c1711d-adb1-4c4f-b016-a816c5f28e41                [SWAP]
├─sda5 vfat     FAT32 EFI System  384C-8803                                           
├─sda6 ext4     1.0               f34eb12a-6be7-4efa-9659-30ddbed586a3                
└─sda7 ext4     1.0   rootMX21    9c79d178-2a9e-4556-b52a-8236447d0732   29.2G    45% /
sdb                                                                                   
└─sdb1 ext2     1.0               217152e1-762e-4c18-9ced-8fccf1aef54c                
sdh                                                                                   
├─sdh1 ext4     1.0   MX-Live-usb c47699b7-771f-4826-a227-90b6de737c16                
└─sdh2 vfat     FAT32 MX-UEFI     516E-0C48                                           
sr0                

and the debconf-show:

Code: Select all

chroot> debconf-show grub-pc
  grub-pc/postrm_purge_boot_grub: false
  grub-pc/partition_description:
  grub-pc/mixed_legacy_and_grub2: true
  grub2/kfreebsd_cmdline_default: quiet
  grub-pc/install_devices_failed: false
  grub-pc/hidden_timeout: false
  grub2/update_nvram: true
  grub-pc/disk_description:
  grub-pc/chainload_from_menu.lst: true
  grub2/kfreebsd_cmdline:
  grub-pc/install_devices_failed_upgrade: true
  grub-pc/kopt_extracted: false
  grub-pc/timeout: 5
  grub2/force_efi_extra_removable: false
  grub2/linux_cmdline_default: quiet splash
  grub-pc/install_devices_empty: false
* grub-pc/install_devices: /dev/disk/by-id/ata-CT1000MX500SSD1_2043E4BD4AA0-part1
  grub2/linux_cmdline:
  grub-pc/install_devices_disks_changed:

(MX_21_Wildflower_) Tue Oct 18 12:04:40 /

And the fstab listing:

Code: Select all


chroot> cat /etc/fstab
# Pluggable devices are handled by uDev, they are not in fstab
UUID=9c79d178-2a9e-4556-b52a-8236447d0732 / ext4 noatime 1 1
UUID=d7cfca98-066b-412d-9ce1-61ac30fecdd9 /boot ext4 noatime 1 1
UUID=f34eb12a-6be7-4efa-9659-30ddbed586a3 /home ext4 noatime 1 2
/dev/sda3	nont	swap	sw	0	0

(MX_21_Wildflower_) Tue Oct 18 12:06:13 /

And finally the find command (taught me some new "find" functionality here!)

Code: Select all

chroot> find /boot/grub /grub -name 'grub*' -ls
     7633      4 drwxr-xr-x   6 root     root         4096 Oct 15 06:13 /boot/grub
      334    132 -rw-r--r--   1 root     root       135168 Sep 30 11:30 /boot/grub/x86_64-efi/grub.efi
      332      4 -rw-r--r--   1 root     root         1024 Sep 30 11:30 /boot/grub/grubenv
      337      4 -rw-r--r--   1 root     root         3142 Oct 15 06:13 /boot/grub/grub.cfg
find: ‘/grub’: No such file or directory
Note that I have executed the grub repair tool multiple times with various options so there could be redundancy here.

Thanks for all the dedicated help. I'm living off my (obsessively backed up) laptop but my day job doesn't stop so I can only work on this every other day or so.

Re: GRUB broken on newly updated MX-21

Posted: Tue Oct 18, 2022 11:43 pm
by pbear
Too many cooks spoil the broth, so I'm not going to make any specific suggestions. Instead, I'll limit myself to a few comments which hopefully will be helpful.

1. fstab confirms the system was installed in BIOS mode, as there's no line mounting the EFI partition. As for why you have an EFI partition, well, you're the only one who was there.

2. You can get system information in a live session by running inxi -Fxxxrza in Terminal.

3. Once you fix the mess, take a look at Timeshift (already installed). If you'd had a Timeshift snapshot before the update which caused all this, you would have been back in business in less than ten minutes.

Re: GRUB broken on newly updated MX-21

Posted: Wed Oct 19, 2022 8:46 am
by fehlix
This line in debconf-show grub-pc

Code: Select all

* grub-pc/install_devices: /dev/disk/by-id/ata-CT1000MX500SSD1_2043E4BD4AA0-part1
indicates reason of the original boot error after grub upgrade, as it points to the partition boot sector,
which will not be used when re-booting in BIOS/MBR boot mode.
So the old grub-loader from MBR was loaded and caused the GRUB error.
The system seems to be able to boot in both either UEFI and BIOS-boot mode,
also you seem to have now installed GRUB in both BIOS and UEFI mode.
What I would now try: Do boot from LiveUSB and
at the Live GRUB menu (you may need to select "Switch to GRUB..." when booting in BIOS mode)
select Boot Rescue menus. Now try either of both to find "Grub boot loader" and/or "GRUB menu"
At least it would show whether the system is still bootable with some help of the LiveUSB.
Also, when booted into installed do post "QSI" "Quick System Info" report.

Re: GRUB broken on newly updated MX-21

Posted: Wed Oct 19, 2022 2:11 pm
by theprofa325
OK, from Live Grub menu, choose enter GRUB option. Selected Find GRUB bootloader.
Result is :

Code: Select all

searching for GRUB bootloader ...
found GRUB bootloader at (hd0,1): MX-Live-usb
found GRUB bootloader at (hd1,1) : boot
Then going back to main GRUB menu and searching for GRUB menu, result is:

Code: Select all

searching for GRUB menus ...
found GRUB menu on (hd0,1)  :  MX-Live-usb
found GRUB menu on (hd0,2)  :  MX-UEFI
found GRUB menu on (hd1.1)  :  boot
So it looks as if I should be able to boot from hd1.1, assuming the version of GRUB that's installed can find all the files it needs to run.

HOWEVER, when I reboot from USB and go back to the main menu invoked by "Switch to GRUB bootloader", then Boot Rescue Menus, then GRUB Bootloader,
it finds bootloader as above. I hit return to escape from the results screen, and am presented with a 4-choice screen:

Code: Select all

===>GRUB Bootloader<===
GRUB loader @ (hd0,1)  MX-live-usb
GRUB loader @ (hd1,1) boot
<=== Back to main menu (or press >>ESC<<)
When I select (hd1,1), which I assume boots from that choice, I get no joy, just the grub> prompt. Something is wrong with the installed GRUB.
Thanks for further assistance.

BTW thanks to pbear for suggesting Timeshift, I will definitely look into this for all my systems.

Re: GRUB broken on newly updated MX-21

Posted: Wed Oct 19, 2022 2:24 pm
by fehlix
theprofa325 wrote: Wed Oct 19, 2022 2:11 pm

Code: Select all

===>GRUB Bootloader<===
GRUB loader @ (hd0,1)  MX-live-usb
GRUB loader @ (hd1,1) boot
<=== Back to main menu (or press >>ESC<<)
When I select (hd1,1), which I assume boots from that choice, I get no joy, just the grub> prompt. Something is wrong with the installed GRUB.
Try, the other one select from "GRUB menus", i.e. not from found "GRUB loader" list, the difference it will load the menu using the GRUB from the LiveUSB, not the installed one.

Re: GRUB broken on newly updated MX-21

Posted: Wed Oct 19, 2022 7:08 pm
by pbear
And please post your system information: inxi -Fxxxrza

Re: GRUB broken on newly updated MX-21

Posted: Thu Oct 20, 2022 9:20 am
by theprofa325
OK, fehlix and pbear.

I tried the "grub menus" selection from "boot rescue" at initial GRUB screen when booting from USB. Both the "/boot" entry and the "EFI" entry fail silently and return to the initial GRUB screen.

Results from inxi -Fxxxrza follow:

Code: Select all

demo@mx1:~
$ inxi -Fxxxrza
System:    Kernel: 5.10.0-18-amd64 x86_64 bits: 64 compiler: gcc v: 10.2.1 
           parameters: BOOT_IMAGE=/antiX/vmlinuz quiet splasht nosplash 
           Desktop: Xfce 4.16.0 tk: Gtk 3.24.24 info: xfce4-panel wm: xfwm 4.16.1 vt: 7 
           dm: LightDM 1.26.0 Distro: MX-21.2.1_x64 Wildflower September 18  2022 
           base: Debian GNU/Linux 11 (bullseye) 
Machine:   Type: Desktop System: Dell product: OptiPlex 9020 v: 01 serial: <filter> Chassis: 
           type: 6 serial: <filter> 
           Mobo: Dell model: 0PC5F7 v: A03 serial: <filter> BIOS: Dell v: A07 date: 04/25/2014 
Battery:   Device-1: hidpp_battery_0 model: Logitech Wireless Mouse M325 serial: <filter> 
           charge: 55% (should be ignored) rechargeable: yes status: Discharging 
           Device-2: hidpp_battery_1 model: Logitech Wireless Keyboard K330 serial: <filter> 
           charge: 55% (should be ignored) rechargeable: yes status: Discharging 
CPU:       Info: Quad Core model: Intel Core i7-4770 bits: 64 type: MT MCP arch: Haswell 
           family: 6 model-id: 3C (60) stepping: 3 microcode: 17 cache: L2: 8 MiB 
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 54276 
           Speed: 3393 MHz min/max: 800/3900 MHz Core speeds (MHz): 1: 3393 2: 3392 3: 3392 
           4: 3392 5: 3393 6: 3394 7: 3393 8: 3402 
           Vulnerabilities: Type: itlb_multihit status: KVM: VMX disabled 
           Type: l1tf mitigation: PTE Inversion; VMX: conditional cache flushes, SMT vulnerable 
           Type: mds 
           status: Vulnerable: Clear CPU buffers attempted, no microcode; SMT vulnerable 
           Type: meltdown mitigation: PTI 
           Type: mmio_stale_data status: Unknown: No mitigations 
           Type: retbleed status: Not affected 
           Type: spec_store_bypass status: Vulnerable 
           Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization 
           Type: spectre_v2 
           mitigation: Retpolines, STIBP: disabled, RSB filling, PBRSB-eIBRS: Not affected 
           Type: srbds status: Vulnerable: No microcode 
           Type: tsx_async_abort 
           status: Vulnerable: Clear CPU buffers attempted, no microcode; SMT vulnerable 
Graphics:  Device-1: NVIDIA GK106 [GeForce GTX 645 OEM] driver: nouveau v: kernel 
           bus-ID: 01:00.0 chip-ID: 10de:11c4 class-ID: 0300 
           Display: x11 server: X.Org 1.20.11 compositor: xfwm4 v: 4.16.1 driver: 
           loaded: modesetting unloaded: fbdev,vesa display-ID: :0.0 screens: 1 
           Screen-1: 0 s-res: 1680x1050 s-dpi: 96 s-size: 444x277mm (17.5x10.9") 
           s-diag: 523mm (20.6") 
           Monitor-1: DP-1 res: 1680x1050 hz: 60 dpi: 90 size: 473x296mm (18.6x11.7") 
           diag: 558mm (22") 
           OpenGL: renderer: NVE6 v: 4.3 Mesa 20.3.5 direct render: Yes 
Audio:     Device-1: Intel 8 Series/C220 Series High Definition Audio vendor: Dell 
           driver: snd_hda_intel v: kernel bus-ID: 00:1b.0 chip-ID: 8086:8c20 class-ID: 0403 
           Device-2: NVIDIA GK106 HDMI Audio driver: snd_hda_intel v: kernel bus-ID: 01:00.1 
           chip-ID: 10de:0e0b class-ID: 0403 
           Sound Server-1: ALSA v: k5.10.0-18-amd64 running: yes 
           Sound Server-2: PulseAudio v: 14.2 running: yes 
Network:   Device-1: Intel Ethernet I217-LM vendor: Dell driver: e1000e v: kernel port: f040 
           bus-ID: 00:19.0 chip-ID: 8086:153a class-ID: 0200 
           IF: eth0 state: up speed: 1000 Mbps duplex: full mac: <filter> 
Drives:    Local Storage: total: 1.88 TiB used: 1.74 GiB (0.1%) 
           SMART Message: Unable to run smartctl. Root privileges required. 
           ID-1: /dev/sda maj-min: 8:0 vendor: Crucial model: CT1000MX500SSD1 size: 931.51 GiB 
           block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s type: SSD 
           serial: <filter> rev: 033 scheme: MBR 
           ID-2: /dev/sdb maj-min: 8:16 vendor: Western Digital model: WD10EARS-00Y5B1 
           size: 931.51 GiB block-size: physical: 512 B logical: 512 B speed: 3.0 Gb/s type: N/A 
           serial: <filter> rev: 0A80 scheme: MBR 
           ID-3: /dev/sdh maj-min: 8:112 type: USB model: USB DISK 3.0 size: 57.77 GiB 
           block-size: physical: 512 B logical: 512 B type: N/A serial: <filter> rev: PMAP 
           scheme: MBR 
           SMART Message: Unknown USB bridge. Flash drive/Unsupported enclosure? 
Swap:      Kernel: swappiness: 15 (default 60) cache-pressure: 100 (default) 
           ID-1: swap-1 type: partition size: 21.81 GiB used: 0 KiB (0.0%) priority: -2 
           dev: /dev/sda3 maj-min: 8:3 
Sensors:   System Temperatures: cpu: 29.8 C mobo: 27.8 C gpu: nouveau temp: 46.0 C 
           Fan Speeds (RPM): N/A gpu: nouveau fan: 2220 
Repos:     Packages: note: see --pkg apt: 1952 lib: 979 flatpak: 0 
           No active apt repos in: /etc/apt/sources.list 
           Active apt repos in: /etc/apt/sources.list.d/debian-stable-updates.list 
           1: deb http://deb.debian.org/debian bullseye-updates main contrib non-free
           Active apt repos in: /etc/apt/sources.list.d/debian.list 
           1: deb http://deb.debian.org/debian bullseye main contrib non-free
           2: deb http://security.debian.org/debian-security bullseye-security main contrib non-free
           Active apt repos in: /etc/apt/sources.list.d/mx.list 
           1: deb http://mxrepo.com/mx/repo/ bullseye main non-free
Info:      Processes: 251 Uptime: 1m wakeups: 5 Memory: 7.71 GiB used: 940.8 MiB (11.9%) 
           Init: SysVinit v: 2.96 runlevel: 5 default: 5 tool: systemctl Compilers: gcc: N/A 
           alt: 10 Shell: Bash v: 5.1.4 running-in: xfce4-terminal inxi: 3.3.06 
demo@mx1:~
Thanks, folks.

Re: GRUB broken on newly updated MX-21

Posted: Thu Oct 20, 2022 10:50 pm
by pbear
The big surprise, as far as I'm concerned, is that inxi reports the firmware is classic BIOS (see end of Machine stanza). Based on the purchase date (you said 2014), I was expecting UEFI (legacy), also known as BIOS compatibility mode. OTOH, classic BIOS is consistent with your MBR partition tables, so maybe I shouldn't be so surprised. At a guess, this was old stock (OEMs switched to UEFI in 2012) or a refurbished machine.

Re: GRUB broken on newly updated MX-21

Posted: Fri Oct 21, 2022 3:02 am
by Antediluvian
pbear wrote: Thu Oct 20, 2022 10:50 pm The big surprise, as far as I'm concerned, is that inxi reports the firmware is classic BIOS (see end of Machine stanza). Based on the purchase date (you said 2014), I was expecting UEFI (legacy), also known as BIOS compatibility mode. OTOH, classic BIOS is consistent with your MBR partition tables, so maybe I shouldn't be so surprised. At a guess, this was old stock (OEMs switched to UEFI in 2012) or a refurbished machine.
Since I am a perpetual computer beginner I may be missing the point, but ...

I have a Dell Optiplex 7010 and a 7020, which were introduced a year before (2012) and a year after (2014) the OP's 9020 (2013), respectively. The firmware of each of these three models is UEFI capable.

In the QSI Machine stanza the statement of BIOS or UEFI just refers to whatever boot procedure is used. It doesn't indicate what the computer is capable of. For example, on my 7010 I have MX18 installed in BIOS/MBR. The Machine stanza of the QSI says BIOS. If I insert a live USB running MX21 that boots in UEFI, then the Machine stanza says UEFI.

By the way, the OP's QSI indicates his firmware is pretty old, specifically Dell v: A07 date: 04/25/2014. The current firmware is v: A25: 07/19/2019 and designated "critical".

Re: GRUB broken on newly updated MX-21

Posted: Fri Oct 21, 2022 5:55 am
by theprofa325
Thanks for these comments. I took the date from the Dell "date of manufacture" marked on the machine. The need for a firmware update is another complication- AFAIK you need a working OS for that, possibly only windoze. But I'd like to get it running again before risking the firmware update. The machine came from IT surplus at my university (apparently a quad core A7 with 8 GB RAM is no longer sufficient to run M$WORD and EXCEL) so anything is possible.

Seems to me at this point that there might be a problem with the installed grub menu, since fehlix's suggestion to boot using the GRUB code on the USB and the menu on the installed system did not work.

Re: GRUB broken on newly updated MX-21

Posted: Fri Oct 21, 2022 7:24 am
by fehlix
theprofa325 wrote: Thu Oct 20, 2022 9:20 am OK, fehlix and pbear.

I tried the "grub menus" selection from "boot rescue" at initial GRUB screen when booting from USB. Both the "/boot" entry and the "EFI" entry fail silently and return to the initial GRUB screen.
That's the relevant entry

"found GRUB menu on (hd1.1) : boot"

and indicates something with the generated GRUB menu, b/c it failed to load.
When you selected the grub loader using this entry:

"GRUB loader @ (hd1,1) boot"

it would also finally try to load the GRUB menu, and fails also.
Perhaps do post the content of the grub.cfg file:
Boot into LiveUSB ,
open Thunar filemanager and Click-mount on boot partition /dev/sda1
and within directory /grub
open /grub/grub.cfg
with text-editor.
Post content here between code-tags.
Next steps depending on the content found.

Re: GRUB broken on newly updated MX-21

Posted: Fri Oct 21, 2022 12:57 pm
by theprofa325
Here is the grub.cfg from the non-bootable system installed on disk:

Code: Select all

demo@mx1:~
$ cat disk/grub/grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  set have_grubenv=true
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}
function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_msdos
insmod ext2
set root='hd1,msdos7'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos7 --hint-efi=hd1,msdos7 --hint-baremetal=ahci1,msdos7  9c79d178-2a9e-4556-b52a-8236447d0732
else
  search --no-floppy --fs-uuid --set=root 9c79d178-2a9e-4556-b52a-8236447d0732
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=1024x768
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_US
  insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ] ; then
  set timeout=30
else
  if [ x$feature_timeout_style = xy ] ; then
    set timeout_style=menu
    set timeout=5
  # Fallback normal timeout code in case the timeout_style feature is
  # unavailable.
  else
    set timeout=5
  fi
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=cyan/blue
set menu_color_highlight=white/blue
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
	set gfxpayload="${1}"
}
set linux_gfx_mode=
export linux_gfx_mode

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_memtest86+ ###
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
### END /etc/grub.d/30_uefi-firmware ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg
fi
### END /etc/grub.d/41_custom ###
demo@mx1:~
$ 
As always, thank you for your assistance.

Re: GRUB broken on newly updated MX-21

Posted: Fri Oct 21, 2022 1:49 pm
by fehlix
theprofa325 wrote: Fri Oct 21, 2022 12:57 pm

Code: Select all

### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
	set gfxpayload="${1}"
}
set linux_gfx_mode=
export linux_gfx_mode

### END /etc/grub.d/10_linux ###
Hmme not much grub.cfg between BEGIN and END of 10_linux,
so it cannot boot b/c no grub-entries have been generated.
Something to check further I guess:
A) check what's an the boot- partition under with the top directory "/"
B) check what under the /boot directory on the MX-21 root-partitions
C) check whats the content of /etc/grub.d directory on the MX-21 root-partitions.

Do all this when booted with LiveUSB

to A:
Mount boot partition in Thunar,
Right click an open Terminal here:
List the content

Code: Select all

ls -al 
to B:
Mount int Thunar MX-21 root open.
right click on the /boot directory,
this directroy should be empty.
If not open terminal here and

Code: Select all

ls -al
to C:
Same as B: but show content of etc/grub.d on the MX-21 root partition
within the directory /etc/grub.d

Code: Select all

ls -al 
That's it for now.

Re: GRUB broken on newly updated MX-21

Posted: Fri Oct 21, 2022 9:21 pm
by pbear
theprofa325 wrote: Fri Oct 21, 2022 12:57 pm Here is the grub.cfg from the non-bootable system
Shot in the dark. Did you perchance install Grub Customizer?

@fehlix, whether or not the OP did, I respectfully suggest purge-and-reinstall of Grub, from chroot of course.
You're captain of the ship, though, so your call whether to pursue that strategy.

Re: GRUB broken on newly updated MX-21

Posted: Mon Oct 24, 2022 10:14 am
by theprofa325
OK, here we go. To pbear- no grub customization used.

listing boot partition:

Code: Select all

$ sudo fdisk -l /dev/sda
Disk /dev/sda: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: CT1000MX500SSD1 
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0xfc6cd71c

Device     Boot      Start        End    Sectors   Size Id Type
/dev/sda1             2048    1953791    1951744   953M 83 Linux
/dev/sda2          1955838 1907783679 1905827842 908.8G  5 Extended
/dev/sda3       1907783680 1953523711   45740032  21.8G 82 Linux swap / Solaris
/dev/sda5        126955520  142579711   15624192   7.5G ef EFI (FAT-12/16/32)
/dev/sda6        142581760 1907363839 1764782080 841.5G 83 Linux
/dev/sda7  *       1957888  126953471  124995584  59.6G 83 Linux

Partition 2 does not start on physical sector boundary.
Partition table entries are not in disk order.
demo@mx1:~
$ sudo mount /dev/sda1 disk
demo@mx1:~
$ cd disk
demo@mx1:~/disk
$ ls -la
total 12
drwxr-xr-x  4 root root 4096 Sep 30 11:29 .
drwxr-xr-x 19 demo demo  540 Oct 24 09:56 ..
drwxr-xr-x  2 root root 4096 Sep 30 11:29 efi
drwxr-xr-x  6 root root 4096 Oct 15 06:13 grub

$ ls -la grub
total 2396
drwxr-xr-x 6 root root    4096 Oct 15 06:13 .
drwxr-xr-x 4 root root    4096 Sep 30 11:29 ..
drwxr-xr-x 2 root root    4096 Sep 30 11:30 fonts
-rw-r--r-- 1 root root    3142 Oct 15 06:13 grub.cfg
-rw-r--r-- 1 root root    1024 Sep 30 11:30 grubenv
drwxr-xr-x 2 root root   20480 Oct 15 06:21 i386-pc
drwxr-xr-x 2 root root    4096 Oct 15 06:21 locale
-rw-r--r-- 1 root root 2394108 Oct 15 06:11 unicode.pf2
drwxr-xr-x 2 root root   12288 Sep 30 11:30 x86_64-efi
demo@mx1:~/disk
$ ls -la efi
total 8
drwxr-xr-x 2 root root 4096 Sep 30 11:29 .
drwxr-xr-x 4 root root 4096 Sep 30 11:29 ..
demo@mx1:~/disk
Next, listing /boot on MX-21 root directory:

Code: Select all


$ sudo umount /dev/sda1
demo@mx1:~
$ sudo mount /dev/sda7 disk
demo@mx1:~
$ cd disk
demo@mx1:~/disk
$ ls -la
total 100
drwxr-xr-x  20 root root  4096 Oct 15 06:11 .
drwxr-xr-x  19 demo demo   540 Oct 24 09:56 ..
lrwxrwxrwx   1 root root     7 Oct 18  2021 bin -> usr/bin
drwxr-xr-x   2 root root  4096 Feb 28  2022 boot
drwx------   2 root root  4096 Feb 28  2022 .cache
drwx------   3 root root  4096 Feb 28  2022 .config
drwxr-xr-x   2 root root  4096 Feb 28  2022 dev
drwxr-xr-x 151 root root 12288 Oct 15 06:11 etc
-rwxr-xr--   1 root root    80 Sep 19 16:17 .fehbg
drwxr-xr-x   2 root root  4096 Feb 28  2022 home
lrwxrwxrwx   1 root root     7 Oct 18  2021 lib -> usr/lib
lrwxrwxrwx   1 root root     9 Oct 18  2021 lib64 -> usr/lib64
lrwxrwxrwx   1 root root    10 Oct 18  2021 libx32 -> usr/libx32
drwx------   2 root root 16384 Feb 28  2022 lost+found
drwxr-xr-x   3 root root  4096 Jul 20 09:26 media
drwxr-xr-x   2 root root  4096 Feb 28  2022 mnt
drwxr-xr-x   5 root root  4096 Jun  2 12:53 opt
drwxr-xr-x   2 root root  4096 Feb 28  2022 proc
drwx------   2 root root  4096 Mar 10  2022 pulse
drwx------  20 root root  4096 Oct 15 06:17 root
drwxr-xr-x   2 root root  4096 Feb 28  2022 run
lrwxrwxrwx   1 root root     8 Oct 18  2021 sbin -> usr/sbin
drwxr-xr-x   2 root root  4096 Feb 28  2022 sys
drwxrwxrwt   5 root root  4096 Sep 27 12:53 tmp
drwxr-xr-x  14 root root  4096 Oct 18  2021 usr
drwxr-xr-x  12 root root  4096 Oct 18  2021 var
demo@mx1:~/disk$
ls -la boot
total 8
drwxr-xr-x  2 root root 4096 Feb 28  2022 .
drwxr-xr-x 20 root root 4096 Oct 15 06:11 ..


And finally, /etc/grub.d:

Code: Select all

demo@mx1:~/disk


demo@mx1:~/disk
$ ls -la etc/grub.d
total 136
drwxr-xr-x   2 root root  4096 Oct 15 06:11 .
drwxr-xr-x 151 root root 12288 Oct 15 06:11 ..
-rwxr-xr-x   1 root root 10046 Jul 10  2021 00_header
-rwxr-xr-x   1 root root  6260 Jul 10  2021 05_debian_theme
-rwxr-xr-x   1 root root 14123 Aug  1 15:26 10_linux
-rwxr-xr-x   1 root root 13654 Mar  1  2022 10_linux.dpkg-old
-rwxr-xr-x   1 root root 14180 Aug  1 15:26 20_linux_xen
-rwxr-xr-x   1 root root  1444 Oct 18  2021 20_memtest86+
-rwxr-xr-x   1 root root 12910 Aug  1 15:26 30_os-prober
-rwxr-xr-x   1 root root 12162 Oct 18  2021 30_os-prober.dpkg-old
-rwxr-xr-x   1 root root  1372 Aug  1 15:26 30_uefi-firmware
-rwxr-xr-x   1 root root  1594 Oct 18  2021 30_uefi-firmware.dpkg-old
-rwxr-xr-x   1 root root   214 Jul 10  2021 40_custom
-rwxr-xr-x   1 root root   215 Aug  1 15:26 41_custom
-rw-r--r--   1 root root   483 Jul 10  2021 README
Thank you for continuing with this extended thread.

Re: GRUB broken on newly updated MX-21

Posted: Mon Oct 24, 2022 11:35 am
by fehlix
Hmm...
This is on sda1 which got as mounted onto /boot on sda7 "/"- rootMX21 partition:

Code: Select all

sudo mount /dev/sda1 disk
$ cd disk
$ ls -la
total 12
drwxr-xr-x  4 root root 4096 Sep 30 11:29 .
drwxr-xr-x 19 demo demo  540 Oct 24 09:56 ..
drwxr-xr-x  2 root root 4096 Sep 30 11:29 efi
drwxr-xr-x  6 root root 4096 Oct 15 06:13 grub
and this is on sda7 rootMX21 under boot

Code: Select all

sudo mount /dev/sda7 disk
$ cd disk
ls -la boot
total 8
drwxr-xr-x  2 root root 4096 Feb 28  2022 .
drwxr-xr-x 20 root root 4096 Oct 15 06:11 ..

which tells nowhere any linux kernels to be found, so grub is correct, it can't find anything to boot.
Not sure what you have done, I'm affraid without linux kernels installed this system won't boot.
In case you would be able to use Chroot-Rescue-Scan again to chroot into,
maybe you could install the missing kernel.

Re: GRUB broken on newly updated MX-21

Posted: Tue Oct 25, 2022 10:59 am
by theprofa325
OK, fehlix, I confirm that /boot on the installed MX-21 root drive is empty.

Proceeding cautiously, I look at the synaptic package manager (to avoid possible typos with command line installers). It shows
linux-image-5.10.0-13-amd64 5.10.106-1 as the installed kernel. (At least, I think that's what this is.) Of course that reflects the state of the dpkg database, not the actual situation on disk. However, synaptic (perhaps wisely) does not allow me to "mark for reinstallation" this as it does for any other entry.

Should I go ahead with dpkg? From dpkg manual I think steps would be (in chroot environment):
* download linux-image-5.10.0-13-amd64 5.10.106-1.deb from MX mirror or ??
* run:

Code: Select all

dpkg -i  linux-image-5.10.0-13-amd64 5.10.106-1.deb
Any suggestions welcome. Needless to say I have no idea how the contents of /boot got wiped out- I certainly didn't knowingly do it.

Thanks.

Re: GRUB broken on newly updated MX-21

Posted: Tue Oct 25, 2022 11:42 am
by pbear
Frankly, if I were in your shoes, this is the point where I would throw in the towel and reinstall the whole system. I assume fehlix can walk you through reinstalling a kernel via chroot. (Heck, I probably could do it.) But there's no way of knowing what else has gone sideways, not to mention the original update problem which set you off on this frolic.

If and when you reinstall, remember to set up Timeshift, so you don't have to go through this again.

Re: GRUB broken on newly updated MX-21

Posted: Tue Oct 25, 2022 2:26 pm
by fehlix
theprofa325 wrote: Tue Oct 25, 2022 10:59 am OK, fehlix, I confirm that /boot on the installed MX-21 root drive is empty.

Proceeding cautiously, I look at the synaptic package manager (to avoid possible typos with command line installers). It shows
linux-image-5.10.0-13-amd64 5.10.106-1 as the installed kernel. (At least, I think that's what this is.) Of course that reflects the state of the dpkg database, not the actual situation on disk. However, synaptic (perhaps wisely) does not allow me to "mark for reinstallation" this as it does for any other entry.

Should I go ahead with dpkg? From dpkg manual I think steps would be (in chroot environment):
* download linux-image-5.10.0-13-amd64 5.10.106-1.deb from MX mirror or ??
* run:

Code: Select all

dpkg -i  linux-image-5.10.0-13-amd64 5.10.106-1.deb
Any suggestions welcome. Needless to say I have no idea how the contents of /boot got wiped out- I certainly didn't knowingly do it.

Thanks.
Try this,
* Boot from MX Live USB
* open terminal as normal user and run

Code: Select all

sudo chroot-rescue-scan
* in case it found the nstalled system use arrow-keys to slect and enter to visit the installed system

* If you got a "chroot>" prompt,
try this at withni chroot:

Code: Select all

apt update

Code: Select all

apt reinstall linux-image-amd64 linux-headers-amd64
with some luck you will get latest Debian kernal installed
it may have already re-genrated the grub -menu.
But try manyully:

Code: Select all

update-grub
when done type
exit
and press enter to leave chroot.
type twice q to quit
and shutdown pullout the LiveUSB and boot t he pc.

Re: GRUB broken on newly updated MX-21

Posted: Mon Oct 31, 2022 10:36 am
by theprofa325
Success!
The system boots and runs after following fehlix's last posted instructions.

The only thing wrong is that there is no GRUB menu with the usual options. Blank screen instead, but after the usual 5 seconds or whatever it is, it boots the installed system. This is not a big deal since system is not dual boot or anything, and I suppose I can fix it by delving into grub manual.

Thank you all so much for your persistence and assistance. I'll now go learn about Timeshift, and hopefully restore the grub menu without destroying my system again.