FS#69585 - [mkinitcpio] initramfs is deleted during the update and not backed up

Attached to Project: Arch Linux
Opened by Daniel Vogt (c0d3d3v) - Monday, 08 February 2021, 12:32 GMT
Last edited by Toolybird (Toolybird) - Saturday, 05 August 2023, 21:57 GMT
Task Type Feature Request
Category Arch Projects
Status Closed
Assigned To Giancarlo Razzolini (grazzolini)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:

The mkinitcpio-remove script is executed at the beginning of the updates. After the script is executed, there is no initrmd left on the system. If the update process crashes unexpectedly, for whatever reason, the system is left without initrmd (initrmfs-linux.img) and can no longer boot. This has put me in a situation where I no longer have access to my VPS server because it cannot boot without initrmd and I have no way to boot a live system. By the way, it happened to me also on local systems that there was no initrmd after updates (with errors or crashes), but that could be repaired with a live system.

I plead that it should be standard to have a backup of initrmd in the boot directory at any time during an update.



Steps to reproduce:
Let pacman crash after the script was run, so that there is no initrmfs-linux.img and initrmfs-linux-fallback.img in the boot directory.
This task depends upon

Closed by  Toolybird (Toolybird)
Saturday, 05 August 2023, 21:57 GMT
Reason for closing:  Duplicate
Additional comments about closing:   FS#64871 
Comment by Doug Newgard (Scimmia) - Monday, 08 February 2021, 12:45 GMT
If pacman crashes, you need to redo/finish the update before doing anything else anyway. This should never cause any issues.
Comment by Daniel Vogt (c0d3d3v) - Monday, 08 February 2021, 13:01 GMT
Imagine the whole system crashes. This may be an unusual situation, but it would save any administrator time to have a backup of the initrmfs.

I also don't understand why these files are deleted at all, mkinitcpio creates the new initrmfs in a different place anyway and overwrites the old initrmfs only after completion.
Comment by Doug Newgard (Scimmia) - Monday, 08 February 2021, 13:04 GMT
If the whole system crashes, you're pretty well screwed anyway. If the kernel was updated, the modules are gone. The kernel image itself may be gone. If libraries are updated, things are likely now inconsistent with what programs are using. The filesystem itself will be inconsistent, with things partially written, or not written at all and empty.
Comment by Daniel Vogt (c0d3d3v) - Monday, 08 February 2021, 13:30 GMT
You mean, if the system is dying, you'd better shoot it straight in the head?

By the way, vmlinuz-linux and intel-ucode.img are not deleted (as far as I know), but exchanged inplace. On my VPS these are also still present.

Don't you think the system would have more chance to survive with initramfs than without?
I know here is often represented the mentality systems do not make mistakes only people. But such a backup does not harm the system either.
Comment by Doug Newgard (Scimmia) - Monday, 08 February 2021, 13:42 GMT
I'm saying that the chances of it booting with that initramfs are extremely small anyway.
Comment by Giancarlo Razzolini (grazzolini) - Monday, 08 February 2021, 14:07 GMT
The kernel is also deleted. The main problem stems from the fact that mkinicpio-remove is pretransaction, and if there's anything that prevents the transaction to be finished, it won't restore things to their previous state.

Loading...