LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 01-14-2005, 02:21 PM   #1
underberg
LQ Newbie
 
Registered: Aug 2003
Posts: 14

Rep: Reputation: 0
Get LILO to remember last boot option


Hi All,

Does anybody know how to get LILO to remember the last boot. I use Slack 10 and Windows, and I want LILO to boot the same OS as last time by default. Thanks in advance.
 
Old 01-14-2005, 10:09 PM   #2
nilleso
Member
 
Registered: Nov 2004
Location: ON, CANADA
Distribution: ubuntu, RHAS, and other unmentionables
Posts: 372

Rep: Reputation: 31
Thumbs up

I don't think it's possible or have never come across it at least.

great idea though
 
Old 01-15-2005, 03:26 AM   #3
omes
Member
 
Registered: Jan 2003
Distribution: debian, FreeBSD
Posts: 120

Rep: Reputation: 15
Of course it's possible, but it would require some code, as i'm not sure wether it is a feature today. I'm not sure, but maybe you can request this feature to the developers.

Good luck, and tell us how it went

- omes
 
Old 01-20-2005, 06:09 AM   #4
underberg
LQ Newbie
 
Registered: Aug 2003
Posts: 14

Original Poster
Rep: Reputation: 0
It must be possible but I'm not a programmer so where do I find more easy to understand info on Lilo coding? Btw does anybody know the url to Lilo? Thx in advance.

Underberg
 
Old 01-20-2005, 08:23 AM   #5
omes
Member
 
Registered: Jan 2003
Distribution: debian, FreeBSD
Posts: 120

Rep: Reputation: 15
I've sent a mail to the developer with a link to this post. I think what you mentioned is a great feature, and i'd love to see it in lilo
http://home.san.rr.com/johninsd/pub/linux/lilo for latest release.

- omes
 
Old 01-20-2005, 09:25 AM   #6
ezra143
Member
 
Registered: Aug 2003
Location: NY
Distribution: RH9, RH8, Slack, Vector
Posts: 497

Rep: Reputation: 31
thats a great idea. like when you remotely reboot a dual boot box and know it wont go back to the os you had been in.... Love it.

Anyhow, I saw a solution to that for grub a few years ago, not sure if anyone has developed it further. At the time it was less than elegant and I didn't trust it enough to use.
 
Old 01-20-2005, 09:38 AM   #7
omes
Member
 
Registered: Jan 2003
Distribution: debian, FreeBSD
Posts: 120

Rep: Reputation: 15
Quote:
Originally posted by ezra143
thats a great idea. like when you remotely reboot a dual boot box and know it wont go back to the os you had been in.... Love it.
(...)
If you need to do this, you should set the 'default' option in lilo.conf to the image you want it to boot. I guess this is more useful for dual boot users with multiple OS's/boot images.

As I said, I sent a mail to the developer. Here is my mail and the answer:
Quote:
At 06:27 AM 1/20/2005, you wrote:
>Take a look at this thread at the linuxquestions.org forum:
>http://www.linuxquestions.org/questi...0&goto=newpost
>
>Wouldn't it be a great feature that lilo boot the image/OS you chose last
>time
>you booted. I'm not saying that this should be a standard feature, but
>something you can enable if you want it. At least for people with multiple
>OS's at one computer this could be great.
>
>Tell me what you think about it.

Use the "lock" keyword.

--John



PGP KeyID: 6781C9C8 (good until 31-Dec-2008)
PGP KeyID: 178A1C6B (good until 31-Dec-2004)
Keyserver at ldap://keyserver.pgp.com
LILO links at http://freshmeat.net/projects/lilo
and Help link at http://lilo.go.dyndns.org
The lilo manual says this about 'lock':
Quote:
BOOT OPTIONS
The options described here may be specified at on the com_
mand line when a kernel image is booted. These options
are processed by LILO, and are removed from the command
line passed to the kernel, unless otherwise noted.

lock Locks the command line, as though 'lock' had been
specified in 'lilo.conf.'
 
Old 01-20-2005, 10:15 AM   #8
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
It's already possible under lilo using lock. I've tested it using RH8.

Add the following line to the general section of your lilo.conf:
Code:
lock
This will record the lilo commandline.
Activate the new configuration by running lilo and reboot.

When the lilo menu shows, go to the command line (under RH by pressing <ctrl>x). Typing ? will show the different labels as specified in lilo.conf (e.g. linux and windows). Type the name of the OS (read: label) that you want to boot (in the example linux or windows). Wait till booting has finished and reboot.
The usual lilo screen will not show and the system will immediately boot the last selection (so without the usual delay).

To select another OS, hold the <shift> key while the system reboots (just before the usual lilo menu should show); this might be a bit tricky. As a result the lilo menu shows up again; again press <ctrl>x and type the name of the required OS.
If you don't go to the lilo commandline, the 'normal' default OS will be booted after the usual delay. This also seems to clear the recorded commandline, so the next time that the system reboots, it agains shows the lilo menu.

Docs: man lilo.conf

Caution:
- First check how to access the lilo commandline
- Check my info against your lilo version; things might be slightly different
- First check if it works booting into linux; if it does not work, you can still fix lilo.conf
- It's a good idea to have a linux bootflop or rescue disk available in case it does not work so you can boot into linux and fix lilo.conf again.

My lilo.conf:
Code:
prompt
timeout=150
default=linux_8_0
boot=/dev/hda
map=/boot/map
install=/boot/boot.b
map=/boot/message
lba34
lock

image=/boot/vmlinuz-2.4.18-14
label=linux_8_0
...

image=/boot/vmlinuz-2.4.18-3bigmem
label=linux_7_0
...

other=/dev/hda1
label=W2K
...
//edit: have to learn to type faster

Last edited by Wim Sturkenboom; 01-20-2005 at 10:17 AM.
 
Old 03-12-2005, 02:06 PM   #9
underberg
LQ Newbie
 
Registered: Aug 2003
Posts: 14

Original Poster
Rep: Reputation: 0
Thank you. I've used LOCK in Lilo for a month now without problems. But I miss the Lilo start menu :-(
 
Old 03-30-2005, 04:27 AM   #10
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
As I wrote before, use shift to show the menu again.
Quote:
Originally posted by Wim Sturkenboom
To select another OS, hold the <shift> key while the system reboots (just before the usual lilo menu should show); this might be a bit tricky. As a result the lilo menu shows up again
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to specify to lilo a boot option before rebooting entropyv Linux - Software 2 08-21-2005 01:56 AM
Need help with remember=10 option tonyfreeman Linux - Security 1 10-27-2004 03:57 PM
Which Lilo Boot option is best to use? Stevetgn Mandriva 3 06-29-2004 02:43 PM
Cannot see win2k boot option when setting up lilo kashoji Linux - Software 4 12-01-2002 01:14 PM
Help! - Deleted boot option for Windows from LILO! - HOW DO I GET IT BACK?! CrossfireCurt Linux - General 2 06-16-2002 10:49 AM


All times are GMT -5. The time now is 05:52 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration