LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-12-2003, 05:44 PM   #1
eculbert
Member
 
Registered: Aug 2003
Location: Dante's inferno..er..Metro Phoenix area
Distribution: knoppix3.2/slack8.1/mandy9.1
Posts: 30

Rep: Reputation: 15
Cool Help with triple booting


I have a new hd, that I have part'ed 10g for w98, 10g for slak 8.1, 7g for knoppix 3.2.

Knoppix is the ONLY thing in lilo!! Even after re'ing 8.1 back in. When I didn't have knoppix installed, lilo saw dos and 8.1.

I have the orginal hd, 1/3 as fast still sitting in the box, but no cables to it, so IF I goof everything up, can just use the 'copy all files' that came with the new hd and re the hd as a win98 sys only, then re the two linux's.

But being stupid/newbie/bullheaded, I would like to 'fix' the lilo to recognize all. Using knoppix part right now.

Any one have experience getting a knoppix/debian to NOT be the only thing in lilo?

TIA


Added. I figure whatever is needed is in this part somewhere, just not sure what.

I am on a second bios, so hde1 is w98 as a primary bootable, hde2 is bootable and primary for slack 8, hde 7 is knoppix.


# Various files we access
$LILOCONF='/etc/lilo.conf';
$FSTAB='/etc/fstab';

$|=1;

# Print a banner now, to give the user something to look at while
# we ferret around in the fstab...
print "LILO, the LInux LOader, sets up your system to boot Linux directly\n";
print "from your hard disk, without the need for a boot floppy.\n";

# First we analyse the setup and set variables appropriately
$fstab_broken = 1; # is there a valid /etc/fstab? Assume not and prove otherwise.
$liloconf_exists = 0; # is there a preexisting lilo.conf with a non-commented out line?
$liloconf_incompatible = 0; # does lilo.conf use options not valid for this version of lilo?
$configuring_base = 0; # are we configuring the 'base' filesystem (special case)
$odd_fstab = 0; # set if we don't understand the device in the fstab
# We also set $device, $disk, $partition (assuming fstab_broken == 0)

if (-f $FSTAB) {
# Parse fstab for the root partition...
open(FSTAB, "<$FSTAB") or die "liloconfig: couldn't open $FSTAB: $!\n";
while (<FSTAB>) {
# Check for a magic string which indicates that we are configuring
# the base filesystem and not a real machine...
$configuring_base = 1 if /^# UNCONFIGURED FSTAB FOR BASE SYSTEM/;
next if /^#/; # ignore comment lines
($device,$filesystem) = split(/[ \t]+/);
next unless defined $filesystem; # ignore empty lines too
# Stop if we found the root device...
if ($filesystem eq '/') {
$fstab_broken = 0;
last;
}
}
close(FSTAB) or die "liloconfig: couldn't close $FSTAB: $!\n";
}

if (!$fstab_broken) {
# Valid device/filesystem pair, parse them
$disk = `/usr/sbin/lilo_find_mbr $device`;
chomp($disk);
$partition = $device;
my $devfs = 0;

# Paranoia check: there should be valid /dev/ nodes for these.
# We could check for block-special-device-ness, but perhaps
# some people have symlink forests in /dev/ ?
# This check will fail on things like RAID arrays, where the
# devices don't have names like /dev/hda4. In this case we can't
# do simple autoconfiguration, but we still want to be able
# to allow the user to install their own handrolled lilo.conf.
$odd_fstab = 1 unless ($partition =~ /\d+$/ && -e $disk && -e $device);
}

# Check for an existing lilo.conf with some non-comment lines in it...
system("grep -qsv '^#' $LILOCONF");
# Exit status is 0 iff lilo.conf exists and contains at least one non-comment line.
if ($? == 0) {
$liloconf_exists = 1;
$liloconf_incompatible = &compatibility_check();
}

##########################################################
# Boilerplate arrays used to produce an initial lilo.conf
##########################################################

@header = (
"# Generated by liloconfig\n",
"\n",
"# Specifies the boot device\n"
);

