LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 10-13-2008, 08:18 PM   #1
kcynice
Member
 
Registered: Sep 2008
Posts: 94

Rep: Reputation: 16
Wink Lilo multibooting problem


There are total 3 os installed on my disk, windows xp on /dev/hda1,debian on /dev/hda9 and slackware on /dev/hda9. Slackware is my favor. Before my slackware was installed, debian had installed GRUB for bootintg menu witch have debian and xp enterance included. But after i installed my slackware, which use lilo as its loader, only has only 2 choice: Windows and my slackware! So, i followed some guideline to edit /etc/lilo.con to add an entry for debian:
other = /dev/hda9
label = Debian
Table = /dev/hda
But when i use lilo -t to test it, there is an error: The first section of the partition /dev/hda9 doesn't have a bootable signature.
Why and how to fix it?
Thanks.
 
Old 10-13-2008, 08:29 PM   #2
astrogeek
Senior Member
 
Registered: Oct 2008
Distribution: Slackware: 12.1, 13.1, 14.1, 64-14.1, -current, FreeBSD-10
Posts: 2,026

Rep: Reputation: 789Reputation: 789Reputation: 789Reputation: 789Reputation: 789Reputation: 789Reputation: 789
First, you say Debian and Slack are on /dev/hda9, I assume that is a typo...?

T make it go as-is the easy way, boot into Debian how-ever you can (ie, CD boot) and run grub and install it's bootloader on it's own partition ('root partition' in lilo speak - NOT MBR).

Then boot back into Slack and run lilo - it should now recognize the Debian partition as bootable.
 
Old 10-13-2008, 09:33 PM   #3
slackass
Member
 
Registered: Apr 2006
Location: SE Texas
Distribution: Slack64-C ML
Posts: 888

Rep: Reputation: 78
The super grub disk will reinstall grub for you.
free download
http://www.supergrubdisk.org/
Then you can just edit the menu.lst.
Or install grub from the slack dvd in the extra folder.
Then run:
grubconfig
you may have to edit the Debian entry to get it to boot Debian.

Last edited by slackass; 10-13-2008 at 09:38 PM.
 
Old 10-13-2008, 09:36 PM   #4
kcynice
Member
 
Registered: Sep 2008
Posts: 94

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by astrogeek View Post
First, you say Debian and Slack are on /dev/hda9, I assume that is a typo...?

T make it go as-is the easy way, boot into Debian how-ever you can (ie, CD boot) and run grub and install it's bootloader on it's own partition ('root partition' in lilo speak - NOT MBR).

Then boot back into Slack and run lilo - it should now recognize the Debian partition as bootable.
Oh, sorry, it's my fault. my slackware was installed on /dev/hda8 and debian on /dev/hda9. You mean, i should boot my debian os to install grub?

In fact, in my windows xp, i have added an entrance to grub at c:/boot.ini. of course i have download a dos version of grub in the windows partition. So, in lilo's boot menu, if i select windows, it will give me two choice: 'windows xp professional' and 'grub', then select grub, it would find my old grub menu(before i installed my slackware),does this mean my debian has its own bootloader on its partition?.
Although i can boot my debian by this, but i really want to add a choice in lilo's menu as my slackware.
 
Old 10-13-2008, 09:44 PM   #5
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,293

Rep: Reputation: 710Reputation: 710Reputation: 710Reputation: 710Reputation: 710Reputation: 710Reputation: 710
If you want to use LILO instead of GRUB, you would have to create a kernel stanza similar to Slackware's -- and NOT similar to Windows'. Your current entry:
Code:
other = /dev/hda9
label = Debian
Table = /dev/hda
will ONLY work if GRUB is installed to the superblock of /dev/hda9. This would be chainloading Debian's GRUB from Slackware's LILO (ie you would first see LILO, then select Debian, and it would show you the GRUB prompt where you could then select which kernel to boot). If you want to do it that way, that's fine -- but you would have to follow astrogeek's advice and install GRUB to the superblock of Debian's root partition (/dev/hda9). To clarify: you would reinstall GRUB, but to the superblock of /dev/hda9 and NOT to the MBR (where it was before and where LILO is now).

