You are not logged in.

#1 2022-11-18 20:06:55

mcloaked
Member
From: Yorkshire, UK
Registered: 2012-02-02
Posts: 1,360

[SOLVEDBoot problem after replacing HD with new ssd using systemd-boot

After a laptop (Lenovo Ideapad) had a failing hard drive, I replaced the bad drive with a new Samsung 870 EVO drive. Then installed arch from scratch on the new ssd drive (the only drive in the system), following the standard arch install guide.  After completing the install, including setting up the necessary boot loader entries as they were on the system using the old drive, then booting to the new system failed to boot. sd boot with its menu of options to boot including the default Arch Linux entry was displayed on the screen, but as soon as that entry was selected and the boot initiated, it failed, and the console messages were:

Error preparing initrd: Device error
Failed to start image affs_x64.efi: Load error

Then seems to be trying all the other efi driver files bfs, btrfs etc with the analogous line to the affs_x64.efi one above.

After a great deal of looking at every config it was discovered that the kernel would not boot with the zst compressed initramfs file, but if the initrd was decompressed with:

cd /boot
mv initramfs-linux.img initramfs-linux.img.ORIG
zstd -d <  initramfs-linux.img.ORIG > initramfs-linux.img

Then the system did boot fine.

The loader entries were checked, and the bootctl list output looked sane once it booted.

The loader files were also checked for correct UUID for the root specification, and the package efifs was installed so that the file drivers were copied to the directory

# ls /efi/EFI/systemd/drivers
affs_x64.efi   exfat_x64.efi  hfsplus_x64.efi  jfs_x64.efi     reiserfs_x64.efi  ufs2_x64.efi
bfs_x64.efi    ext2_x64.efi   hfs_x64.efi      nilfs2_x64.efi  sfs_x64.efi       xfs_x64.efi
btrfs_x64.efi  f2fs_x64.efi   iso9660_x64.efi  ntfs_x64.efi    udf_x64.efi       zfs_x64.efi

So I am completely puzzled by the arch kernel not booting when the normal kernel install generates the standard initramfs with zstd compression, but simply decompressing the file allows systemd-boot to work fine!

$ sudo file /boot/initr*
/boot/initramfs-linux-fallback.img: Zstandard compressed data (v0.8+), Dictionary ID: None
/boot/initramfs-linux.img:          Zstandard compressed data (v0.8+), Dictionary ID: None

Won't boot.

But with:

# file initr*
initramfs-linux-fallback.img: Zstandard compressed data (v0.8+), Dictionary ID: None
initramfs-linux.img:          ASCII cpio archive (SVR4 with no CRC)

Then the normal linux boots but the fallback fails as did the normal boot when the initramfs was zstd compressed.

I suppose the question is, with the old original disk before it failed, the system booted the arch kernel just fine, with the default zstd compressed initramfs generated by initcpio with the systemd-boot Boot Manager, but once the drive was changed, is there something else that needs to be changed so that the system properly recognises the new drive so that it will boot with the zstd compressed initramfs.

Any information that could help me diagnose what is needed to get the system booting with the standard arch kernel would be very much appreciated.

Edit: the nvram looks normal in the output of efibootmgr:

# efibootmgr
BootCurrent: 0001
Timeout: 0 seconds
BootOrder: 0001,0000,2003,2001,2002
Boot0000* EFI HDD Device (Samsung SSD 870 EVO 1TB)      PciRoot(0x0)/Pci(0x1f,0x2)/Sata(5,0,0)/HD(1,GPT,1ff17b34-869b-48b0-8e84-c2d1f4a9b133,0x800,0xfa000)RC
Boot0001* Linux Boot Manager    HD(1,GPT,1ff17b34-869b-48b0-8e84-c2d1f4a9b133,0x800,0xfa000)/File(\EFI\systemd\systemd-bootx64.efi)
Boot0002* EFI Network 0 for IPv4 (28-D2-44-32-4D-85)    PciRoot(0x0)/Pci(0x1c,0x0)/Pci(0x0,0x0)/MAC(28d244324d85,0)/IPv4(0.0.0.00.0.0.0,0,0)RC
Boot0003* EFI Network 0 for IPv6 (28-D2-44-32-4D-85)    PciRoot(0x0)/Pci(0x1c,0x0)/Pci(0x0,0x0)/MAC(28d244324d85,0)/IPv6([::]:<->[::]:,0,0)RC
Boot2001* EFI USB Device        RC
Boot2002* EFI DVD/CDROM RC
Boot2003* EFI Network   RC

Last edited by mcloaked (2022-11-18 21:07:46)


Mike C

Offline

#2 2022-11-18 21:10:06

mcloaked
Member
From: Yorkshire, UK
Registered: 2012-02-02
Posts: 1,360

Re: [SOLVEDBoot problem after replacing HD with new ssd using systemd-boot

A short time ago there was an update to the arch kernel:

[2022-11-18T20:54:56+0000] [ALPM] upgraded linux (6.0.8.arch1-1 -> 6.0.9.arch1-1)

This kernel boots without any problem with no change to files, with the same systemd-boot Boot Manager. So I am perplexed what the issue was but clearly there was a problem somewhere in the 6.0.8 arch kernel at least on this machine. However with the latest kernel all the issues have vanished, and it boots fine, so I am closing this thread.


Mike C

Offline

Board footer

Powered by FluxBB