On 26.08.2009 04:44, David C. Rankin wrote:
Listmates,
How do I choose which grub entry will boot the next time the machine is rebooted from the command line? In suse there is a package called 'grubonce' which you issue from the command line giving the grub entry you want to boot next. Example, if your menu.lst looks like:
# (0) Arch Linux - The Ferarri of Distros title Arch Linux on SuperSFF root (hd0,7) kernel /boot/vmlinuz26 root=/dev/sda6 ro vga=0x317 initrd /boot/kernel26.img
# (1) Arch Linux title Arch Linux Fallback root (hd0,7) kernel /boot/vmlinuz26 root=/dev/sda6 ro initrd /boot/kernel26-fallback.img
# (2) Arch Linux LTS title Arch Linux LTS on SuperSFF root (hd0,7) kernel /boot/vmlinuz26-lts root=/dev/sda6 ro vga=0x31a initrd /boot/kernel26-lts.img
I could issue:
# grubonce 2
and Arch Linux LTS would be booted next. I thought the grubonce package was part of grub, but it isn't. Also, I don't need it for a local machine (obviously), but I need something I can use via ssh. What do we use here?
There are multiple ways: You can put "default 2" at the very top of your menu.lst which will always select the 2nd entry (0-based) by default. Another and maybe more modern way to do it is to add "default saved" at the top and then add "savedefault" below each individual entry. This way, Grub will always select the last selected entry.