LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 01-17-2009, 05:05 PM   #1
agrestic
Member
 
Registered: Jan 2009
Location: atlanta, ga, usa
Distribution: sabayon 5, slack64, Lenny, LFS 6.4 user # 20665
Posts: 61

Rep: Reputation: 16
how-to properly edit lilo to boot 2nd linux partition


Hi. Currently lilo.conf (relevant parts) looks like this:
Code:
append=" vt.default_utf8=0"
boot = /dev/sda
lba32
# Linux bootable partition config begins
image = /boot/vmlinuz
  root = /dev/sda1
  label = Slackware
  read-only

image = /boot/vmlinuz
  root = /dev/sda3
  label = Ubuntu
  read-only
The actual vmlinuz for ubuntu is (from the Slack partition) /ubuntu/boot/vmlinuz-2.6.27-9-generic. I tried that, but the computer froze while trying to load ubuntu; had to hold down the power button on the case. Same happened when I tried "/boot/vmlinuz-2.6.27-9-generic".
But while trying the above, in code tags, ubuntu started to boot without a gui, the screen flickered at the login prompt. There were 2 errors, or failures: something to do with "/sbin/mount.ntfs" failing to load, and the nvidia kernel module failing. It froze while displaying a low-resolution warning about not being able to load the nvidia driver. I have to either use the case's power button to shut down & restart, or Ctrl+Alt+Del before the low-res warning pops up.
Here's fstab:
Code:
/dev/sda2        swap             swap        defaults         0   0
/dev/sda1        /                ext3        defaults         1   1
/dev/sda3        /ubuntu          ext3        defaults         1   2
#/dev/cdrom      /mnt/cdrom       auto        noauto,owner,ro  0   0
/dev/fd0         /mnt/floppy      auto        noauto,owner     0   0
devpts           /dev/pts         devpts      gid=5,mode=620   0   0
proc             /proc            proc        defaults         0   0
tmpfs            /dev/shm         tmpfs       defaults         0   0
As an aside, I added the lba32 option because when I first tried /sbin/lilo it gave me the lba32 warning. Also, each time I edited lilo.conf, i ran /sbin/lilo. So idk what i'm doing wrong here.
Thanks for your time.

*****
EDIT: Regarding ubuntu entry. I read this post https://www.linuxquestions.org/quest...o-lilo-140452/ and thought I should change a couple things. I changed the 1st line to "image = /ubuntu/boot/vmlinuz-2.6.27-9-generic" & added "initrd = /ubuntu/boot/initrd.img-2.6.27-9-generic" below the 'label' line, but running /sbin/lilo gave me this warning:
Code:
Added Slackware *
Warning: The initial RAM disk is too big to fit between the kernel and
   the 15M-16M memory hole.  It will be loaded in the highest memory as
   though the configuration file specified "large-memory" and it will
   be assumed that the BIOS supports memory moves above 16M.
Added Ubuntu ?
One warning was issued.
The BIOS can't be too old -- Dell Inspiron 530 2.4Ghz quad. Should I try to reboot anyway?
Thanks.

Last edited by agrestic; 01-17-2009 at 05:31 PM. Reason: Updated attempts.
 
Old 01-17-2009, 05:32 PM   #2
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,987

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
IIRC Ubuntu uses an initrd so you have to have an initrd line in its lilo entry for starters. Note, slack doesn't use an initrd by default, ulike most other distros. The ubuntu entry should look something like:

Code:
image = /ubuntu/boot/vmlinuz
  root = /dev/sda3
  initrd = /ubuntu/boot/initrd.img
  label = Ubuntu
  read-only
I'm assuming that ubuntu has soft links, vmlinuz and initrd.img, to the actual ones which is pretty much standard. You can check that by running:

# ls -l /ubuntu/boot/
 
Old 01-17-2009, 05:40 PM   #3
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,269
Blog Entries: 24

Rep: Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196
Hi agrestic,

What is happening is that you are telling lilo to boot the buntu partition (/dev/sda3) using the Slackware kernel image which is /boot/vmlinuz at the time you run /sbin/lilo.

When you run lilo it translates the kernel image location into an absolute device independent location on the drive, because at boot time there is no such thing as /boot/vmlinuz and lilo has no knowledge of any filesystem.

So, you must use a path to the actual kernel image that lilo can find when you run /sbin/lilo, NOT when it is booting.

