You are not logged in.

#1 2022-01-03 11:30:49

mrbear
Member
Registered: 2020-04-09
Posts: 38

Grub stuck in Loading Initial ramdisk

I was updating linux-lts when I lost electricity, now every time I try to boot my computer, grub gets stuck in the "Loading initial ramdisk". I have reinstalled linux-lts from scratch, but the problem still persists. I'm not sure how I can fix it, any help would be appreciated.

Offline

#2 2022-01-03 11:36:16

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,679
Website

Re: Grub stuck in Loading Initial ramdisk

mrbear wrote:

I have reinstalled linux-lts from scratch

Please post the exact, full list of commands you used. Was the initramfs regenerated successfully?

Is this with an NVIDIA graphics card? There have been lots of threads about those recently so this might be a graphics problem. If so then try booting with the systemd.unit=multi-user.target kernel parameter to get to a TTY (console) screen.

Last edited by Head_on_a_Stick (2022-01-03 11:44:23)

Offline

#3 2022-01-03 11:50:15

mrbear
Member
Registered: 2020-04-09
Posts: 38

Re: Grub stuck in Loading Initial ramdisk

I first performed a full system update using:

pacman --sync --sysupgrade --refresh

That's when I lost electricity and when the problem first appeared. I managed to reboot normally using the fallback option. Then, I tried to reinstall linux-lts from scratch to solve the problem:

pacman --sync linux-lts

But the problem still persists.

Offline

#4 2022-01-03 12:22:31

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,679
Website

Re: Grub stuck in Loading Initial ramdisk

Have you tried fsck(8)?

I would run the entire upgrade again at the same time as re-installing the kernel package:

# pacman -Syu linux-lts

And once more:

I wrote:

Was the initramfs regenerated successfully?

Offline

#5 2022-01-03 13:28:15

mrbear
Member
Registered: 2020-04-09
Posts: 38

Re: Grub stuck in Loading Initial ramdisk

May you help me to utilize fsck? I never used it before.

I ran the command to install linux-lts again. This was the output:

warning: linux-lts-5.10.89-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) linux-lts-5.10.89-1

Total Installed Size:  79.65 MiB
Net Upgrade Size:       0.00 MiB

