(EFI Boot) kernel cmdline for next boot only?

sbellon

Member
Oct 12, 2021
26
4
8
48
Hi all,

I realize that recently there was the introduction of pve-efiboot-tool kernel pin XXX --next-boot to only have the kernel being used for the next boot, so that in case something does not work, the boot afterwards will revert to the currently used kernel.

Now I wonder whether a similar approach also exists for kernel parameters in /etc/kernel/cmdline? And if not, whether this wouldn't be a good improvement, so that one could try out kernel cmdline parameters without the fear of bricking the host.

Greetings,
sbellon
 
no, that does not exist. note that you can just temporarily override the commandline in the bootloader menu (for Grub and systemd-boot just press 'e' on the boot entry)
 
You cannot do that for a unit running in headless mode without keyboard or monitor however. ;-)

Edit: In fact, I want to add console=ttySX console=tty0 parameters, so that I can use a serial console in case something goes wrong. But by doing so, I do not want to mess up by making a typo or in a way that booting may block if I select the wrong serial device, etc.
 
Last edited:
in that case you can manually add or modify a non-default additional entry that is temporarily pinned for the next boot, or use IPMI, or take your chances and if it fails, attach a monitor ;) the commandline is contained in the generated bootloader config, neither of them offer a builtin mechanism for overrides inside entries that are cleared after a single (failed or successful) boot, and implementing one ourselves for such a niche feature that we have to maintain long-term is too much work for too little gain.
 
While I understood everything else (and also agree with the "too much work for too little gain" conclusion), I did not understand the very first part:
in that case you can manually add or modify a non-default additional entry that is temporarily pinned for the next boot
 
depending on whether you are using grub or systemd-boot, you can copy the existing boot loader entry, adapt the kernel command line, and then pin that entry for a one-time boot.
 
I'm using systemd-boot ... how would I do that? That sounds exactly like what I'm looking for. :)
 
in that case, I think mounting the ESP of the disk you are booting, copying the loader entry config (in loader/entries/proxmox-*.conf), editing the copy (title and options) and then doing
Code:
$ systemctl --boot-loader-entry help
< list of entries >
$ systemctl --boot-loader-entry ENTRY

should do the trick - but I'd recommend testing it in a VM first ;) just be careful to not make your edited copy the default altogether (it picks the "highest" proxmox-* one).
 
  • Like
Reactions: sbellon

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!