One way to do this, assuming the buntu kernel is on /dev/sda3 at /boot/vmlinuz and that you are running lilo while booted into Slackware on /dev/sda1, is to mount /dev/sda3 at some location like /mnt/tmp, then use the following lines in lilo.conf:

Code:
image = /mnt/tmp/boot/vmlinuz
  root = /dev/sda3
  label = Ubuntu
  read-only
Then when you run /sbin/lilo it will find the physical location on the drive for the buntu kernel and be able to load that at boot time.

Please note that this also assumes that buntu assigns the same partition order as Slackware, should not normally be a problem but be aware of it.

This should get you going quickly, but a better way would be to chain boot into buntu. To do that you would need to be able to boot into buntu and install it's own lilo to /dev/sda3 root partition, then add this to the Slackware lilo.conf:

Code:
other = /dev/sda3
label = Ubuntu
Then the MBR installed by Slackware lilo will be able to chain boot to the sda3 partition and find the boot record installed by buntu and boot it from there. This is usually the best way of booting multiple Linuxes IMO.
 
Old 01-17-2009, 05:45 PM   #4
agrestic
Member
 
Registered: Jan 2009
Location: atlanta, ga, usa
Distribution: sabayon 5, slack64, Lenny, LFS 6.4 user # 20665
Posts: 61

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by kilgoretrout View Post
# ls -l /ubuntu/boot/
Looks like I was posting an update as you answered. Great timing, eh? Thanks for the response.
 
Old 01-17-2009, 05:51 PM   #5
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,269
Blog Entries: 24

Rep: Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196
Quote:
Originally Posted by agrestic View Post
Looks like I was posting an update as you answered....
And I was posting as... well...

Changing the kernel path as you wrote in your EDIT does what I was suggesting in the first method of my own post.

As for the initrd thing, that would be naturally 'avoided' by the chain boot method as buntu would use it's own setup as normal but would simply place them in the boot sector of it's own root partition instead of the MBR, so it would see no problems. That is why I like chain booting - each Linux manages it's own boot record install except the first which manages the MBR. But whatever works best for you!
 
Old 01-17-2009, 05:55 PM   #6
agrestic
Member
 
Registered: Jan 2009
Location: atlanta, ga, usa
Distribution: sabayon 5, slack64, Lenny, LFS 6.4 user # 20665
Posts: 61

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by astrogeek View Post
One way to do this....is to mount /dev/sda3 at some location like /mnt/tmp, then use the following lines in lilo.conf:

Code:
image = /mnt/tmp/boot/vmlinuz
  root = /dev/sda3
  label = Ubuntu
  read-only
Thanks. Since /dev/sda3 is already mounted on /ubuntu, I should mount it like
Code:
$ mount -o bind /ubuntu /mnt/tmp
...right?
Quote:
Originally Posted by astrogeek View Post
...a better way would be to chain boot into buntu. To do that you would need to be able to boot into buntu and install it's own lilo to /dev/sda3 root partition, then add this to the Slackware lilo.conf:

Code:
other = /dev/sda3
label = Ubuntu
Then the MBR installed by Slackware lilo will be able to chain boot to the sda3 partition and find the boot record installed by buntu and boot it from there. This is usually the best way of booting multiple Linuxes IMO.
Awesome; many thanks. Once I get it running, that's the first thing I'll do.
 
Old 01-17-2009, 06:03 PM   #7
agrestic
Member
 
Registered: Jan 2009
Location: atlanta, ga, usa
Distribution: sabayon 5, slack64, Lenny, LFS 6.4 user # 20665
Posts: 61

Original Poster
Rep: Reputation: 16
Jahahaha! Wunderbar! I didn't even have to see that ugly ubuntu start-up graphic -- straight to the desktop. Thanks again! Now to install LILO.
 
Old 01-17-2009, 06:12 PM   #8
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,269
Blog Entries: 24

Rep: Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196
Quote:
Originally Posted by agrestic View Post
Thanks. Since /dev/sda3 is already mounted on /ubuntu, I should mount it like
Code:
$ mount -o bind /ubuntu /mnt/tmp
Or just change the image line in lilo.conf to /ubuntu/boot/vmlinuz if that is where it is mounted under Slackware.