If you want to get LILO to boot Debian (without using GRUB at all), you would have to add an entry like the following:
Code:
image = /boot/vmlinuz
  initrd = /boot/initrd.gz
  root = /dev/hda9
  label = Debian
  read-only
You would have to change the /boot/vmlinuz line to match the location of Debian's kernel image. Also, you would have to change the initrd line to match the location of Debian's initrd (initial ramdisk) IF it uses one -- if not, just remove that line entirely. If you take this approach, remember that you MUST run `lilo` as root after editing lilo.conf for the changes to take effect.

Last edited by T3slider; 10-13-2008 at 09:45 PM.
 
Old 10-13-2008, 09:50 PM   #6
astrogeek
Senior Member
 
Registered: Oct 2008
Distribution: Slackware: 12.1, 13.1, 14.1, 64-14.1, -current, FreeBSD-10
Posts: 2,026

Rep: Reputation: 789Reputation: 789Reputation: 789Reputation: 789Reputation: 789Reputation: 789Reputation: 789
Quote:
Originally Posted by kcynice View Post
You mean, i should boot my debian os to install grub?
Yes, if you can boot into Debian from grub in M$ that is fine.

Once in Debian, use it's grub command or setup tool, (sorry, I am not sure how Debian does it), to install a bootloader onto it's own partition, /dev/hda9. In lilo this is the 'boot' parameter, also called the 'root' partition - but NOT the MBR (Slack's lilo bootloader lives there now). Be sure NOT to install anything to MBR or you will then not be able to easily boot back into Slackware.

Then, boot back into Slackware and run lilo -t as you did before and it should recognize the Debian partition as bootable and allow you to add the entry for it.
 
Old 10-13-2008, 09:53 PM   #7
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,293

Rep: Reputation: 710Reputation: 710Reputation: 710Reputation: 710Reputation: 710Reputation: 710Reputation: 710
Quote:
Originally Posted by astrogeek
Then, boot back into Slackware and run lilo -t as you did before and it should recognize the Debian partition as bootable and allow you to add the entry for it.
Just a note (I'm assuming this is a typo) -- `lilo -t` will only test the installation but will not actually install. Therefore, just `lilo` must be used to write to the MBR. It's nice to run `lilo -t` to see if it should work and THEN run `lilo` to actually write to the MBR.
 
Old 10-13-2008, 09:58 PM   #8
astrogeek
Senior Member
 
Registered: Oct 2008
Distribution: Slackware: 12.1, 13.1, 14.1, 64-14.1, -current, FreeBSD-10
Posts: 2,026

Rep: Reputation: 789Reputation: 789Reputation: 789Reputation: 789Reputation: 789Reputation: 789Reputation: 789
Quote:
Originally Posted by T3slider View Post
Just a note (I'm assuming this is a typo) -- `lilo -t` will only test the installation but will not actually install. Therefore, just `lilo` must be used to write to the MBR. It's nice to run `lilo -t` to see if it should work and THEN run `lilo` to actually write to the MBR.
Yes, -t will only test it, but kcynice indicated in the first post that they were aware of that... but guess I should have made it more clear though - thanks.
 
Old 10-13-2008, 10:15 PM   #9
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,293

Rep: Reputation: 710Reputation: 710Reputation: 710Reputation: 710Reputation: 710Reputation: 710Reputation: 710
Ah, didn't see that. Never mind then.
 
Old 10-13-2008, 11:14 PM   #10
kcynice
Member
 
Registered: Sep 2008
Posts: 94

Original Poster
Rep: Reputation: 16
i still can't configure lilo successfully. I can find grub in my debian partition, there is a menu.lst file which has the following code:

Title Debian GUN/Linux kernel 2.6.18-6-686
root (hd0,0)
kernel /boot/vmlinuz-2.6.18-6-686 root=/dev/hda1 ro
initrd /boot/initrd.img-2.6-18-6-686
savedefault

so, i add a new entrance to my lilo.conf like this:
image = /boot/vmlinuz-2.6.18-6-686
initrd = /boot/initrd.img-2.6.18-6-686
root = /dev/hda1
label = Debian

but i got such error when i run 'lilo -t':
Fatal: Can't open /boot/vmlinuz-2.6.18-6-686:No such file or directory.

it seems that, lilo uses wrong root directory, why?
 
Old 10-14-2008, 12:03 AM   #11
astrogeek
Senior Member
 
Registered: Oct 2008
Distribution: Slackware: 12.1, 13.1, 14.1, 64-14.1, -current, FreeBSD-10
Posts: 2,026

Rep: Reputation: 789Reputation: 789Reputation: 789Reputation: 789Reputation: 789Reputation: 789Reputation: 789
The lilo stanza for Debian is not correct...

Quote:
Originally Posted by kcynice View Post
i still can't configure lilo successfully. I can find grub in my debian partition, there is a menu.lst file which has the following code:

Title Debian GUN/Linux kernel 2.6.18-6-686
root (hd0,0)
kernel /boot/vmlinuz-2.6.18-6-686 root=/dev/hda1 ro
initrd /boot/initrd.img-2.6-18-6-686
savedefault

so, i add a new entrance to my lilo.conf like this:
image = /boot/vmlinuz-2.6.18-6-686
initrd = /boot/initrd.img-2.6.18-6-686
root = /dev/hda1
label = Debian
But lilo cannot 'see' the Debian partition when you are in Slackware, so it is looking in it's own local /boot/ directory for the Debian kernel and cannot find, hence the error.

I will add some comments on other ways of doing this below, but for now let's pursue this simplest way...

Two things must be satisfied to easily add the Debian boot to the Slackware managed lilo bootloader:

1. There must be a valid bootloader installed in the first 512 bytes of the Debian partition, /dev/hda9, capable of booting Debian when it is called.

2. There must be a valid 'other' stanza in the Slackware MBR bootloader to make the call to the Debian partition bootloader. This is called chain booting by the way.

FIRST:
The easiest way to install the bootloader on the Debian partition is to boot into Debian (ie, from CD or your M$ grub entry) and use it's own grub (or lilo) to install it's own bootloader to it's own partition (NOT MBR). Since you have grub already configured for Debian I suggested using it, but you could just as well use lilo with an entry like this...

#Title Debian GUN/Linux kernel 2.6.18-6-686
boot = /dev/hda9
image = /boot/vmlinuz-2.6.18-6-686
initrd /boot/initrd.img-2.6-18-6-686
root = /dev/hda9
label = Debian

The 'boot' line tells it where to install, the others tell it what to install. Running lilo under Debian with a lilo.conf based on this (you will need message and timeout options, etc.) will install a bootloader to /dev/hda9.

SECOND:
Once the bootloader has been installed to the Debian partition, you need to boot into Slackware and add a chain boot to the Debian partition, like this in your Slackware lilo.conf (in addition to your Slackware entries of course):

#Chain to Debian partition
other = /dev/hda9
label = Debian
Table = /dev/hda

Then run lilo from Slackware to install the MBR bootloader...

Now when you boot you will get the Slackware and M$ options along with the Debian option. If you choose Debian it will use the bootloader from /dev/hda9 to boot Debian.

As I said that is the easy way that should keep you safe from ending up with an unbootable system.

Now, you CAN add a more complex Debian boot directly from Slackware by temporarily mounting the Debian partition and using a lilo stanza that points to the mount point (something like this - but this is not intended to be copied and pasted!)...

image = /mnt/tmp/boot/vmlinuz-2.6.18-6-686
initrd = /mnt/tmp/boot/initrd.img-2.6-18-6-686
map = /mnt/tmp/boot/map_deb
root = /dev/hda9

The important thing to note is that lilo must have access to the kernel and initrd files when it installs - not just the device path like /dev/hda9. It actually uses the physical location on the spinning disk to generate the bootloader because at boot time it has no knowledge of any filesystem or path - it loads the kernel by absolute location on the media.

I use both methods - 'all-in-MBR' and 'chain loading', and chain loading is much easier to manage and less likely to result in an unbootable system. I am also a lilo fanboy :-) and find it much easier to manage when changing OSs and partition mapping and dare I say, more reliable than grub, but that is just my opinion. BUT - lilo requires some knowledge of how it all works... time well spent learning!

Hope this helps, remember the steps, 1 - Install Debian bootloader on /dev/hda9 , 2 - Add 'other' = /dev/hda9 to slackware lilo.conf and install - guaranteed to work...
 
Old 10-14-2008, 12:14 AM   #12
kcynice
Member
 
Registered: Sep 2008
Posts: 94

Original Poster
Rep: Reputation: 16
but now, i have just modified my original slack entrance,i modified root /dev/hda8 to /dev/hda9 and installed lilo by 'lilo' command with no error. Unfortunately, i restart my computer, i select slackware entrance and boot my debian successfully. But the new problem is that, i have no way to enter my slackware again!
If i still want to use lilo and slackware, should i enter debian and install lilo in debian?
 
Old 10-14-2008, 12:21 AM   #13
astrogeek
Senior Member
 
Registered: Oct 2008
Distribution: Slackware: 12.1, 13.1, 14.1, 64-14.1, -current, FreeBSD-10
Posts: 2,026

Rep: Reputation: 789Reputation: 789Reputation: 789Reputation: 789Reputation: 789Reputation: 789Reputation: 789
Quote:
Originally Posted by kcynice View Post
but now, i have just modified my original slack entrance,i modified root /dev/hda8 to /dev/hda9 and installed lilo by 'lilo' command with no error. Unfortunately, i restart my computer, i select slackware entrance and boot my debian successfully. But the new problem is that, i have no way to enter my slackware again!
If i still want to use lilo and slackware, should i enter debian and install lilo in debian?
I am not sure what you mean, but if you just changed root=/dev/hda8 to root=/dev/hda9 then you are very likely booted into your Debian filesystem with your Slackware kernel... run uname to verify your kernel and look at your filesystem to verify where you actually are.

It doesn't work like that.

Verify what you have running and post back... but don't make any changes until you are sure what effect it will have.
 
Old 10-14-2008, 01:02 AM   #14
astrogeek
Senior Member
 
Registered: Oct 2008
Distribution: Slackware: 12.1, 13.1, 14.1, 64-14.1, -current, FreeBSD-10
Posts: 2,026

Rep: Reputation: 789Reputation: 789Reputation: 789Reputation: 789Reputation: 789Reputation: 789Reputation: 789
Make no changes until you know what the effect will be...

kcynice, I have to go off for now and will not be back for about 12 hours.

From your last post and description of your system, I suspect that your boot is now 'confused' - I know I am.

As long as your partitions are not changed and nothing is moved or reinstalled you can recover and have your multiboot system - but if you change bootloader parameters without good understanding of their effect you could end up with an unbootable system.

Please re-read my previous post and Google for some lilo info and read the man pages to try to get your understanding of it on more solid ground. But resist the temptation to try things if your system is still bootable until you have a clear path to get it straightened out again.

Until tomorrow...
 
Old 10-14-2008, 01:07 AM   #15
kcynice
Member
 
Registered: Sep 2008
Posts: 94

Original Poster
Rep: Reputation: 16
my original slackware entrance in lilo.conf is:

image = /boot/vmlinuz
root = /dev/hda8
label = Linux
read-only

as i said, my debian lays on /dev/hda9. I just modified 'root = /dev/hda8' to 'root = /dev/hda9'. After i restarted my system, i entered the original choice, i found it seems like debian because the bash prompt string was the debian's. I don't know how to do it now.

It seems that i use slackware's kernel but use debian's partition.

Last edited by kcynice; 10-14-2008 at 01:11 AM.
 
  


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
multibooting simcox1 Mandriva 4 07-13-2005 11:36 AM
Multibooting How-To RodimusProblem LinuxQuestions.org Member Success Stories 3 02-22-2005 06:06 AM
Multibooting different Linuces and lilo Burgin Linux - Newbie 1 04-30-2004 01:53 PM
Problem with Lilo not updating (yes I ran lilo after changing the conf) webguy Linux - General 2 06-24-2001 08:12 PM
Swapping Drive Letters in Windows while multibooting with LILO akfnphx2 Linux - General 2 05-27-2001 08:34 AM


All times are GMT -5. The time now is 01:02 AM.

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