how-to properly edit lilo to boot 2nd linux partition
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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:
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.
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:
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:
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.
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!
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
...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.
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]
Distribution: sabayon 5, slack64, Lenny, LFS 6.4 user # 20665
Posts: 61
Original Poster
Rep:
Quote:
Originally Posted by astrogeek
[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.
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
Distribution: sabayon 5, slack64, Lenny, LFS 6.4 user # 20665
Posts: 61
Original Poster
Rep:
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.
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...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.