@rootheader = (
"\n",
"# Specifies the device that should be mounted as root.\n",
"# If the special name CURRENT is used, the root device is set to the\n",
"# device on which the root file system is currently mounted. If the root\n",
"# has been changed with -r , the respective device is used. If the\n",
"# variable ROOT is omitted, the root device setting contained in the\n",
"# kernel image is used. It can be changed with the rdev program.\n"
);

@boilerplate = (
"\n",
"# Enables map compaction:\n",
"# Tries to merge read requests for adjacent sectors into a single\n",
"# read request. This drastically reduces load time and keeps the map\n",
"# smaller. Using COMPACT is especially recommended when booting from a\n",
"# floppy disk.\n",
"# compact\n",
"\n",
"# Default menu for Debian. (Using the images from debian-bootscreen)\n",
"# from Philipp Wolfer <phil\@newswriter.org>.\n",
"bitmap=/usr/share/lilo/contrib/sid.bmp\n",
"bmp-colors=1,,0,2,,0\n",
"bmp-table=120p,173p,1,15,17\n",
"bmp-timer=254p,432p,1,0,0\n",
"\n",
"# Install the specified file as the new boot sector.\n",
"# If INSTALL is omitted, /boot/boot.b is used as the default.\n",
"# Note: /boot/boot-bmp.b must be used in order to the boot menu works.\n",
"# install=/boot/boot.b\n",
"install=/boot/boot-bmp.b\n",
"\n",
"# Specifies the number of _tenths_ of a second LILO should\n",
"# wait before booting the first image. LILO\n",
"# doesn't wait if DELAY is omitted or if DELAY is set to zero.\n",
"# delay=20\n",
"\n",
"# Prompt to use certaing image. If prompt is specified without timeout,\n",
"# boot will not take place unless you hit RETURN\n",
"prompt\n",
"timeout=1500n",
"\n",
"# Specifies the location of the map file. If MAP is\n",
"# omitted, a file /boot/map is used.\n",
"\nmap=/boot/map\n",
"\n",
"# Specifies the VGA text mode that should be selected when\n",
"# booting. The following values are recognized (case is ignored):\n",
"# NORMAL select normal 80x25 text mode.\n",
"# EXTENDED select 80x50 text mode. The word EXTENDED can be\n",
"# abbreviated to EXT.\n",
"# ASK stop and ask for user input (at boot time).\n",
"# <number> use the corresponding text mode. A list of available modes\n",
"# can be obtained by booting with vga=ask and pressing [Enter].\n",
"vga=normal\n",
"\n",
"image=/vmlinuz\n",
" label=Linux\n",
" read-only\n",

.)\n",
" other=/dev/hde2\n"
" label=win98\n"
" other=/dev/hde5\n"
" label+slak8\n"
"\n"

####################
# Utility functions
####################

sub ruler {

print "\n " . '=' x 74 . "\n";
}

sub asky {
do {
print @_,"? [Yes] ";
$answer=<STDIN>;
} while ($answer ne "\n" && !($answer =~ /^[YyNn].*/));
&ruler();
return ( !($answer =~ /^[nN].*/) );
}

sub askn {
do {
print @_,"? [No] ";
$answer=<STDIN>;
} while ($answer ne "\n" && !($answer =~ /^[YyNn].*/));
&ruler();
return ( $answer =~ /^[yY].*/ );
}

sub compatibility_check {

system("egrep '^[^#]*any_' $LILOCONF");
return 1 if ($? == 0);
return 0;
}

sub safe_system {

if ($DEBUG) {
print "[Would have run: ", join(' ', @_), "]\n";
$? = 0;
} else {
system(@_);
}
}

#####################################
# Actual work is done below here...
#####################################


if ($configuring_base) {
print <<EOT;

Hmm. I think you're configuring the base filesystem, and I'm therefore
simply going to exit successfully without trying to actually configure
LILO properly. If you're not doing that, this is an important bug
against Debian's lilo package, and should be reported as such...
EOT
exit(0);
}


