Jump to content

grub-reboot / select next reboot OS [solved]


Guest cerien.jean
 Share

Recommended Posts

Guest cerien.jean

Hello

 

I am running a multi os (xp & mandriva 2008.1) system - default os with grub is Mandriva - occasionnally, I need to connect remotely via ssh, reboot windows, and then, at the next reboot, to use mandriva again.

 

I can achieve this thorugh the KDE interface / shutdown and select the OS to reboot - but I want to do it remotely, via the command line - i've done some research, and grub-reboot seems to do that - but it is not installed, not available from the installer, and could find where to download it...

 

so...

do i need grub-reboot ? if yes, where can i get it ? if no, how can i do this ?

 

many thanks,

 

j.

Edited by cerien.jean
Link to comment
Share on other sites

Simply edit the file /boot/grub/menu.lst and change the line that says 'default 0' to the preferred boot entry.

0 refers to the first OS configured, 1 to the second, and so on.

 

That's not what he means. He doesn't want to permanently change the default option to reboot. He wants to use the command line to reboot the machine and choose the OS, for example:

 

grub-reboot 1

 

would reboot the second option in the grub menu.lst or grub.conf file. Sadly, I don't know what package Mandriva has for this. Suse has package grub-gfxboot - see if this exists in Mandriva and install this, and then you should be able to use grub-reboot. If not, we'll need to find a way of getting it installed.

 

If we can't get it installed, then the only option is to use the KDE menu to shut down and reboot to the OS of your choice like you already do.

Link to comment
Share on other sites

Ok, I have found the Mandriva 2008.1 package 'bootloader-utils', which contains the command '/usr/sbin/rebootin' that seems to do what Jean is looking for. I haven't tried it but the man-page says:

 

rebootin(8)													 Mandriva Linux													rebootin(8)

NAME
   rebootin - Reboots the machine using a particular Boot Loader entry

SYNOPSIS
   rebootin [OPTIONS] <label>

DESCRIPTION
   rebootin  reboots  the  machine  it  is  launched  on. While with a simple reboot you need to manually select the boot entry to use at
   startup, rebootin allows to specify the boot entry on the command line.

   <label> is the name of the entry as named in the boot loader configuration file.

   rebootin currently works with LILO and Grub.

   Running rebootin without any argument displays the list of available boot entries as supported by the current boot loader.

OPTIONS
   -f	 Create a /fastboot file to reboot in fastboot mode (eg: no fsck(8)).

   -n	 Don't reboot immediately just set the flags for next reboot.

FILES
   /etc/lilo.conf /boot/grub/menu.lst
   The rebootin executable (perl script)

SEE ALSO
   grub(8), lilo(8), fsck(8)

AUTHORS
   Pascal Rigaux, Mandriva
   pixel@mandriva.com

   Chmouel Boudjnah, Mandriva

Mandriva														 03 Mar 2001													  rebootin(8)

Link to comment
Share on other sites

Guest cerien.jean
Ok, I have found the Mandriva 2008.1 package 'bootloader-utils', which contains the command '/usr/sbin/rebootin' that seems to do what Jean is looking for. I haven't tried it but the man-page says:

 

that really looks like what I need - my box is not responding now - and I am far away - but I sohuld be able to try that and let you know today !

 

many thanks in any case for your help,

 

jean

Edited by cerien.jean
Link to comment
Share on other sites

rebootin certainly looks a lot more user-friendly in that if you don't type any parameters it at least lists the boot options for you. Something that grub-reboot doesn't do.

Link to comment
Share on other sites

I do not know "rebootin" at all, so I can't comment about its value, but it's not difficult at all to write a simple script which will backup your previous grub config, alter the current one to your needs and reboot the remote machine. I guess this is an easy task for anyone, but if interested, just pass me your /boot/grub/menu.lst (not 100% necessary, as the only thing that needs to be altered is a single digit, but better to be safe than sorry...).

Link to comment
Share on other sites

Guest cerien.jean

rebootin works just fine, I could verify that - tux99, many thanks for this answer !!!!

 

as a matter of fact, it appears that it is a plain script that calls grub and issues the following command:

savedefault --default=<entreynumber> --once

 

Note the --once !

 

Also, googling grub & once, I found that:

 

[root@localhost ~]# echo "savedefault --default=2 --once" | grub --batch
[root@localhost ~]# reboot

 

the later can be useful if you dont have rebootin installed !

 

J.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...