Had an idea after borking my system with "sudo reboot -h 15" non existing command

Now i know that this command with such switches doesn’t exist.

So i was updating the system as usual and all going well, and thought to put snaps updating while the “regular” packages was already installing in the background but then something came up and had to leave house.

Then i thought why not let the update process go on and make the system reboot after 15 mins so all would be ready as i return.

The new kernel version didnt get to install yet as i was giving this command THAT DOES NOT EXIST (sudo reboot -h 15) silly me; i thought it would work the same as sudo shutdown -h 15.

But no: now all of my system is borked and all i can get is grub with none of the additional fallbacks etc. dysfunctional. Starting the computer brings only “error: boot/vmlinuz-6.6-x86_64 not found” and then the graphical GRUB. By the way, is it possible to install a kernel through that non graphical simple grub>_ ? And what to possible command there to rescue things?

In other words i have no kernel and have no desire to repair everything with live mode etc.

This same tragedy would have happened also in the case of electricity suddenly going out during this type of updating i did.

So i got the idea to maybe turn this into future benefit for other similar ignorants such as me for a feature request: could there be some kind of minimal backup mechanism so at least the kernel and minimal needed stuff would survive? So one could complete the updates with TTY without graphical interface or similar?

Or if just an accindental reboot was about to happen: could the system some how notice or sniff the acute danger (as the kernel updates and snap updates are going on currently) - to at least indicate what would happen if commencing reboot right there and then? THen a simple Y / N would be offered?

just :

1 Like

You are never forced to sync the system - you do it when it is convenient - and you have the time to supervise the process.

Leaving a system in the middle of an important operation is next to s…

The system is not designed to hold you hands and prevent every possibly inappropriate action - no systems can do that.

Linux do not prevent users from doing stupid things as it would also prevent them from doing something clever.

3 Likes

The update process is something low level, so i guess you are barking at the wrong tree. Pretty sure the concept of first delete and then write (and thus leaving a timeslot in which the system is vulnerable for a power faliure) comes from arch/ALPM and not from manjaro.
I guess it was made for simplicity at some point in the past. Nowadays is definitely suboptimal, esp. after arch based distros gained popularity so that are used by less tech prone users.
I can imagine it will probably never be rewritten, if it requires too much time or if the cost is backward compatibility. And since more and more users are using laptops the need for such a backup mechanism to cover for power faliures is diminishing.

For everything else, like forecefully rebooting while update is running, well, it is problem of the user if he is doing stupid things.

1 Like
$ pacman -Qi timeshift-autosnap-manjaro | grep Description
Description     : Timeshift auto-snapshot script which runs before package upgrade using Pacman hook.

Install it.

1 Like

Timeshift! Yes now i remember I have heard about this from Linux Mint. Thank you very much i need to start installing it on my systems though i don’t think i’ll make the exact same mistake again described above :smile:

2 Likes

usb stick → chroot → run update again

probably things can get solved by this.

1 Like

Yes, i’m sure it would but i just installed again after moving some important stuff to other drive. I was wondering, again as this could have happened if electricity went out: should the Timeshift be offered during the first boot of installed Manjaro by default…

sudo and -h is not needed. To shutdown system with a 15 minute delay:

$ shutdown +15
Shutdown scheduled for Sun 2024-03-17 17:46:59 GMT, use 'shutdown -c' to cancel.

But for updating packages, it would be better to inhibit system sleeping, shutdown and idle :

systemd-inhibit pamac update --no-aur

Or build pacman-systemd-inhibit from AUR

For more immunity from PEBCAK issues, disable power button and laptop lock-switch so they cannot be used to shutdown system, and learn how to reboot/shutdown a system safely
[HowTo] reboot / turn off your frozen computer: REISUB/REISUO

If mains power is not reliable for updating a desktop system, get an Uninterruptible Power Supply

3 Likes