[EDIT]
Just to be complete, when you are booted into buntu and ready to install it's boot record to it's own root partition, just edit it's lilo.conf and change...
Code:
boot = /dev/sda

to...

boot = /dev/sda3
Then run it's own /sbin/lilo and you should be all set!
[/EDIT]

Last edited by astrogeek; 01-17-2009 at 06:16 PM.
 
Old 01-17-2009, 06:35 PM   #9
agrestic
Member
 
Registered: Jan 2009
Location: atlanta, ga, usa
Distribution: sabayon 5, slack64, Lenny, LFS 6.4 user # 20665
Posts: 61

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by astrogeek View Post
[EDIT]
Just to be complete, when you are booted into buntu and ready to install it's boot record to it's own root partition, just edit it's lilo.conf and change...
Code:
boot = /dev/sda

to...

boot = /dev/sda3
Then run it's own /sbin/lilo and you should be all set!
[/EDIT]
Thanks, that's where I am now. ubuntu has lilo installed, but I had to create lilo.conf w/ correct permissions; running /sbin/lilo -b /dev/sda3 gave me
Code:
Warning: LBA32 addressing assumed
Fatal: No images have been defined.
Looks like I'll have to write lilo.conf myself.
 
Old 01-17-2009, 06:42 PM   #10
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,269
Blog Entries: 24

Rep: Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196
Quote:
Originally Posted by agrestic View Post
Looks like I'll have to write lilo.conf myself.
HA! I assumed lilo was configured under buntu. But no problem.

I am not a buntu user but it should have something like liloconfig or probably a GUI tool for generating an initial lilo.conf - or you can write one yourself very easily... just be sure not to install to MBR or you will wipe your Slackware boot record... but easy enough to recover as you can see now

Have fun!
 
Old 01-17-2009, 07:09 PM   #11
agrestic
Member
 
Registered: Jan 2009
Location: atlanta, ga, usa
Distribution: sabayon 5, slack64, Lenny, LFS 6.4 user # 20665
Posts: 61

Original Poster
Rep: Reputation: 16
Yeah, they use grub by default. I just used parts of the slackware lilo.conf, made sure (like you said) that boot = /dev/sda3. You're right about liloconfig; however, i couldn't use it b/c my fstab is still showing sda1 as windoze instead of slackware. I replaced XP a few hours ago cause my game Oblivion kept crashing. That's ok though; Oblivion runs under wine.
Anyhow, /sbin/lilo in ubuntu gave me that RAM warning; but when I updated slack's lilo.conf like you said it gave no more warnings.
Now I have what I wanted and learned a little about chainloading and bootloaders in the process; so I'm feelin' fat and happy.
Thanks again.
 
Old 01-17-2009, 07:26 PM   #12
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,269
Blog Entries: 24

Rep: Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196
Quote:
Originally Posted by agrestic View Post
Now I have what I wanted and learned a little about chainloading and bootloaders in the process; so I'm feelin' fat and happy.
Thanks again.
Glad to hear you got it going, and you are welcome!

FWIW, with the other = /dev/sda3 line in your Slackware lilo.conf, installed to the MBR, it really doesn't care what is installed on /dev/sda3 as long as it has a boot record. Consequently, you can install grub to the root partition from buntu and still happily boot to buntu from grub chained from the lilo MBR.
But it won't help with the weight problem, I've tried...
 
Old 01-27-2009, 11:52 AM   #13
agrestic
Member
 
Registered: Jan 2009
Location: atlanta, ga, usa
Distribution: sabayon 5, slack64, Lenny, LFS 6.4 user # 20665
Posts: 61

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by astrogeek View Post
...it won't help with the weight problem, I've tried...
Haha! Touche!
 
  


Reply



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
locate grub.conf on a separate /boot partition to edit in an additional kernel ktek Linux - Newbie 6 10-03-2008 08:21 PM
partition strattegy for XP on 1 HD and two linux on 2nd HD luizebs Linux - Software 2 12-28-2004 08:33 AM
edit windows boot ini to allow booting to lilo V_LESTAT Linux - Newbie 2 01-15-2004 06:58 PM
Adding 2nd Linux to LILO froedi Linux - Newbie 11 12-31-2003 05:34 AM
how to boot windows on 2nd harddrive using lilo? kublador Linux - Newbie 11 10-08-2003 09:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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

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
Open Source Consulting | Domain Registration