Debian – update-initramfs hangs on debian Stretch

aptcpiodebianinitramfs

using apt-get upgrade on Debian left me with the decision to update to kernel 4.9.0-6 but the installation never finishes. It always stalls at the following stage:

Setting up linux-image-4.9.0-6-amd64 (4.9.82-1+deb9u3) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-4.9.0-6-amd64

Nothing happens after that. I do end the processes and start update-initramfs -v -u so see what happens and what not. The update-initramfs stalls at:

Building cpio /boot/initrd.img-4.9.0-6-amd64.new initramfs

Does anyone have an idea what to do? The update from jessie to stretch (some days ago) went without any problems and I do not have modified anything since then.

Best Answer

thank you for all your answers. I solved the problem by using ps faux and identified that sync does nothing/waits forever.

As i had an usb drive which somehow died and got disconnected the drive still showed up as being mounted.

I renamed /bin/sync to /bin/sync2, copied /bin/ls to /bin/sync and ran apt-get upgrade. It was successful so I renamed the files, rebooted and finally got rid of the disconnected drive.

Related Question