You are not logged in.

#1 2024-11-17 17:26:40

cervyesterday
Member
Registered: 2022-11-13
Posts: 88

[SOLVED]Bootloader issue

Hello everyone,
After a big update (haven't update for a while) i shut down my laptop but now when turning it on the bootloader isn't starting at all. So i think now i can restore it via live usb but idk how to do it properly. I'm trying to reinstall grub but it tells me

grub-install: error: cannot delete '/boot/grub/x86_64-efi/memrw.mod': read-only file system

I know i shoud remount with read and write permissions but i'm not sure what to remount...

Any suggestions?

Last edited by cervyesterday (2024-11-18 17:02:58)

Offline

#2 2024-11-17 18:10:25

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,232

Re: [SOLVED]Bootloader issue

After you booted from the install media, did you set up and enter a chroot?   
You should have mounted your root file system on /mnt, your EFI file system on /mnt/boot, then entered your system using arch-chroot /mnt
Then update GRUB.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#3 2024-11-17 18:31:05

cervyesterday
Member
Registered: 2022-11-13
Posts: 88

Re: [SOLVED]Bootloader issue

Yes i did all of the above. If i try to update with

grub-mkconfig -o /boot/grub/grub.cfg

It says the filesystem is read only. Should i remount /mnt? /mnt/boot? And in the case, what is the correct syntax, just

mount remount,rw /mnt

?

Offline

#4 2024-11-17 20:56:29

seth
Member
Registered: 2012-09-03
Posts: 59,061

Re: [SOLVED]Bootloader issue

First and foremost: why is it mounted read-only?
EIther you're looking at the wrong filesystem (ie. the /boot path on the install iso) or the filesystem is corrupted or the disk damaged.
Does dmesg tell you why the FS was (likely "re-")mounted ro?
Do you need to fsck it?
What does "smartctl -a" say?

(Idk whether smartctl is on the iso, in doubt use some live-distro like https://grml.org/ )

Offline

#5 2024-11-17 21:31:49

cervyesterday
Member
Registered: 2022-11-13
Posts: 88

Re: [SOLVED]Bootloader issue

I'm not sure what to reply... i'll try to explain in the most complete way and trying to reply to your questions.
if I turn on the laptop grub says

Reboot into firmware interface

So if I use a live usb the first things i see are these messages

ACPI BIOS Error (bug): could not resolve symbol [\_SB.PC00.RP09.PEGP.DDNT], AE_NOT_FOUND (20240322/psargs-332)
ACPI Error: Aborting method \_SB.PC00.LPCB.EC.SEN4._TMP due to previous error (AE_NOT_FOUND) (20240322/psparse-529)

So i thought what i said before, that updating grub would fix and i got that error of ro. Note that the fstab says that both the root and the efi partitions are rw.

Now, if I run dmesg while in chroot i can see two lines that can help

EXT4-fs (name) warning: mounting fs with errors, running e2fsck is recommended
...
FAT-fs (name) Volume was notproperly unmounted. Some data may be corrupt. Please run fsck

So, i think i need to fsck, but actually idk what it means. I'll start reading the guide about it.

Last but not least, for both the partitions smartctl says a lot of infos but nothing that seems like an error. Indeed, at the bottom it says

No Errors Logged

EDIT:
I read the guide. Does "run fsck" simply mean run

fsck -a

as said in the wiki?

Last edited by cervyesterday (2024-11-17 21:45:29)

Offline

#6 2024-11-17 21:34:08

seth
Member
Registered: 2012-09-03
Posts: 59,061

Re: [SOLVED]Bootloader issue

dmesg | curl -F 'file=@-' 0x0.st
smartctl -a /dev/sdX | curl -F 'file=@-' 0x0.st # use the proper device instead of sdX

Offline

#7 2024-11-17 21:54:05

cervyesterday
Member
Registered: 2022-11-13
Posts: 88

Re: [SOLVED]Bootloader issue

seth wrote:
dmesg | curl -F 'file=@-' 0x0.st
smartctl -a /dev/sdX | curl -F 'file=@-' 0x0.st # use the proper device instead of sdX

Dmesg output: http://0x0.st/XdS8.txt

Smartctl output: http://0x0.st/XdSq.txt

Offline

#8 2024-11-17 22:14:54

seth
Member
Registered: 2012-09-03
Posts: 59,061

Re: [SOLVED]Bootloader issue

umount nvme0n1p1
umount nvme0n1p2

And then fsck both.

After a big update (haven't update for a while) i shut down my laptop

With the power button? Any idea why else both partitions might be corrupted?

Offline

#9 2024-11-17 22:24:11

cervyesterday
Member
Registered: 2022-11-13
Posts: 88

Re: [SOLVED]Bootloader issue

Actually i can't remember if with power button, but it could be (finally i know why it shouldn't be done).

Do i have to run

fsck -a

or

fsck -r nvme0n1px

two times? And after that, it willautomatically remount both partitions?

Offline

#10 2024-11-17 22:28:28

seth
Member
Registered: 2012-09-03
Posts: 59,061

Re: [SOLVED]Bootloader issue

Nothing happens automatically.
(exit the chroot or just don't chroot), umount the partitions, run fsck, then re-mount them.

"-r" is rather pointless but ok, don't run fsck un-interactively (so no -a)

Offline

#11 2024-11-17 22:42:20

cervyesterday
Member
Registered: 2022-11-13
Posts: 88

Re: [SOLVED]Bootloader issue

Ok for the filesystem partition. For the boot one i don't know what to do. It asks me if i want to copy the original to backup or backup to original (i assume the second one). Then it asks which FAT to use the 'first' one or the 'secondo one, ehat first and second stand for? In the end it asks if I want to correct or not (and i assume that i need to correct them)

Offline

#12 2024-11-17 22:45:32

seth
Member
Registered: 2012-09-03
Posts: 59,061

Re: [SOLVED]Bootloader issue

Your guess is as good as anybody elses on that - pick one.
Since you're gonna re-install the bootloader anyway, it doesn't matter all that much.

Once you're done and can mount the partitions rw, you want to

pacman --root=/mnt -Qkk | grep -v ', 0 altered files' | grep -v backup

to see whether this entire thing has left corrupted packages behind.

Offline

#13 2024-11-17 22:57:07

cervyesterday
Member
Registered: 2022-11-13
Posts: 88

Re: [SOLVED]Bootloader issue

There'sthe output http://0x0.st/XdSE.csv
So now i need to reinstall grub?

Offline

#14 2024-11-17 22:59:39

seth
Member
Registered: 2012-09-03
Posts: 59,061

Re: [SOLVED]Bootloader issue

That looks ok and yes, arch-chroot into the system, re-install grub and also run grub-install and maybe grub-mkconfig.
Depending on the corruption of the boot partition you might also want to re-install the kernel

Offline

#15 2024-11-17 23:08:05

cervyesterday
Member
Registered: 2022-11-13
Posts: 88

Re: [SOLVED]Bootloader issue

Ok, now grub loads but it freeze saying

 initramfs unpacking failed: invalid magic at start of compressed archive

Offline

#16 2024-11-17 23:09:24

seth
Member
Registered: 2012-09-03
Posts: 59,061

Re: [SOLVED]Bootloader issue

seth wrote:

Depending on the corruption of the boot partition you might also want to re-install the kernel

as this should™ regenerate the initramfs implicitly

Offline

#17 2024-11-17 23:13:23

cervyesterday
Member
Registered: 2022-11-13
Posts: 88

Re: [SOLVED]Bootloader issue

And so do i have to run

 mkinitcpio -p linux

?

Offline

#18 2024-11-17 23:22:34

seth
Member
Registered: 2012-09-03
Posts: 59,061

Re: [SOLVED]Bootloader issue

You just have to re-install the kernel package, that will also take care of a pot. corrupted kernel image copy on the boot partition.

Offline

#19 2024-11-17 23:29:57

cervyesterday
Member
Registered: 2022-11-13
Posts: 88

Re: [SOLVED]Bootloader issue

But actually i've already reinstalled the kernel, i mean, i've reinstalled grub, run grub-install and grub-mkconfig and reinstalled the kernel. Then I reboot and the error occours.
Should i reinstall the kernel again?

Offline

#20 2024-11-17 23:37:02

seth
Member
Registered: 2012-09-03
Posts: 59,061

Re: [SOLVED]Bootloader issue

From the chroot, what's the output of

pacman -S linux
file /boot/vmlinuz-linux
file /boot/initramfs-linux.img

Offline

#21 2024-11-18 00:04:21

cervyesterday
Member
Registered: 2022-11-13
Posts: 88

Re: [SOLVED]Bootloader issue

Pacman output: http://0x0.st/XdQm.txt

/boot/vmlinuz-linux: Linux kernel x86 boot executable bzImage, version 6.11.8-arch1-2 (linux@archlinux) #1 SMP PREEMPT_DYNAMIC Fri, 15 Nov 2024 15:35:07 +0000, RO-rootFS, swap_dev 0XC, Normal VGA
/boot/initramfs-linux.img: ASCII cpio archive (SVR4 with no CRC)

Offline

#22 2024-11-18 07:16:29

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,339
Website

Re: [SOLVED]Bootloader issue

Please confirm those kernel & initramfs images were on the EFI system partition rather than the main root partition.

Does fsck(8) confirm that the FAT filesystem is now fine?

I would have just reformatted the ESP and reinstalled the kernel & bootloader, FAT is not reliable at all. You don't need to mount the ESP under /boot/ for GRUB btw, it might be more reliable to have /boot/ on the root partition instead.


Para todos todo, para nosotros nada

Offline

#23 2024-11-18 07:21:17

seth
Member
Registered: 2012-09-03
Posts: 59,061

Re: [SOLVED]Bootloader issue

Maybe we should also check where the OP is actually booting from.
Post an older journal from the chroot,

sudo journalctl -b -1 | curl -F 'file=@-' 0x0.st

should do

Offline

#24 2024-11-18 08:49:07

cervyesterday
Member
Registered: 2022-11-13
Posts: 88

Re: [SOLVED]Bootloader issue

Head_on_a_Stick wrote:

Please confirm those kernel & initramfs images were on the EFI system partition rather than the main root partition.

yes, they're both in the ESP.

Head_on_a_Stick wrote:

Does fsck(8) confirm that the FAT filesystem is now fine?

Fsck output on the esp partition

seth wrote:

Post an older journal from the chroot

Here's the output of journalctl

Last edited by cervyesterday (2024-11-18 08:49:32)

Offline

#25 2024-11-18 08:53:16

seth
Member
Registered: 2012-09-03
Posts: 59,061

Re: [SOLVED]Bootloader issue

That's not a complete journal but

Oct 18 15:07:27 archlinux kernel:     BOOT_IMAGE=/vmlinuz-linux-lts

you had been booting the LTS kernel from some boot partition.
=> Try to re-install  linux-lts, not linux

Offline

Board footer

Powered by FluxBB