if ($liloconf_exists) {

print "\n";
print "You already have a LILO configuration in the file $LILOCONF\n\n";
print "If you want to use the new LILO boot menu, please take a look to\n";
print "/usr/share/doc/lilo/examples/conf.sample and choose one of the\n";
print "bitmaps on /usr/share/lilo/contrib\n\n";
print "Checking your $LILOCONF for incompatible options...\n\n";
if ($liloconf_incompatible) {
print "WARNING: You have an old incompatible lilo configuration file!\n";
print " Read the file /usr/share/doc/lilo/INCOMPAT.gz and rerun\n";
print " /sbin/lilo to write the changes to your boot sectors\n\n";
exit(1);
}

if ( &asky("Install a boot block using your current LILO configuration") ) {
print "WARNING: Even if lilo runs successfully, see /usr/share/doc/lilo/INCOMPAT.gz\n";
print " for changes in the usage of the $LILOCONF file.\n";
print " If needed: edit $LILOCONF and rerun '/sbin/lilo -v'\n\n";
print "Running lilo...\n";
&safe_system("/sbin/lilo -v");
if ( $? == 0 ) {
exit(0);
}
print "\nERROR: correct $LILOCONF manually and rerun /sbin/lilo\n\n";
exit(1);
} else {
print "\n";
if ( &askn("Wipe out your old LILO configuration and make a new one") ) {
print "Saving configuration in $LILOCONF.OLD\n";
rename($LILOCONF, "$LILOCONF.OLD") or die "liloconfig: couldn't save old $LILOCONF as $LILOCONF.OLD: $!\n";
}
else {
print "No changes made.\n";
exit(0);
}
}
}


