Results 1 to 7 of 7

Thread: Remotely reboot to a given kernel

  1. #1
    Join Date
    Mar 2008
    Location
    San Diego (California)
    Posts
    475

    Default Remotely reboot to a given kernel

    I would like to remotely reboot a computer (via ssh) to a non default kernel.
    If I just type reboot, it reboots to the default kernel.
    Man reboot(8) does not give any hint so I am not sure that is possible at all. I have found nothing googling around either.
    Does anyone know if this is possible?
    Many thanks in advance!!
    ~ There are 10 types of people. Those who understand binary, and those who don't. ~

  2. #2
    Join Date
    Nov 2009
    Location
    West Virginia Sector 13
    Posts
    16,284

    Default Re: Remotely reboot to a given kernel

    I guess you could as root edit the /boot/grub/menu.lst file. and change the default option number. Or you could have several menu.lst files and as root simply copy the one you want to the real menu.lst

  3. #3
    Join Date
    Mar 2008
    Location
    San Diego (California)
    Posts
    475

    Default Re: Remotely reboot to a given kernel

    I see. Thank you Gogalthorp!
    ~ There are 10 types of people. Those who understand binary, and those who don't. ~

  4. #4

    Default Re: Remotely reboot to a given kernel

    G0NZ0 wrote:
    > I see. Thank you Gogalthorp!


    Or use kexec instead of reboot

  5. #5
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,683
    Blog Entries
    4

    Default Re: Remotely reboot to a given kernel

    It can be done using GRUB without editing menu.lst each boot and involves the directives default, savedefault, fallback as well as the program grub-set-default. See the texinfo doc for GRUB. Here is a sample file taken from a remote Debian server. This is just illustrative, the server in question will be decommissioned soon.

    Code:
    default saved
    fallback 0
    
    title           Debian GNU/Linux, kernel 2.6.8-3-686
    root            (hd0,0)
    kernel          /vmlinuz-2.6.8-3-686 root=/dev/hda7 ro 
    initrd          /initrd.img-2.6.8-3-686
    savedefault
    
    title           Debian GNU/Linux, kernel 2.6.20.1-vs2.2.0-rc15-p3-squash-drbd-256ip-ipv6
    root            (hd0,0)
    kernel          /vmlinuz-2.6.20.1-vs2.2.0-rc15-p3-squash-drbd-256ip-ipv6 root=/dev/hda7 ro 
    initrd          /initrd.img-2.6.20.1-vs2.2.0-rc15-p3-squash-drbd-256ip-ipv6
    savedefault fallback
    To get kernel 1 to boot, you run grub-set-default 1. It will work just once, for the next boot, and then revert to the fallback entry, kernel 0. A failure to load kernel 1 will also cause the fallback 0 to boot. Thus one can try a different kernel remotely. Of course if the kernel hangs, you still need remote power control to regain control.

  6. #6
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: Remotely reboot to a given kernel

    On 2011-03-16 18:36, G0NZ0 wrote:

    > Does anyone know if this is possible?


    grubonce
    grub-set-default

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.2 x86_64 "Emerald" at Telcontar)

  7. #7
    Join Date
    Mar 2008
    Location
    San Diego (California)
    Posts
    475

    Default Re: Remotely reboot to a given kernel

    Thank you so much everyone, I am really glad I asked this question, lots of useful info that I did not know!!
    ~ There are 10 types of people. Those who understand binary, and those who don't. ~

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •