[Cialug] reboot into a different OS w/ grub

Josh More MoreJ at alliancetechnologies.net
Mon May 3 14:19:50 CDT 2010


I believe that this is a one time only override of the the default

In short, it saves the current default, boots your other option and then removes the line.

This would help you with 1 and 2, but only if you wrote a script to check for networking and filesystem mounts (and loaded the script into your boot image), and on fail, reboot.  I do not believe that it would help with 3.



-Josh More, CISSP, GIAC-GSLC, GIAC-GCIH, RHCE, NCLP
morej at alliancetechnologies.net
515-245-7701

________________________________________
From: cialug-bounces at cialug.org [cialug-bounces at cialug.org] on behalf of Matthew Nuzum [newz at bearfruit.org]
Sent: Monday, May 03, 2010 14:17
To: Central Iowa Linux Users Group
Subject: [Cialug] reboot into a different OS w/ grub

Hi, I saw this on commandlinefu.com:
http://www.commandlinefu.com/commands/view/5509/reboot-as-a-different-os-in-grub
$ echo "savedefault --default=2 --once" | grub --batch; sudo reboot

It is a command you can run that causes your computer to boot into a
different OS, as specified by one of the options in your grub boot
menu.

There's been a few times where I've wanted this capability, but always
in the context of testing an update on a remote machine. In that case
I want the computer to reboot into a different OS after x minutes
unless I tell it not to. Or, better yet, to return to "known good
state" if the next reboot fails.

I've not tried this technique yet but here are some examples of things
I've tried to fix and not been able to:

 1. reboot into a new kernel and everything works but networking
 2. reboot into a new kernel and cannot mount the filesystem at all
 3. panic on reboot

Will the above help with the above? Can anyone explain how the command
works? (I've searched the grub manual page and can't find reference to
savedefault or --once)


--
Matthew Nuzum
newz2000 on freenode, skype, linkedin, identi.ca and twitter

"Do not seek to follow in the footsteps of the wise. Seek what they
sought." –Matsuo Bashō
_______________________________________________
Cialug mailing list
Cialug at cialug.org
http://cialug.org/mailman/listinfo/cialug


More information about the Cialug mailing list