Skip to Content

rebooting to another OS

mborn's picture

Assalam Alikum,

I use $reboot to reboot my box and then wait for it to do this them from Grub, I choose the OS I want. My question is; Is there a possibility that I can pass my OS to which I want to reboot to the command line so it can reboot directly to the OS I want?

Thank you,

M B

More explanation needed.

Salamo 3alaikom,

I didn't get what you mean exactly. Do you mean that you want to pass the command directly from the virtual console to reboot directly to any OS you want? I don't know if that is possible since booting between different OSes is a boot loader job not an OS job. I have read the Power to bash howto. It didn't include that possibility. May be I am mistaken.

Salam.

mborn's picture

Yes, that's what I meant.

Yes, that's what I meant.

Thank you for ur time,

M B

With lilo you can use the -R

With lilo you can use the -R option. It set the default OS to launch but for one time only.

ShErbO's picture

Not really possible ....

When you (restart/cold boot/whatever), BIOS takes over. It than starts your bootloader (lilo/grub) which then lets you choose the OS. See? problem is it's the BIOS that takes control of the PC, then the bootloader !

There's no direct way to do it. You can write a win_boot.sh script which makes windows the default operating system and restarts. but then you're stuck with windows unless you manually choose linux ! (get what I mean ?? it's a closed circle)

IMO it's a nice idea, maybe someone would hack lilo to include this feature.. maybe by placing a dummy file called (boot_win), which when seen by lilo, boots to windows.

Short answer: If you're not into programming, don't think about it..

mborn's picture

I got it Sherbo! Thank you

I got it Sherbo!

Thank you for ur time,

M B

Alaa's picture

actually it is possible already

it is possible already, at least with lilo.

in MDKKDM (dunno if its in stock kdm too), if you click on reboot it gives you your lilo menu and you can choose which entry to boot to immediatly.

its a very silly features IMO.

Alaa


"i`m feeling for the 2nd time like alice in wonderland reading el wafd"

Mohammed Ahmed's picture

it can be done

assume u have 2 OS windows and linux

u do 2 scripts 1st chnage the file grub.conf and make the windows the dfult one and reboot ur pc

2nd chnage grub.conf and make linux ur defuelt on and rebot ur pc ps: when u be on windows u can use ltools to chnage the grub.conf it can be easily done may be some one can give better solution peace

mborn's picture

Thanks, I was hoping of gett

Thanks, I was hoping of getting something like $reboot grub > FreeBSD (where I have this package on my box to take a look at it) anyway thanks a lot

Thank you for ur time,

M B

mborn's picture

I got it!

Assalam Alikum, I had it, it si a work around but I think it is nice! I can write two patch files one for each system with a sed command to change the default system in grub.conf. they can be initiated as a su, then after the change, reboot!!! What do you think?

PS. How may I write a patch file!? I know it begins with !#bin/sh, umm I will try....

Thank you for ur time,

M B

small kde app

mborn's picture

Assalam Alikum, This is Gr

Assalam Alikum,

This is Great, it is just great!

Thank you for ur time,

M B

hello...... i kno w i'm

hello......

i know i'm pretty late to give a reply..but while searching for a similar thing i came across this site......

now that i'v found an answer i thought i'd post it here too. Thought i know it owrked for redhat,dunno about this.

i used the unix command grubby.

for more details,

hope its useful for the future!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.


Dr. Radut | forum