LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 04-27-2008, 10:25 AM   #1
raypen
Member
 
Registered: Jun 2002
Location: Midwest
Distribution: Slackware
Posts: 365

Rep: Reputation: 30
Installation of LILO on hdb mbr


I am getting ready to install Slack 12. I decided to place it
on a second hard drive (hdb). Swap and reiserfs partitions already
available from previous 10.2 install. HDA contains Win 2000.
Both OS's will boot from W2K's ntloader. LILO formerly installed
in the volume boot record (hdb2).

When asked where I want to install LILO, if I select mbr, will the
boot code be placed on the mbr of hdb or hda? I think it will use
hdb but I want to confirm before I screw up my entire boot structure.
 
Old 04-27-2008, 10:33 AM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
If hda is the Primary and hdb is the Slave hard drive, what will happen is that installing LILO to the MBR will write to hda.

Before installing anything, make a backup copy of the MBR on hda. If LILO overwrites the MBR of hda, you can easily restore the MBR from the backup copy (search these forums for info on using dd to make/restore MBR backups).

You could also simply disconnect hda before making the installation to hdb. That way, when you elect to install LILO to the MBR, it will install on hdb. Then reconnect hda and configure windows ntldr to boot Slackware.
 
Old 04-27-2008, 11:30 AM   #3
bgeddy
Senior Member
 
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810

