LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   LILO reboot a particular image (https://www.linuxquestions.org/questions/linux-software-2/lilo-reboot-a-particular-image-84420/)

Kocil 08-22-2003 01:05 AM

LILO reboot a particular image
 
Dear all.

Supposed I have 3 images in lilo.conf, labeled : dos, linux1, linux2.
The default is dos (since my wife need it :).
I'm looking for a utility xyz that allows me reboot a particullar image, e.g:
# xyz linux1 -> will reboot the linux1 image instead of dos
# xyz linux2 -> will reboot the linux2 image instead of dos

Please tell me where to find it.

Thanks.

exodist 08-22-2003 01:36 AM

I don't understand the question, elaborate.

Kocil 08-22-2003 03:16 AM

Hi.

Ok, I'll try again.
My LILO has 3 boot images: dos, linux1 (plain kernel) and linux2 (patched kernel). The default is dos.
I'm not allowed to change the default, since my wife will scream.

Supposed the computer is running linux1,
and then I remote login with ssh from far-far away.
I want to reboot to the computer with linux2 remotely,
without have to come to the computer.
What command should I give ?

If I give only:
# reboot

The computer will reboot to DOS (the default), which is not expected.
Currently I have to walk to the computer (not so far, but annoying), reboot, then select the lilo menu by hand.


Thanks.

ppuru 08-22-2003 03:21 AM

I hope you can choose the OS from the lilo menu.

leonscape 08-22-2003 03:22 AM

Its a tough one, you could right a script to re-right lilo.conf and install, to change its default.

You could also do something similar in grub, but then its just a text file (No Install).

But basically your asking it to remeber something between boots, and then something the Bootloader has to look for, that ain't easy.

Kocil 08-22-2003 03:27 AM

Really ?.

The computer is a Redhat 8.0.
If I login locally with GUI,
I can shutdown and choose which image to reboot next.

But how to do it from console (remote ssh) ?

Thanks.

ppuru 08-22-2003 03:31 AM

You can use the

default=

option in lilo.conf; set the default to the OS you want to boot in; run lilo and reboot.

But you will need to do this each time you intend to reboot into a different partition/OS.

Kocil 08-22-2003 03:45 AM

Ok, I got the idea.

I'll write two perl scripts.
One for change it to any image, run by me.
One to change it back to DOS, run from rc.local.

Thanks folks.

ppuru 08-22-2003 04:34 AM

I believe Mandrake has(d) a feature where you can request it to reboot into Windows. After you shutdown Windows and restart, it boots back into Linux....
wonder how they accomplish it.

Coming back to Kocil's earlier question ... is there any utility to do this, without any modifications to lilo.conf.

Kocil 08-23-2003 04:30 PM

I found this the -D option for lilo :

lilo -D new_image

It configures lilo to put new_image as a default
without changing the lilo.conf.

So my dumb scipt is:

#!/bin/sh
# Boot with a new default
echo "1" > /etc/lilo.new
lilo -D $1

And I add this to rc.local
if [ /etc/lilo.new ]; then
rm /etc/lilo.new
lilo
fi

acid_kewpie 08-23-2003 05:29 PM

that's really a risky way to go about things.... try seeing if you have a "rebootin" script on your system, i know it comes on mandrake...

luischardon 08-23-2003 10:13 PM

I have seen on Mandrake that a 'rebootin label' command exists, and basically you do a "rebootin windows" or "rebootin linux-2.4.19" or something like that and it will reboot directly into that, using the same label names in /etc/lilo.conf

Samsara 08-24-2003 06:41 AM

bootinto application
 
Quote:

Originally posted by Kocil
Dear all.

Supposed I have 3 images in lilo.conf, labeled : dos, linux1, linux2.
The default is dos (since my wife need it :).
I'm looking for a utility xyz that allows me reboot a particullar image, e.g:
# xyz linux1 -> will reboot the linux1 image instead of dos
# xyz linux2 -> will reboot the linux2 image instead of dos

Please tell me where to find it.

Thanks.

I'm developing it. Currently rewriting from scratch as I want to add a lot more functionality. It's in Perl. This is the most recent beta (which works perfectly, but lacks features):

http://www.linuxforen.de/forums/atta...&postid=541981

(it seems to be a tar file, but it's not, just do "mv bootinto.tar bootinto)

Usage:
bootinto win
bootinto lin

Manpage will be coming your way soon. It works for both GRUB and LILO, btw, and you don't even need to know which one you've got running!

Hope you find it useful.

Samsara

PS: It's a Perl script, so you'll find it easy to adapt.

Samsara 08-24-2003 06:42 AM

Quote:

Originally posted by luischardon
I have seen on Mandrake that a 'rebootin label' command exists, and basically you do a "rebootin windows" or "rebootin linux-2.4.19" or something like that and it will reboot directly into that, using the same label names in /etc/lilo.conf
Oops, really??? Seems I'm rewriting something that exists already... well, I'll just have to make a better job of it than the original ;)

Samsara

Samsara 08-24-2003 06:43 AM

Quote:

Originally posted by ppuru
I believe Mandrake has(d) a feature where you can request it to reboot into Windows. After you shutdown Windows and restart, it boots back into Linux....
wonder how they accomplish it.

Have you been able to find out? I'd like to know (for reason see my above posts)

Samsara


All times are GMT -5. The time now is 06:23 PM.