PDA

View Full Version : Edit LILO?



el__sid
04-19-2005, 06:08 PM
Hey All,

I'm running Knoppix from the Hard Disk in Dual-boot with Windows XP. But on the lilo boot selection screen, I get four OS's.

linux
Linux(2.6)-1
Windows(hda1)
WinXP/2K(hda2)
Windows(hda7)

Linux and WinXP/2K(hda2) are both working as they should, I havent tried Linux(2.6)-1 and the two windows(hdaX) boots are dead ends, resulting in a blank screen (Although Windows(hda1) tries to load MS-DOS then fails).

Is it possible to remove the 3 "obsolete" Options, as I have some "Non-Computer-Literate" people using the computer, and they get confused by many options :wink:.

Any help appreciated.

Thanks in advance,

El__sid

P.S. I am pretty new to Linux on the whole, so if you could please explain using as many lamen terms as possible, I'd be very grateful 8).

mr_ed
04-19-2005, 10:07 PM
The quickest way to do what you're asking is to edit LILO's configuration file, /etc/lilo.conf, which you have to do as root.

There's a sort of paragraph (the geek word is "stanza") for each system LILO thinks is bootable. Put the symbol # at the beginning of each line of those stanzas - this turns them into comments, and LILO will skip over them.

With LILO (but not the other big multibooter, GrUB) there's one more step - still as root you type the command # lilo to get the new configuration written to the drive's Master Boot Record.

The reason for just commenting out the three stanzas instead of completely deleting them is so you can go back when you feel like it and improve LILO's behavior. It would be nice to boot into Windows, wouldn't it? :wink: You can also make LILO and GrUB give some users some options and other users other options at boot time.

You can read manual pages for this stuff by typing (as a regular user or as root) $ man lilo and $ man lilo.conf. The file /etc/lilo.conf also has examples written into it -- look at the bottom of the file first. :D Adding other distros of Linux takes a little studying and figuring out, but making LILO boot into Windows correctly should be easy.

LILO doesn't understand Windows (or BSD types of Unix, or anything other than Linux) so there's nothing to confiugre in those stanzas of /etc/lilo.conf. Basically you tell LILO to just hand off control to whatever is in that partition without doing any checking.

Let us know if you have more questions, okay?

-- Ed

el__sid
04-21-2005, 04:02 PM
Hey ed, Thanks for the reply, but I'm having a root problem it seems.

I'm entering into a terminal session:


knoppix@1[~]$ su root
root@1[knoppix]# /etc/lilo.conf


And I'm getting a permission denied message, and I've tried the "ctrl+alt+f2" console too, still to no avail.

Any ideas?

mr_ed
04-21-2005, 08:26 PM
The file /etc/lilo.conf is what you edit, then the program /sbin/lilo is what you run to put the changes into the boot record. But /sbin should be in your path (where Linux looks for programs), so you can get away with just typing # lilo when you're done editing.

The error you're getting is due to /etc/lilo.conf not having permission set for anybody, including root, to run it as an executable even though it can be read by everyone and written to by root.

Try $ ls -l /etc/lilo.conf and you should see something like:-rw-r--r-- 1 root root 5994 Apr 18 02:55 /etc/lilo.confAfter the first dash, the possible permissions are read write execute for file owner, rwx for the owner's group, then rwx for everybody else - but nobody has execute permission 'cause it's just a configuration file.

-- Ed

el__sid
04-21-2005, 09:02 PM
Is it possible to edit the permissions?

I've tried through properties, but the checkboxes are all greyed out

mr_ed
04-22-2005, 04:08 AM
Sure - I'll tell you how if you'll tell me why! :D In fact, if you let me guess, I'll show you two ways to go about it.

Occasionally I want to edit something owned by root, like /etc/fstab, with a GUI editor like KWrite - I install a new Linux distro and need to make a bunch of changes that are easier with a nice, fat, visual cut-and-paste operation.

Easier, that is, when I've spent more years doing it that way than with a command-line editor. And when my poor old brain balks at learning emacs. I started playing with computers 35 years ago and don't need to prove my geekhood. :wink:

But by default KDE-the-nanny won't let you log in as root. That can be changed, of course. But before you figure out how to do that, it's still important to know how to change ownership and permissions on files.

For permissions, use the change-mode command. Be sure to read the manual ($ man chmod) to see why this works, but here's what you do as root: # chmod +w /etc/lilo.conf. This is a shortened version of # chmod a+w /etc/lilo.conf - that is, for all (owner, group, others) add write permission to the file.

Another way to achieve this end is to just plain change who owns the file, with the change-owner command. Again as root you'd type # chown ed:ed /etc/lilo.conf. This changes both the user and group ownership (see $ man chown).

After either one of these commands you'd want to check the results with $ ls -l /etc/lilo.conf. By the way, remember to run # lilo after you edit /etc/lilo.conf, and don't be surprised if LILO complains about people other than root having access to its configuration file. It's a security risk, of course, but at my house the dogs just never turn on the computer and log in. :D

Here's one more command, for when you know what you want to do but you've forgotten the obscure unix command name: $ apropos permission (for example). This goes through all the man pages looking for that keyword.

It'll say that there are actually two versions of chmod, one documented in section (1) of the man pages, and another in section (2). Almost everything you'll want to look up will be in section (1), and just typing $ man command only shows you the first one that man comes across. But if you're curious about the chmod in section (2) you can type $ man 2 chmod.

Okay? Next question! :D

-- Ed

el__sid
04-22-2005, 04:15 PM
That worked beautifully ed, thank you very much, it's very appreciated.

I think i need to read those manuals again though :oops:

mr_ed
04-23-2005, 12:24 AM
Is it not written, in the ancient texts compiled by the sages of old, "If you got it the first time, you didn't get it." :D

-- Ed