Rep: Reputation: 232Reputation: 232Reputation: 232
If you choose the "expert" option of the lilo install program in Slackware installation and choose MBR it will prompt for the drive to install to. You may then choose /dev/hdb and setup ntloader to boot to this. (I've not tried this but it should work)

Personally I install lilo to my boot disk and let lilo handle all OS booting which works fine. It will detect and setup Windows booting for you.
 
Old 04-27-2008, 07:37 PM   #4
raypen
Member
 
Registered: Jun 2002
Location: Midwest
Distribution: Slackware
Posts: 365

Original Poster
Rep: Reputation: 30
As usual nothing seems to work as advertised.

I tried to install LILO using the expert option and I'm not sure
whether it gave me a choice of selecting the /dev/hdb mbr or not.
Seems all it did was configure lilo.conf. Somewhere in there I did
select mbr but the installation failed.

Now I am stuck with a partition full of the distribution with no way
to boot into it. I thought I would have been given the chance to create
a Syslinux boot disk, but all that is available now is a boot from
a USB key which I don't have.

I have tried using the old Slack 10.2 Syslinux boot disk but that gets
hung up on some raid stuff. I have also tried SystemRescueCD which cannot
boot into any file system other than ext2; I of course decided to use ext3.

The setup DVD won't let me change my configuration once the install
is complete and I see no tools on the DVD that would allow me to run
LILO from it.

What can I do now to get into the system to tun LILO?
 
Old 04-27-2008, 08:10 PM   #5
Eternal_Newbie
Member
 
Registered: Jun 2005
Location: The Pudding Isles
Distribution: Slackware
Posts: 573

Rep: Reputation: 59
to boot your system from the Slackware 12.0 install disk type this at the boot prompt
Code:
hugesmp.s root=/dev/hdb1 noinitrd ro
assuming your root partition is hdb1 of course.

This should boot you into your Slackware installation. Login and su to root and check that your /etc/lilo.conf is sane. Post it here if you are not sure. When you are satisfied, run /sbin/lilo to write lilo to wherever you want it to go.

I have a similar situation to you, 2 hard disks with the Linux partitions on the second. Below is my /etc/lilo.conf, generated by liloconfig as you can see. I used the simple, not advanced option. Sometimes advanced works best, sometimes simple, sometimes neither work properly. Basically, I got lucky.

In any case it is always best to check whether what liloconfig creates makes sense and rerun Lilo to see what messages Lilo spits out. I always get 2 warnings from Lilo because my root partition is on a different HDD from the MBR, this is normal for my configuration.

A lilo.conf for 2 HDD's with Linux on the second and Lilo written to the MBR on the first will look something like mine:
Code:
# LILO configuration file
# generated by 'liloconfig'
#
# Start LILO global section
boot = /dev/hda
message = /boot/boot_message.txt
prompt
timeout = 1200
# Override dangerous defaults that rewrite the partition table:
change-rules
  reset
# Normal VGA console
vga = normal
# VESA framebuffer console @ 1024x768x64k
# vga=791
# VESA framebuffer console @ 1024x768x32k
# vga=790
# VESA framebuffer console @ 1024x768x256
# vga=773
# VESA framebuffer console @ 800x600x64k
# vga=788
# VESA framebuffer console @ 800x600x32k
# vga=787
# VESA framebuffer console @ 800x600x256
# vga=771
# VESA framebuffer console @ 640x480x64k
# vga=785
# VESA framebuffer console @ 640x480x32k
# vga=784
# VESA framebuffer console @ 640x480x256
# vga=769
# End LILO global section
# Windows bootable partition config begins
other = /dev/hda1
  label = Windows
  table = /dev/hda
# Windows bootable partition config ends
# Linux bootable partition config begins
image = /boot/vmlinuz
  root = /dev/sda3
  label = Linux
  read-only
# Linux bootable partition config ends

Last edited by Eternal_Newbie; 04-27-2008 at 08:20 PM. Reason: clarified
 
Old 04-27-2008, 08:20 PM   #6
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,367

Rep: Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843
Boot using the install CD/DVD and at the "boot:" prompt type "hugesmp.s root=/dev/hdb1 rdinit= ro" (of course changing /dev/hdb1 to whatever the partition is that you installed Slackware on). It suggests this (to boot your system "in a pinch") on the install CD/DVD itself at the boot screen.

Then either run `liloconfig` as root or edit the /etc/lilo.conf file manually, and then run `lilo`. That should write to the MBR. It should be noted that the "boot =" line at the top determines which drive is written to when you run lilo -- since you want it to write to /dev/hdb, you should make it say "boot = /dev/hdb". Read `man lilo.conf` for more information on lilo.conf entries (and `man lilo` for more general lilo stuff). I think since your root partition would be mounted on /dev/hdb anyway the "boot =" line is not necessary (according to the man file), but it's a good idea to have it anyway. For an example lilo.conf I'll post mine below (edited to remove the entry for my custom compiled kernel):

Code:
boot = /dev/sda
message = /boot/boot_message.txt
prompt
timeout = 50
change-rules
  reset
vga=791

image = /boot/vmlinuz-generic-smp-2.6.21.5-smp
  initrd = /boot/initrd.gz
  root = /dev/sda1
  label = Linux
  read-only

image = /boot/vmlinuz-huge-smp-2.6.21.5-smp
  root = /dev/sda1
  label = Huge
  read-only
Note that you should change /dev/sda1 to point to your partition (/dev/hdb#). Note also that I am using a rather large framebuffer setting that you may wish to change -- try "vga = normal" instead of "vga=791" if you want to make sure it can boot (then you can play with framebuffer settings afterward if you want).

It should also be noted that to use the generic kernel, as I have included in my lilo.conf, you must create an initrd (instructions for doing so are in the /boot/README.initrd file). The huge kernel (the second entry) will boot fine without one, but isn't really intended for daily use (you can use it but I would recommend using the generic-smp kernel instead).

[edit]Beaten to the punch by a long shot. I should probably refresh the page before posting. [/edit]

Last edited by T3slider; 04-27-2008 at 08:29 PM.
 
Old 04-27-2008, 09:26 PM   #7
nutronix
Member
 
Registered: Jan 2003
Location: montreal
Distribution: Slackware and Debian
Posts: 139
Blog Entries: 1

Rep: Reputation: 20
Once you boot your system using the slackware install dvd and if you do not want do overwrite your /hda/mbr why not install lilo on a floppy ... assuming you have a floppy drive....?

What i would do though is install the Grub boot loader which i find more flexible ;
and grub is not affected by kernel upgrades,,,and can also be installed on a floppy;
You will find the grub package in extra on the dvd or you can download it from slackware.

I would not worry over your windows boot loader....plenty of information on the web about restoring your mbr...

PS; i had issues on one of my machines , lilo would fail to install , i had to use the -P option i think...anyways if you run liloconfig from the console it will give you the exact error message....good luck
 
Old 04-27-2008, 10:27 PM   #8
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,367

Rep: Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843
Although GRUB definitely is more flexible (I prefer the simplicity of LILO but also like the features of GRUB, so it's a toss-up for me) apparently some people have had trouble using an initrd with GRUB for the latest Slackware kernels...though that may be user error (though the same mkinitrd commands seemed to work for LILO, so who knows). Also, I don't think the features of GRUB really merit adding it to a system when LILO's already there by default -- but that's just my opinion. As said above, it is easily possible to write to /dev/hdb instead of /dev/hda (so as to preserve the Windows bootloader), or you can always install LILO on /dev/hda and let it take care of things (that would be my choice, but it's not my system). If you find that, after installing LILO to /dev/hda (if you choose to do so), you still prefer having Windows' bootloader on /dev/hda (you prefer it for some reason) you can always fix it by using "FIXMBR", as explained here: http://www.techzonez.com/forums/showthread.php?t=3975 (assuming it's Windows XP -- for other versions there are similar if not identical procedures).
 
Old 04-27-2008, 11:32 PM   #9
raypen
Member
 
Registered: Jun 2002
Location: Midwest
Distribution: Slackware
Posts: 365

Original Poster
Rep: Reputation: 30
Lots of great information; more than I've ever looked at before
since LILO has always been sort of an afterthought for me.

I'm about to boot from the install DVD as suggested above but have
a small question.

Isn't initrd automatic or should I specify noinitrd?

The filesystem should always be mounted "ro" but I'm not sure
what "rdinit=ro" is supposed to do unless that is in error.

Now that you've pointed me to all this good info, I have discovered
that the 2.6 kernels supposedly use the new "initramfs" which has
taken over for initrd. Should I be using this specification instead
of initrd?

Thanks for all your help.
 
Old 04-28-2008, 01:26 AM   #10
bgeddy
Senior Member
 
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810

Rep: Reputation: 232Reputation: 232Reputation: 232
If you look at the messages displayed when booting from the DVD it recommends typing:

Code:
hugesmp.s root=/dev/hda rdinit=ro
to boot to a newly installed Slackware partition. Here you should swap /dev/hdb for /dev/hda as you have installed to a second disk as instructed by T3slider

You may then get lilo working as previously instructed.

Don't worry about initial ram disks until you get a bootable system and then the file /boot/README.initrd will give instructions.

If liloconfig doesn't work for you you will have to manually edit /etc/lilo.conf and run lilo yourself. This isn't difficult however.
 
Old 04-28-2008, 04:13 PM   #11
raypen
Member
 
Registered: Jun 2002
Location: Midwest
Distribution: Slackware
Posts: 365

Original Poster
Rep: Reputation: 30
Booted fine from install DVD with:
Code:
 hugesmp.s root=/dev/hdb2 rdinit= ro
Lilo.conf from install had everything setup correctly except
boot= /dev/hdb2. Don't know why this didn't work to put the boot
code in the volume boot record, but it simply wouldn't work.

I changed it to /dev/hdb and reran lilo. Everything seemed to work
fine until I tried to boot regularly. Had quite a scare when I looked
at bootsect.lnx on he Win2K partition and it was all 0's. I thought
I had destroyed the boot sector and partition table of the
second hard drive.

I could have sworn I copied /dev/hdb to bootsect.lnx after I finished
running lilo. Was all set to copy the backup mbr I made before
installing to at least reconstitute the partition tale. Luckily, I
resisted that temptation and once again booted from the install DVD
and copied both /dev/hdb and /dev/hdb2 boot sectors and got them to
a hex editor. Turns out, /dev/hdb had the correct boot code and a
partition table and it was /dev/hdb2 that contained all 0's,
which is, of course, how it should be.

Copied the correct boot sector info into bootsect.lnx and booted
successfully from the HD.

I thought that lilo was not working correctly and would not write
the boot code to the mbr of the second hard drive. I looked all
over the net trying to find the correct switches to use with lilo
to make this work. I was set to try lilo -v -v and lilo -M which
I think are either incorrect or belong to past versions of lilo.

It's been a real education and I'm happy to say that the simplest
way to create the proper boot configuration is simply to run lilo
with the correct settings in lilo.conf.

Thanks again for all your help!
 
  


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
Installation Questions: GRUB / LILO / RAID Config & MBR Zaphod98 Linux - General 1 09-09-2004 12:32 PM
LILO on root hdb, is this possible? Mr Marmmalade Linux - Newbie 6 05-13-2004 04:40 AM
hda or hdb - lilo config Assassin Linux - Newbie 4 12-01-2003 08:31 PM
mbr had over write so lilo is gone how to rewrite lilo to mbr mch Linux - Software 4 10-25-2002 02:55 PM
MBR, LILO and Linux Installation CtrlAltDel Linux - Distributions 4 12-07-2001 03:19 PM

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

All times are GMT -5. The time now is 10:57 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
Open Source Consulting | Domain Registration