You are not logged in.

#1 2023-02-21 17:24:22

Registered: 2022-07-10
Posts: 8

[SOLVED] ERROR: Unable to write to path: `/boot/initramfs-linux.img'

I have run 'sudo pacman -Syyu' to update my system and got this error in one of the "post-transaction hooks":

(11/20) 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
==> 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
==> ERROR: Unable to write to path: `/boot/initramfs-linux-fallback.img'
error: command failed to execute correctly

Here is the full pacman log:

This appears to have happened to someone before and they were not able to boot their computer sad

I have the Lenovo Gaming 3 15ARH05 laptop. I'm afraid that my system won't boot after this error as it seems to have to do something with the kernel, but I don't know what happened. linux-firmware package has version 20230210.bf4115c-1. I didn't mess with any advanced system settings, I usually just install and use packages.

Should I do something to fix this? If you need additional logs I can provide them.
Thank you.

Last edited by midgard (2023-02-21 21:12:05)


#2 2023-02-21 17:27:34

Registered: 2012-09-01
Posts: 11,656

Re: [SOLVED] ERROR: Unable to write to path: `/boot/initramfs-linux.img'

is /boot writable? Not mounted read-only, not full, etc?


#3 2023-02-21 17:35:13

Registered: 2022-07-10
Posts: 8

Re: [SOLVED] ERROR: Unable to write to path: `/boot/initramfs-linux.img'


/boot is not mounted and fdisk says:

No errors detected.
Remaining 1048575 unallocated 512-byte sectors.


#4 2023-02-21 17:53:26

Registered: 2012-09-03
Posts: 52,360

Re: [SOLVED] ERROR: Unable to write to path: `/boot/initramfs-linux.img'

lsblk -f
sudo bash -x /usr/bin/mkinitcpio -v -p linux 2>&1 | curl -F 'f:1=<-'

Sidebar, please check the pacman manpage about what the second "y" actually does and then stop using it unless you really mean to.


#5 2023-02-21 18:11:01

Registered: 2022-07-10
Posts: 8

Re: [SOLVED] ERROR: Unable to write to path: `/boot/initramfs-linux.img'

@seth thanks for the response. Should I just run those commands to fix the issue?

As far as I know the second -y just forces a download of package databases, I don't see how that could cause my problem. If you have any link or can explain why this happened I would appreciate it because I want to avoid it in the future. I don't know where is this sidebar that you speak of.

Thanks again

EDIT: Sorry, just realised you were interested in the output of those commands. Here it is:

$ lsblk -f
NAME        FSTYPE FSVER LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
├─nvme0n1p1 vfat   FAT32       A433-472C                                           
├─nvme0n1p2 swap   1           e9dfd49c-389e-47db-be42-1edf4f74e7b0                [SWAP]
└─nvme0n1p3 ext4   1.0         c95ec002-890f-4959-a428-07024bad921e   86.5G    76% /

$ mount
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sys on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
dev on /dev type devtmpfs (rw,nosuid,relatime,size=7845200k,nr_inodes=1961300,mode=755,inode64)
run on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755,inode64)
efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)
/dev/nvme0n1p3 on / type ext4 (rw,relatime)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,inode64)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=34,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=25150)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)
configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)
ramfs on /run/credentials/systemd-tmpfiles-setup-dev.service type ramfs (ro,nosuid,nodev,noexec,relatime,mode=700)
systemd-1 on /boot type autofs (rw,relatime,fd=51,pgrp=1,timeout=120,minproto=5,maxproto=5,direct,pipe_ino=14634)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,nr_inodes=1048576,inode64)
ramfs on /run/credentials/systemd-tmpfiles-setup.service type ramfs (ro,nosuid,nodev,noexec,relatime,mode=700)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,nosuid,nodev,noexec,relatime)
ramfs on /run/credentials/systemd-sysctl.service type ramfs (ro,nosuid,nodev,noexec,relatime,mode=700)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=1573052k,nr_inodes=393263,mode=700,uid=1000,gid=998,inode64)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=998)

$ sudo bash -x /usr/bin/mkinitcpio -v -p linux 2>&1 | curl -F 'f:1=<-'

Last edited by midgard (2023-02-21 18:15:10)


#6 2023-02-21 18:13:52

Registered: 2012-11-10
Posts: 9

Re: [SOLVED] ERROR: Unable to write to path: `/boot/initramfs-linux.img'

Just happend to me, too with a Lenovo T460p.

Downgrading systemd to the previous version helped. At least I could successfully access on /boot and build the kernel images again:

sudo pacman -U /var/cache/pacman/pkg/systemd-252.5-1-x86_64.pkg.tar.zst /var/cache/pacman/pkg/systemd-libs-252.5-1-x86_64.pkg.tar.zst /var/cache/pacman/pkg/systemd-sysvcompat-252.5-1-x86_64.pkg.tar.zst

EDIT: And system reboot was successful, too.

EDIT: Is it related to Bug #77569?

Last edited by ritze (2023-02-21 18:39:17)


#7 2023-02-21 20:27:05

Registered: 2022-07-10
Posts: 8

Re: [SOLVED] ERROR: Unable to write to path: `/boot/initramfs-linux.img'

After running seth's commands (third one) I got a success message and my system reboots fine. Whether or not that had any effect - I'm not sure.


#8 2023-02-21 21:09:46

Registered: 2012-09-03
Posts: 52,360

Re: [SOLVED] ERROR: Unable to write to path: `/boot/initramfs-linux.img'

@ritze, #77569 is about dracut, not mkinitcpio (unlike this thread) - do you use dracut?

@midgard, the last command simply ran mkinitcpio (in verbose mode and logging the script) and the error from your OP isn't there, the initcpio should have been written fine.

For a sanity check

ls -l /boot
cat /proc/cmdline

Unfortunately we therefore can't tell what caused the original error.

Otherwise 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.
You can re-open it in case this happens w/ the next updated again.

Off topic:
1. Please use "code" tags,
2. the additional "y" will probably not have cause this specific issue, but it puts unnecessary burden on your mirror when running updates and if your mirror is out of sync or otherwise broken, you stand a chance to shred your package database this way. So don't use that unless you **really** mean to.


Board footer

Powered by FluxBB