You are not logged in.

#1 2021-01-12 21:23:48

alfalfa
Member
Registered: 2017-06-30
Posts: 63
Website

[SOLVED] Failed update led to dirty grub, no initramfs for linux-lts

So the computer crashed during an update, then it wouldn't boot as there was no more initramfs-*.img.
I chrooted into the root disk and tried a bunch of things without avails (fsck, pacman -Syyu, mkinitcpio, reinstalled kernels, reinstalled grub, cleaned pacman cache and reinstalled all packages ...). I ended up realizing the thumb drive was MBR and the target bootloader EFI. So after booting in UEFI, I could reinstall grub again and got it working somehow.

Long story short, now I can only boot with the Arch kernel, as there is still no initramfs-linux-lts.img in /boot. Reinstalling linux-lts has no effects, and "mkinitcpio -v -p linux-lts" returns no output. bootlctl output also seems odd.

Lastly, there is a bunch of entries in grub and only the latest is bootable (Arch Linux, with Linux linux);

Arch Linux
Advanced options for Arch Linux
- Arch Linux, with Linux linux-lts
- Arch Linux, with Linux linux

bootctl

systemd-boot not installed in ESP.
System:
     Firmware: n/a (n/a)
  Secure Boot: disabled
   Setup Mode: user
 Boot into FW: supported

Current Boot Loader:
      Product: n/a
     Features: ✗ Boot counting
               ✗ Menu timeout control
               ✗ One-shot menu timeout control
               ✗ Default entry control
               ✗ One-shot entry control
               ✗ Support for XBOOTLDR partition
               ✗ Support for passing random seed to OS
               ✗ Boot loader sets ESP partition information
          ESP: n/a
         File: └─n/a

Random Seed:
 Passed to OS: no
 System Token: not set
lines 1-23...skipping...
systemd-boot not installed in ESP.
System:
     Firmware: n/a (n/a)
  Secure Boot: disabled
   Setup Mode: user
 Boot into FW: supported

Current Boot Loader:
      Product: n/a
     Features: ✗ Boot counting
               ✗ Menu timeout control
               ✗ One-shot menu timeout control
               ✗ Default entry control
               ✗ One-shot entry control
               ✗ Support for XBOOTLDR partition
               ✗ Support for passing random seed to OS
               ✗ Boot loader sets ESP partition information
          ESP: n/a
         File: └─n/a

Random Seed:
 Passed to OS: no
 System Token: not set
       Exists: no

Available Boot Loaders on ESP:
          ESP: /boot (/dev/disk/by-partuuid/2f5ba057-db69-43a5-8068-1771f32af53d)
         File: └─/EFI/BOOT/BOOTX64.efi

Boot Loaders Listed in EFI Variables:
        Title: GRUB
           ID: 0x0014
       Status: active, boot-order
    Partition: /dev/disk/by-partuuid/2f5ba057-db69-43a5-8068-1771f32af53d
         File: └─/EFI/GRUB/grubx64.efi

        Title: Windows Boot Manager
           ID: 0x0013
       Status: inactive, boot-order
    Partition: /dev/disk/by-partuuid/f1985a5a-c6f1-43da-aabe-b0d7e2e2f7fc
         File: └─/EFI/Microsoft/Boot/bootmgfw.efi

Boot Loader Entries:
        $BOOT: /boot (/dev/disk/by-partuuid/2f5ba057-db69-43a5-8068-1771f32af53d)

0 entries, no entry could be determined as default.

efibootmgr (it was dualboot years ago)

BootCurrent: 0014
Timeout: 2 seconds
BootOrder: 0014,0013,0007,0008,0009,000B,000C,000A,000D,0012
Boot0000  Setup
Boot0001  Boot Menu
Boot0002  Diagnostic Splash Screen
Boot0003  Lenovo Diagnostics
Boot0004  Startup Interrupt Menu
Boot0005  Rescue and Recovery
Boot0006  MEBx Hot Key
Boot0007* USB CD
Boot0008* USB FDD
Boot0009  ATA HDD0
Boot000A* ATA HDD1
Boot000B  ATA HDD2
Boot000C* USB HDD
Boot000D  PCI LAN
Boot000E* IDER BOOT CDROM
Boot000F* IDER BOOT Floppy
Boot0010* ATA HDD
Boot0011* ATAPI CD
Boot0012* PCI LAN
Boot0013  Windows Boot Manager
Boot0014* GRUB

/etc/mkinitcpio.conf

MODULES=()
BINARIES=()
FILES=()
HOOKS=(base udev autodetect modconf block filesystems keyboard fsck)

file /bin/mkinitcpio

/bin/mkinitcpio: Bourne-Again shell script, UTF-8 Unicode text executable

Last edited by alfalfa (2021-01-13 03:12:18)

Offline

#2 2021-01-12 21:33:10

loqs
Member
Registered: 2014-03-06
Posts: 19,025

Re: [SOLVED] Failed update led to dirty grub, no initramfs for linux-lts

Does /etc/mkinitcpio.d/linux-lts.conf exist but is an empty file?

Last edited by loqs (2021-01-12 21:33:27)

Offline

#3 2021-01-12 23:01:24

alfalfa
Member
Registered: 2017-06-30
Posts: 63
Website

Re: [SOLVED] Failed update led to dirty grub, no initramfs for linux-lts

loqs wrote:

Does /etc/mkinitcpio.d/linux-lts.conf exist but is an empty file?

cat: /etc/mkinitcpio.d/linux-lts.conf: No such file or directory

linux-lts.preset was also missing from /etc/mkinitcpio.d. It could be regenerated with;
# mkinitcpio -P

but still, no image is generated with;
# mkinitcpio -p linux-lts

Last edited by alfalfa (2021-01-13 00:20:14)

Offline

#4 2021-01-13 02:29:31

loqs
Member
Registered: 2014-03-06
Posts: 19,025

Re: [SOLVED] Failed update led to dirty grub, no initramfs for linux-lts

What is the contents of /etc/mkinitcpio.d/linux-lts.preset?

Offline

#5 2021-01-13 02:55:22

alfalfa
Member
Registered: 2017-06-30
Posts: 63
Website

Re: [SOLVED] Failed update led to dirty grub, no initramfs for linux-lts

Both are empty

# ls -s /etc/mkinitcpio.d

total 0
0 linux-lts.preset  0 linux.preset

Last edited by alfalfa (2021-01-13 02:56:01)

Offline

#6 2021-01-13 02:59:53

loqs
Member
Registered: 2014-03-06
Posts: 19,025

Re: [SOLVED] Failed update led to dirty grub, no initramfs for linux-lts

# rm /etc/mkinitcpio.d/linux-lts.preset

Then try reinstalling the linux-lts package.

Offline

#7 2021-01-13 03:10:47

alfalfa
Member
Registered: 2017-06-30
Posts: 63
Website

Re: [SOLVED] Failed update led to dirty grub, no initramfs for linux-lts

Thanks, that was it. So I found this post and copied the default content for each preset;

/etc/mkinitcpio.d/linux.preset

# mkinitcpio preset file for the 'linux' package

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

PRESETS=('default' 'fallback')

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

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

/etc/mkinitcpio.d/linux-lts.preset

# 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"

Then all is well

mkinitcpio -p linux
mkinitcpio -p linux-lts

Offline

Board footer

Powered by FluxBB