Not logged in
Log in now
Create an account
Subscribe to LWN
LWN.net Weekly Edition for May 23, 2013
An "enum" for Python 3
An unexpected perf feature
LWN.net Weekly Edition for May 16, 2013
A look at the PyPy 2.0 release
Re: why is gurb-menu hidden as default?
Posted Feb 9, 2012 14:19 UTC (Thu) by akumria (subscriber, #7773)
How would you know that the boot into the new kernel failed?
Isn't this a halting problem?
Posted Feb 9, 2012 14:35 UTC (Thu) by pbonzini (subscriber, #60935)
Posted Feb 10, 2012 10:58 UTC (Fri) by dgm (subscriber, #49227)
Posted Feb 10, 2012 12:49 UTC (Fri) by khim (subscriber, #9252)
In fact this is how I've done it on servers ten years ago: by default GRUB will boot "rescue kernel" (which is bumped manually) and each successful boot will mark "latest and greatest" kernel as the one to boot "just one more time".
P.S. Actually I lied: I've used not "rescue kernel" but the whole separate "rescue distribution" on a separate partition. This meant that even serious screwups in the upgrade process were only able to bring server down if they somehow managed to kill grub itself (the whole machinery lived on separate partition not related to /boot in both systems).
Posted Feb 9, 2012 14:57 UTC (Thu) by vadim (guest, #35271)
Designate an area in /boot for status logging. Have it contain an indication of how far the kernel got into booting. Then once the kernel starts init, leave the rest to userspace.
Have GRUB read that. If the last logged state is in the middle of a boot, then it never completed, and GRUB does whatever is deemed appropiate, like booting the previous kernel, or a known safe kernel with a rescue initrd.
If it's possible to determine the reset time of the system, it might be even possible to distinguish between the kernel getting stuck, and the user pushing the reset button.
One bit of state would suffice (1 = was still booting, 0 = boot complete), but a bit more data would be useful for troubleshooting. Then GRUB could display the result to report to the distribution, which would have an easier time figuring out what went wrong, could provide a better FAQ, and so on.
Posted Feb 9, 2012 17:23 UTC (Thu) by cwillu (subscriber, #67268)
Posted Feb 9, 2012 18:45 UTC (Thu) by jldugger (subscriber, #57576)
Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds