LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   A question about using lilo command at boot... (https://www.linuxquestions.org/questions/linux-newbie-8/a-question-about-using-lilo-command-at-boot-816021/)

trist007 06-23-2010 08:23 PM

A question about using lilo command at boot...
 
Found myself in an unusual situation. I installed Slackware 13.0 with the following setup:

Code:

sda1 1 TB hard disk /home
sdb1 500 GB /  ;which is also my boot partition and has MBR
sdb5 8 GB swap

So my lilo.conf uses the following:

Code:

boot=/dev/sdb
root=/dev/sdb1
image=/boot/vmlinuz

Ok here comes my situation.

I bought a Addonics 3 slot hard disk bay that fits in 2 5.25 inch bays. It's quite nice I might add. Anyhow, when I juiced in 3 1 TB hard disks. The problem is, when I boot up my computer, the 3 TB hard drives take up sdb, sdc, and sdd. My system partition which used to be sdb now has changed to hda. So during boot, I get a kernel panic because sdb1 is now one of those 1 TB hard drives.

So I'm at the boot screen and hit TAB to enter command line LILO mode. I tried putting in the following:

Code:

boot=/dev/hda
root=/dev/hda1
image=/boot/vmlinuz

but that didn't work.

So on this Addonics hd bay I can turn off the 3 hard disks, so then I can boot back up and have my system partition be sdb1 again. However, I'm not able to set lilo.conf to boot=/dev/hda and root=/dev/hda1. Whenever I try and run 'lilo -v' I get a fatal error because obviously hda does not exist at that time.

The Addonics hd bay took up my DVD drive slot so I don't have an optical drive in at the moment. If I really have to I can go and plug in the optical drive, which I know is one possible solution. However, I want to see if I can fix this via LILO command line.

What do you guys think?

grail 06-23-2010 09:07 PM

Well I am curious why you are changing from sdX to hdX?

If your kernel and system were discovering the original drive as sdX then use the same in your adjustments at the lilo prompt.
You should only need to set the first 2 items as the third is unchanged from the original.

halborr 06-23-2010 09:14 PM

Well, if I understand your question right, it sounds like you could set it back to a known boot state, change your lilo.conf, run lilo, and THEN change your setup.

Alternatively, you could hook up your optical drive and boot with the install cd, then chroot to your hard drive and do the previously mentioned changes (I've had to do this before, mostly when I messed up kernel compiles).

That's one downfall of LiLo: you can't define how to boot at the prompt.

trist007 06-25-2010 08:18 AM

Is grub more versatile in this respect?

saikee 06-25-2010 08:48 AM

You have to show us the output of
Code:

fdisk -l
Also if you change Lilo configuration in /etc/lilo.conf you must recompile it by command
Code:

lilo -b /dev/hda
If Lilo isn't happy with the new arrangement it would then tell you why.

You could change it to Grub1 or Grub2.

The easiest is to boot up any Linux with Grub1 inside, mount the Slackware partition (assumed it is hda1), copy two files into Slackware's /boot/grub, write your own menu.lst and do a setup

Step A - put Grub1 in Slackware

boot up a Linux with Grub1, like Mepis or Puppy (The Live CD may call hda1 as sda1 and make sure you know if Slackware is in the first bootable disk in the Bios. If not then make sure the boot loader knows it.)

copy Grub1 files across
Code:

su
mkdir /mnt/hda1
mount /dev/hda1 /mnt/hda1
mkidr /mnt/hda1/boot
mkdir /mnt/hda1/boot/grub
cp /boot/grub/stage* /mnt/hda1/boot/grub/
ls /mnt/hda1/boot/grub

if you see stage1 and stage2 inside then you are in business

Step B - Create your menu.lst
use an editor to create a file /mnt/hda1/boot/grub/menu.lst with following entries
Code:

title Slackware in hda1
root (hd0,0)
kernel /boot/vmlinuz ro root=/dev/hda1

Step C - Install Grub1 in MBR
Code:

grub
setup (hd0
quit

Let us know if you want Grub2 instead of Grub1.

halborr 06-26-2010 07:32 PM

Quote:

Originally Posted by trist007 (Post 4014719)
Is grub more versatile in this respect?

Yes. You can boot something that isn't even defined in the grub.conf I believe. It is very useful for someone who is constantly changing and tinkering.


All times are GMT -5. The time now is 10:03 AM.