You are not logged in.
Today, after I turned on my computer, it failed to boot. I was greeted with the message:
Loading Linux linux ...
Loading initial ramdisk ...
error: file '/initramfs-linux.img' not found
Press any key to continue...
Pressing any key did nothing, and the screen wouldn't change.
I booted with a live system and arch-chrooted in to look around, and I came to believe that the cause of the problem is the similar errors that occur whenever I try to update or install the packages linux and linux-firmware.
Using pacstrap yielded the same errors.
Running pacman -S linux or pacstrap /mnt linux:
==> ERROR: Unable to write to path: `/boot/initramfs-linux.img'
==> ERROR: Unable to write to path: `/boot/initramfs-linux-fallback.img'
Running pacman -S linux-firmware or pacstrap /mnt linux-firmware:
Failed to open file "/sys/devices/system/cpu/microcode/reload": Read-only file system
From my live system, I tried reformatting my boot partition and reinstalling GRUB:
mkfs.ext4 /dev/sda1
mount /dev/sda1 /mnt/boot
arch-chroot /mnt
pacman -Rns grub
pacman -S grub
grub-install /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg
No errors occurred during this process, but it didn't solve anything.
Upon rebooting, I receive now see the screen frozen with the message:
Loading Linux linux ...
If I increase the verbosity in GRUB, I end up with a Kernel panic:
https://i.imgur.com/TOTVktj.jpeg
I've looked for hours to no avail, and I have no idea how to fix this.
----
Here is the full output of pacstrap /mnt linux...
stdout:
==> Creating install root at /mnt
==> Installing packages to /mnt
:: Synchronizing package databases...
core downloading...
extra downloading...
community downloading...
resolving dependencies...
looking for conflicting packages...
Packages (1) linux-5.16.4.arch1-1
Total Installed Size: 161.08 MiB
Net Upgrade Size: 0.00 MiB
:: Proceed with installation? [Y/n]
checking keyring...
checking package integrity...
loading package files...
checking for file conflicts...
checking available disk space...
:: Processing package changes...
reinstalling linux...
:: Running post-transaction hooks...
(1/3) Arming ConditionNeedsUpdate...
(2/3) Updating module dependencies...
(3/3) Updating linux initcpios...
==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'default'
-> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img
readlink: realpath /boot/initramfs-linux.img: No such file or directory
==> ERROR: Unable to write to path: `/boot/initramfs-linux.img'
==> 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
readlink: realpath /boot/initramfs-linux-fallback.img: No such file or directory
==> ERROR: Unable to write to path: `/boot/initramfs-linux-fallback.img'
stderr:
warning: linux-5.16.4.arch1-1 is up to date -- reinstalling
error: command failed to execute correctly
...and pacstrap /mnt linux-firmware...
stdout:
==> Creating install root at /mnt
==> Installing packages to /mnt
:: Synchronizing package databases...
core downloading...
extra downloading...
community downloading...
resolving dependencies...
looking for conflicting packages...
Packages (1) linux-firmware-20220119.0c6a7b3-2
Total Installed Size: 149.48 MiB
Net Upgrade Size: 0.00 MiB
:: Proceed with installation? [Y/n]
checking keyring...
checking package integrity...
loading package files...
checking for file conflicts...
checking available disk space...
:: Processing package changes...
reinstalling linux-firmware...
:: Running post-transaction hooks...
(1/2) Creating temporary files...
Failed to open file "/sys/devices/system/cpu/microcode/reload": Read-only file system
(2/2) Arming ConditionNeedsUpdate...
stderr:
warning: linux-firmware-20220119.0c6a7b3-2 is up to date -- reinstalling
error: command failed to execute correctly
Last edited by climbTheStairs (2022-02-04 17:46:28)
Offline
The kernel error says the root FS can't be mounted…
lsblk -f
and your grub config (/boot/grub/grub.cfg)
You can paste them into ix.io
lsblk -f | curl -F 'f:1=<-' ix.io
cat /boot/grub/grub.cfg | curl -F 'f:1=<-' ix.io
Last edited by seth (2022-01-31 08:44:19)
Online
After manually mounting my partitions as they usually would be (because I can't boot at all):
Offline
# umount [/mnt]/boot
# fsck /dev/disk/by-uuid/55613467-559e-42af-b3ae-7421e021cf94
Inofficial first vice president of the Rust Evangelism Strike Force
Offline
Why is the root partition in the grub.cfg addressed as sda3 and not as " root=UUID=e7208f8b-2886-46ee-ba14-c7b6376658bc"?
Online
# umount [/mnt]/boot # fsck /dev/disk/by-uuid/55613467-559e-42af-b3ae-7421e021cf94
I got the output:
fsck from util-linux 2.37.2
e2fsck 1.46.4 (18-Aug-2021)
/dev/sda1: clean, 380/51200 files, 40766/204800 blocks
After remounting, the same error persists, whether I run pacstrap /mnt linux, pacman -S linux, or mkinitcpio -p linux.
Why is the root partition in the grub.cfg addressed as sda3 and not as " root=UUID=e7208f8b-2886-46ee-ba14-c7b6376658bc"?
That was what grub-mkconfig -o /boot/grub/grub.cfg generated.
Offline
That was what grub-mkconfig -o /boot/grub/grub.cfg generated.
grub-mkconfig --version
If that's not a dated version, I'll update the question to "Why did you uncomment GRUB_DISABLE_LINUX_UUID=true in /etc/default/grub"?
Online
I haven't edited /etc/default/grub before.
I checked and #GRUB_DISABLE_LINUX_UUID=true is still commented.
Again, I reformatted my /boot partition and tried reinstalling GRUB:
# grub-install /dev/sda
Installing for i386-pc platform.
Installation finished. No error reported.
# grub-mkconfig --version
grub-mkconfig (GRUB) 2.06
# grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER document entry.
done
This is my /boot/grub/grub.cfg.
However, if I pacstrap the linux package first, then the results are different:
# mount /dev/sda3 /mnt
# mkfs.ext4 /dev/sda1
# mount /dev/sda1 /mnt/boot
# pacstrap /mnt linux
# arch-chroot /mnt
# grub-install /dev/sda
# grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-linux
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER document entry.
done
This is my /boot/grub/grub.cfg if I grub-mkconfig after pacstrapping linux.
Last edited by climbTheStairs (2022-02-02 08:12:08)
Offline
I think the cause of my problem is with "mkinitcpio -p linux" unable to write to initramfs-linux.img, but I do not know what that means or why it is or how I can fix that.
Would it help if I tried installing a different bootloader?
Last edited by climbTheStairs (2022-02-02 05:46:20)
Offline
ls -l /mnt/boot
findmnt /boot
mount | grep boot
pacstrap is not supposed to be run from within the chroot but my guess would be that you're somehow™ operating on the /boot partition of the installation iso.
Skip pacstrap, mount /mnt and /mnt/boot, arch-chroot into mount and run "pacman -S linux": what errors do you get and then try
mkinitcpio -v -p linux
Online
ls -l /mnt/boot findmnt /boot mount | grep boot
Do I run these commands from the live system or from inside the chroot? I'm assuming the first is run outside the chroot and the last two are to be run inside?
# ls -l /mnt/boot
total 10285
drwxr-xr-x 6 root root 1024 Feb 2 08:23 grub
drwx------ 2 root root 12288 Feb 2 08:20 lost+found
-rw-r--r-- 1 root root 10518432 Feb 2 08:22 vmlinuz-linux
# arch-chroot /mnt
# findmnt /boot
TARGET SOURCE FSTYPE OPTIONS
/boot /dev/sda1 ext4 rw,relatime
# mount | grep boot
/dev/sda1 on /boot type ext4 (rw,relatime)
pacstrap is not supposed to be run from within the chroot but my guess would be that you're somehow™ operating on the /boot partition of the installation iso.
I know, I ran pacstrap outside, from the live system. Sorry if I made that unclear.
Skip pacstrap, mount /mnt and /mnt/boot, arch-chroot into mount and run "pacman -S linux": what errors do you get and then try
mkinitcpio -v -p linux
With "pacman -S linux" (full output) as well as "mkinitcpio -v -p linux" (stdout/stderr), I got the same errors as before:
==> ERROR: Unable to write to path: `/boot/initramfs-linux.img'
==> ERROR: Unable to write to path: `/boot/initramfs-linux-fallback.img'
Last edited by climbTheStairs (2022-02-02 10:13:25)
Offline
readlink: realpath /boot/initramfs-linux.img: No such file or directory
Well, I suppose that "realpath /boot/initramfs-linux.img" is not a valid directory.
Please show us
$ cat /etc/mkinitcpio.d/*
$ sha1sum /usr/share/libalpm/scripts/mkinitcpio-install
$ sha1sum /usr/share/libalpm/hooks/90-mkinitcpio-install.hook
$ sha1sum /usr/bin/mkinitcpio
Last edited by schard (2022-02-02 11:41:26)
Inofficial first vice president of the Rust Evangelism Strike Force
Offline
Deep in the back of my head there was an error where something (somethingsomething haskell??) shadowed a binary invoked by the mkinitcpio script and screwed the outcome.
bash -x /usr/bin/mkinitcpio -v -p linux | curl -F 'f:1=<-' ix.io
Online
readlink: realpath /boot/initramfs-linux.img: No such file or directory
Well, I suppose that "realpath /boot/initramfs-linux.img" is not a valid directory.
Please show us$ cat /etc/mkinitcpio.d/* $ sha1sum /usr/share/libalpm/scripts/mkinitcpio-install $ sha1sum /usr/share/libalpm/hooks/90-mkinitcpio-install.hook $ sha1sum /usr/bin/mkinitcpio
The only file in /etc/mkinitcpio.d/ is linux.preset.
And:
6a9ffec73d2db4681808d61ca4898c943f0fc7de /usr/share/libalpm/scripts/mkinitcpio-install
d7642b750767d78f128c4613b6552e624ea9d5ed /usr/share/libalpm/hooks/90-mkinitcpio-install.hook
5ae27286ee83b32d23820da383754f2007b9bb52 /usr/bin/mkinitcpio
Deep in the back of my head there was an error where something (somethingsomething haskell??) shadowed a binary invoked by the mkinitcpio script and screwed the outcome.
bash -x /usr/bin/mkinitcpio -v -p linux | curl -F 'f:1=<-' ix.io
Offline
Fails in the subprocess…
bash -x /usr/bin/mkinitcpio -v -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img
Online
$ type realpath readlink
Inofficial first vice president of the Rust Evangelism Strike Force
Offline
Fails in the subprocess…
bash -x /usr/bin/mkinitcpio -v -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img
I ran that command and now everything works normally. I really appreciate your help! Thank you all so much!!!
Offline
That's weird but please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.
Online
UPDATE:
After an update that involved installing the linux package, the same thing happened again, and this time I'm pretty sure I know the cause of this problem.
I have sbase and ubase installed in /local/bin (which is ahead of /bin in $PATH), while mkinitcpio uses features that are specific to the GNU coreutils. Temporarily uninstalling sbase and ubase before updating fixes the problem.
Last edited by climbTheStairs (2022-02-15 09:21:17)
Offline