:: Proceed with installation? [Y/n] Y
(1/1) checking keys in keyring                                                                  [########################################################] 100%
(1/1) checking package integrity                                                                [########################################################] 100%
(1/1) loading package files                                                                     [########################################################] 100%
(1/1) checking for file conflicts                                                               [########################################################] 100%
(1/1) checking available disk space                                                             [########################################################] 100%
:: Processing package changes...
(1/1) reinstalling linux-lts                                                                    [########################################################] 100%
:: Running post-transaction hooks...
(1/4) Arming ConditionNeedsUpdate...
(2/4) Updating module dependencies...
(3/4) Updating linux initcpios...
==> WARNING: Preset file `/etc/mkinitcpio.d/linux-lts.preset' is empty or does not contain any presets.
(4/4) Update Nvidia module in initcpio
==> WARNING: Preset file `/etc/mkinitcpio.d/linux-lts.preset' is empty or does not contain any presets.
==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'default'
  -> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img
==> Starting build: 5.15.12-arch1-1
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [autodetect]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
  -> Running build hook: [encrypt]
==> WARNING: Possibly missing firmware for module: qat_4xxx
  -> Running build hook: [filesystems]
  -> Running build hook: [keyboard]
  -> Running build hook: [fsck]
Decompress:  1/182 files. Current: ...2-pclmul.ko.zst : 0 B...    ==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-linux.img
==> Image generation successful
==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'fallback'
  -> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-fallback.img -S autodetect
==> Starting build: 5.15.12-arch1-1
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
  -> Running build hook: [encrypt]
==> WARNING: Possibly missing firmware for module: qat_4xxx
  -> Running build hook: [filesystems]
  -> Running build hook: [keyboard]
  -> Running build hook: [fsck]
Decompress: 684/757 files. Current: .../aacraid.ko.zst : 0 B...    ==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-linux-fallback.img
==> Image generation successful

Unfortunately no luck. I'm glad I can fallback to the linux kernel while the lts version is not working though xD.

Last edited by mrbear (2022-01-03 13:57:17)

Offline

#6 2022-01-03 15:38:08

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,679
Website

Re: Grub stuck in Loading Initial ramdisk

mrbear wrote:

May you help me to utilize fsck?

Read the manpage, a link to which I provided in my last post wink

Pro tip: always read the man page and never run commands for which you do not understand the consequences. I may have 6,000 odd posts here but I also have somewhat of a reputation as a twat so I really wouldn't trust me blindly anyway big_smile

mrbear wrote:
==> WARNING: Preset file `/etc/mkinitcpio.d/linux-lts.preset' is empty or does not contain any presets.
(4/4) Update Nvidia module in initcpio
==> WARNING: Preset file `/etc/mkinitcpio.d/linux-lts.preset' is empty or does not contain any presets.

So the linux-lts initramfs does not build at all because there is no functional preset. I'm guessing the file is there but it is either empty or corrupted.

I think you can generate a new one by deleting /etc/mkinitcpio.d/linux-lts.preset and re-installing the linux-lts package.

If that doesn't work copy over /usr/share/mkinitcpio/hook.preset and edit the file:

sed "s|%PKGBASE%|linux-lts|g" /usr/share/mkinitcpio/hook.preset | install -Dm644 /dev/stdin /etc/mkinitcpio.d/linux-lts.preset

Offline

#7 2022-01-05 12:46:36

mrbear
Member
Registered: 2020-04-09
Posts: 38

Re: Grub stuck in Loading Initial ramdisk

Sorry for taking so long to reply back. None of those worked. The file was really empty, so I deleted it and generated a new one by re-installing linux-lts. I also tried

sed "s|%PKGBASE%|linux-lts|g" /usr/share/mkinitcpio/hook.preset | install -Dm644 /dev/stdin /etc/mkinitcpio.d/linux-lts.preset

Is it ok to just reboot the computer, or do I need to power off and on after making the changes?

Offline

#8 2022-01-05 14:02:22

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,679
Website

Re: Grub stuck in Loading Initial ramdisk

mrbear wrote:

None of those worked.

What does that mean, exactly? Do you now have a working preset file? Is the initramfs generated successfully after reinstalling the linux-lts package? If not did you try generating it manually? Use the method described in the installation guide to do that.

Did you try fsck(8)? If so then please share the exact command you tried along with any output in full.

mrbear wrote:

Is it ok to just reboot the computer, or do I need to power off and on after making the changes?

Just rebooting is fine but nothing will work unless a new initramfs has been generated from the linux-lts kernel. If the filesystem is damaged then generating a working initramfs might not fix things.

Offline

#9 2022-01-06 11:32:04

mrbear
Member
Registered: 2020-04-09
Posts: 38

Re: Grub stuck in Loading Initial ramdisk

Sorry, I should have been more clear.

The file was generated and contains the following:

# mkinitcpio preset file for the 'linux-lts' package

ALL_config="/etc/mkinitcpio.conf"
ALL_kver="/boot/vmlinuz-linux-lts"

PRESETS=('default' 'fallback')

#default_config="/etc/mkinitcpio.conf"
default_image="/boot/initramfs-linux-lts.img"
#default_options=""

#fallback_config="/etc/mkinitcpio.conf"
fallback_image="/boot/initramfs-linux-lts-fallback.img"
fallback_options="-S autodetect"

But yet, the issue persists: grub gets stuck in the loading initial ramdisk phase.

I also tried the command:

sed "s|%PKGBASE%|linux-lts|g" /usr/share/mkinitcpio/hook.preset | install -Dm644 /dev/stdin /etc/mkinitcpio.d/linux-lts.preset

Same result.

I haven't tried fsck yet, will do it later today.

If the fs was damaged, would I be able to boot using the last version of linux (instead of linux-lts)?

Offline

#10 2022-01-06 11:38:25

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,679
Website

Re: Grub stuck in Loading Initial ramdisk

So does the linux-lts initramfs image actually generate successfully now?

mrbear wrote:

If the fs was damaged, would I be able to boot using the last version of linux (instead of linux-lts)?

Try it and see.

Offline

#11 2022-01-13 14:04:52

mrbear
Member
Registered: 2020-04-09
Posts: 38

Re: Grub stuck in Loading Initial ramdisk

According to fsck the fs is not damaged.

Gnome sometimes complains about the /boot having 0 bytes of memory available. Do you think this could be an issue?

Now I can only boot using the fallback initramfs - if I try to use linux (not lts), the boot gets stuck with: initramfs unpacking failed: read error

Last edited by mrbear (2022-01-13 14:10:25)

Offline

#12 2022-01-14 18:55:21

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,679
Website

Re: Grub stuck in Loading Initial ramdisk

mrbear wrote:

According to fsck the fs is not damaged.

Please post the actual command you used along with the full output.

mrbear wrote:

Gnome sometimes complains about the /boot having 0 bytes of memory available.

Please post the output of

df -h

I suppose we should also check the configuration:

grep -v '^$\|^#' /etc/mkinitcpio.conf

And also post in full:

# pacman -S linux-lts

Offline

Board footer

Powered by FluxBB