if ($fstab_broken) {
print <<EOT;

WARNING!

Last edited by eculbert; 09-12-2003 at 06:19 PM.
 
Old 09-12-2003, 06:29 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Linux Mint 17, Linux Mint 18
Posts: 7,809

Rep: Reputation: 294Reputation: 294Reputation: 294
login as root
use a text editor to edit /etc/lilo.conf to whatever setup you want
run lilo
 
Old 09-12-2003, 07:25 PM   #3
eculbert
Member
 
Registered: Aug 2003
Location: Dante's inferno..er..Metro Phoenix area
Distribution: knoppix3.2/slack8.1/mandy9.1
Posts: 30

Original Poster
Rep: Reputation: 15
Jailbait, I don't know what to change/add, that is the problem. Kate seems the most visible editor I have to use. Some are tooooo small fonts and on weird colored back grounds....Shoot anyone with blue on black!!! or similiar. I know, asap I will learn how to change them. Emacs seems good too.

I am assuming, since it boots with 'Knoppix' only listed, that the bootloader is accessed from the liloconfig located in Knoppix and not the one in slack's partition. Besides, without floppy booting, cannot get to slak.

Thanks, and hopefully someone will tell me what and where to change if it is possible to use this file while booted to knoppix.

Also, do I tell it dos for booting w98 or what? Same for slak. Or is it just the hdXY and it takes it from there? I tried adding

other=

type statements right after the first one that said linux. But it didn't do anything. Also changed the timing to the 1500 listed, and it still only gave about 3 seconds before it went to knoppix. At least that is what I thought, and it came up and the edit came up with the 1500 tics which should have been about 75 seconds IF I understand it right..not the 2 or three it gave me. So there is some major misunderstanding on my part.
 
Old 09-12-2003, 07:32 PM   #4
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Linux Mint 17, Linux Mint 18
Posts: 7,809

Rep: Reputation: 294Reputation: 294Reputation: 294
"Thanks, and hopefully someone will tell me what and where to change if it is possible to use this file while booted to knoppix. "

I did not understand that you wanted to change something on the Knoppix CD. To change the lilo.conf file on the Knoppix CD you would have to copy the CD to hard disk, make changes to the hard disk copy, and then burn a new CD.
 
Old 09-12-2003, 08:14 PM   #5
eculbert
Member
 
Registered: Aug 2003
Location: Dante's inferno..er..Metro Phoenix area
Distribution: knoppix3.2/slack8.1/mandy9.1
Posts: 30

Original Poster
Rep: Reputation: 15
Jailbait and others

Misunderstanding, I have knoppix installed on hd along with slack 8.1 and w98. When I boot up, lilo only points to knoppix. I could uninstall knoppix, but then not sure slak's lilo would take over. IF push comes to shove, can wipe hd and re 98 and slak. I love the speedier hd install of knoppix so would like all three if possible at my stage of uninformed.

I installed 98 first, then slak, then knoppix. Before knoppix was installed, I could dual boot to slak and 98, so it is the knoppix that rewrote the mbr to only point to its one boot lilo!!! Or however you say that.

Wisely, the orginal smallish hd is disconnected and still available for w98 re transfer, so wiping out this new drive isn't a big deal, except for the hours involved and 'cheating'. I really would like to know what and why, IF you can decipher the listing...hopefully it is hidden somewhere I cannot see in that part of the liloconfig file.

But would like to get lilo going on all three systems. And findout what is wrong now without 'cheating'.

So this is what I am asking for interpretations of the above stuff.

For instance, I thought I had changed the timing from 50 ticks to 1500...about 75 seconds for decision but that 1500 is ignored...it still selects knoppix after about 2.5 seconds unless I interrupt it. So, my guessing wasn't correct on that one.

Knoppix can be left off, but would like it on the hd if feasible and co-existing with 98 and slack

I have the following books, but they all seem to assume too much for a beginning person. They assume too much in the interest of not being big.

Running Linux 4th

Linux the complete reference

linux vol1 ac to zcat

Going to a linux users group with the system isn't a feasible option as I would have to take it on either a bike or bus!!
 
Old 09-12-2003, 09:34 PM   #6
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Linux Mint 17, Linux Mint 18
Posts: 7,809

Rep: Reputation: 294Reputation: 294Reputation: 294
You have two copies of lilo.conf, one in knoppix and one in slackware. I suggest that you fix your problem by setting up the lilo.conf in your slackware system the way that you want it and use that lilo.

So, how do you work with the slackware lilo.conf when you cannot boot into slackware? Boot into Knoppix. Mount your Slackware / partition (say mount it on a directory called slak). Then edit /slak/etc/lilo.conf to however you want lilo to work. Then run the command:
/slak/sbin/lilo -C /slak/etc/lilo.conf
 
Old 09-13-2003, 10:04 AM   #7
eculbert
Member
 
Registered: Aug 2003
Location: Dante's inferno..er..Metro Phoenix area
Distribution: knoppix3.2/slack8.1/mandy9.1
Posts: 30

Original Poster
Rep: Reputation: 15
Jailbait, will try.

Not having seen any lilo config's till this mess, what exactly am I looking for in terms of the code? I haven't done any programing for about 25 years and that was very limited msbasic stuff on a trash 80.

I need a recommendation of a 'hold your hand' type book. Running linux 4th almost does, but it assumes quite a bit when it ends with something like 'now load it'. Leaves me kinda hanging...wondering where, what, when, etc.

I am not dumb, just uninformed as to the "how to's" in linux/unix.

Thanks all for your help and probably will be back for more.
 
Old 09-13-2003, 10:28 AM   #8
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Linux Mint 17, Linux Mint 18
Posts: 7,809

Rep: Reputation: 294Reputation: 294Reputation: 294
Here is a HOWTO for lilo.

http://www.tldp.org/HOWTO/LILO.html
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Triple booting - Is it possible?? JSLayton Linux - Newbie 34 10-07-2006 10:16 PM
triple booting jag2000 Mandriva 2 02-02-2005 12:23 PM
Help with triple booting frontier1 Linux - General 2 12-19-2003 05:15 AM
Triple booting conquered...and I did it my way! rberry88 LinuxQuestions.org Member Success Stories 2 10-20-2003 11:25 PM
Triple booting? poison5151 Linux - Software 16 04-22-2003 02:40 PM


All times are GMT -5. The time now is 11:06 AM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration