Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

LILO guru, anyone???

1 view
Skip to first unread message

Lars

unread,
Sep 23, 2004, 8:18:18 PM9/23/04
to
Hi,

I am trying setup a fairly automated linux installation procedure
that uses a Linux "installation server" where I simply connect a
blank IDE disk as /dev/hdc and run a script that partitions,
formats, installs the FS, etc.

All is working very well except for LILO: Is there a way to
install LILO on a harddisk that is currently mounted as /dev/hdc
so that it will work when the harddisk is moved to /dev/hda?

In other words, the disk is at /dev/hdc during the installation,
but after that it will be moved to the new computer and become
/dev/hda. I am trying to accomplish this without having to boot
from CD or floppy and run lilo manually on the new computer.

-------------------------------
# Start LILO global section
boot = /dev/hda
message = /boot/boot_message.txt
#prompt
timeout = 100
# Override dangerous defaults that rewrite the partition table:
change-rules
reset
vga = normal
# End LILO global section
# Linux bootable partition config begins
image = /boot/vmlinuz
root = /dev/hda2
label = Linux
read-only
# Linux bootable partition config ends
-------------------------------

Any help would be very much appreciated!

Thanks,

Lars


Bit Twister

unread,
Sep 23, 2004, 8:27:25 PM9/23/04
to
On Fri, 24 Sep 2004 00:18:18 GMT, Lars wrote:
> Hi,
>
> I am trying setup a fairly automated linux installation procedure
> that uses a Linux "installation server" where I simply connect a
> blank IDE disk as /dev/hdc and run a script that partitions,
> formats, installs the FS, etc.
>
> All is working very well except for LILO: Is there a way to
> install LILO on a harddisk that is currently mounted as /dev/hdc
> so that it will work when the harddisk is moved to /dev/hda?

Never tried it myself,
Create an install.conf which has the hdc mount point then use the -C
and -b arguments to lilo.

example if hdc mount point was /md101rc1

image=/md101rc1/boot/vmlinuz
label="md10_1_rc1"
root=/dev/hdc6
initrd=/md101rc1/boot/initrd.img
append="devfs=nomount resume=/dev/hdb1 splash=0"
vga=788
read-only

the try lilo -v -C /etc/install.conf -b /dev/hdc

Message has been deleted

William Park

unread,
Sep 23, 2004, 9:12:23 PM9/23/04
to


You may be able to piece together something from Google search on
<abem73$hqmfj$1...@ID-99293.news.dfncis.de>
<bop1nb$1fm23u$1...@ID-99293.news.uni-berlin.de>

--
William Park <openge...@yahoo.ca>
Open Geometry Consulting, Toronto, Canada

Lars

unread,
Sep 23, 2004, 9:24:03 PM9/23/04
to

"Realto Margarino" <guym...@IMAmoron.org> wrote in message
news:BOJ4d.27520$pA.17...@news20.bellglobal.com...

> In alt.os.linux.slackware Lars <noe...@hotmail.com> wrote:
> > Hi,
> >
> > I am trying setup a fairly automated linux installation procedure
> > that uses a Linux "installation server" where I simply connect a
> > blank IDE disk as /dev/hdc and run a script that partitions,
> > formats, installs the FS, etc.
> >
> > All is working very well except for LILO: Is there a way to
> > install LILO on a harddisk that is currently mounted as /dev/hdc
> > so that it will work when the harddisk is moved to /dev/hda?
> >
> > In other words, the disk is at /dev/hdc during the installation,
> > but after that it will be moved to the new computer and become
> > /dev/hda. I am trying to accomplish this without having to boot
> > from CD or floppy and run lilo manually on the new computer.
>
> From bash type:
> rdev /dev/hdc? /dev/hda?
>
> where ? is the device number.

Thanks for your fast reply!

Ok, I tried:
"rdev /dev/hdc2 /dev/hda2" and then "lilo -r /mnt -C /etc/lilo.conf"
but I get:
"Warning: The boot sector and map file are on different disks."

When trying to boot, I get:
"LILO 22.5.9 Loading Linux......"
"LILO 22.5.9 Loading Linux"
and then it hangs.

What did I do wrong / any suggestions?

Thanks,
Lars

Bit Twister

unread,
Sep 23, 2004, 9:43:50 PM9/23/04
to
On Fri, 24 Sep 2004 01:24:03 GMT, Lars wrote:

> "rdev /dev/hdc2 /dev/hda2" and then "lilo -r /mnt -C /etc/lilo.conf"
> but I get:
> "Warning: The boot sector and map file are on different disks."
>
> When trying to boot, I get:
> "LILO 22.5.9 Loading Linux......"
> "LILO 22.5.9 Loading Linux"
> and then it hangs.
>
> What did I do wrong / any suggestions?

Hmmm, missing map line in lilo.conf?
Why no initrd line ?

Snippet from my Mandrake 10 Official follows:

boot=/dev/hda
map=/boot/map
install=menu
default="md10oe"
keytable=/boot/us.klt
prompt
nowarn
timeout=50
message=/boot/message
menu-scheme=wb:bw:wb:bw
image=/boot/vmlinuz
label="md10oe"
root=/dev/hdb9
initrd=/boot/initrd.img
append="devfs=mount acpi=force resume=/dev/hdb1 splash=0"
vga=788
read-only

Lars

unread,
Sep 23, 2004, 10:06:39 PM9/23/04
to

"Bit Twister" <BitTw...@localhost.localdomain> wrote in message
news:slrncl6uul.g...@wb.home.invalid...

> On Fri, 24 Sep 2004 01:24:03 GMT, Lars wrote:
>
> > "rdev /dev/hdc2 /dev/hda2" and then "lilo -r /mnt -C /etc/lilo.conf"
> > but I get:
> > "Warning: The boot sector and map file are on different disks."
> >
> > When trying to boot, I get:
> > "LILO 22.5.9 Loading Linux......"
> > "LILO 22.5.9 Loading Linux"
> > and then it hangs.
> >
> > What did I do wrong / any suggestions?
>
> Hmmm, missing map line in lilo.conf?
> Why no initrd line ?

Thanks for your reply. The map is default to /boot/map and I am
not using an initrd. The lilo.conf file I posted works just fine when
I run /sbin/lilo with the harddisk on /dev/hda.

What I am having a hard time with is installing LILO when the disk
is on /dev/hdc in such a way that it can be moved to /dev/hda
without having to re-run /sbin/lilo.

/ Lars


Rich Grise

unread,
Sep 23, 2004, 10:12:23 PM9/23/04
to
On Thursday 23 September 2004 06:24 pm, Lars did deign to grace us with the
following:

> "Realto Margarino" <guym...@IMAmoron.org> wrote in message
>> In alt.os.linux.slackware Lars <noe...@hotmail.com> wrote:
>> > Hi,
...

>> > In other words, the disk is at /dev/hdc during the installation,
>> > but after that it will be moved to the new computer and become
>> > /dev/hda. I am trying to accomplish this without having to boot
>> > from CD or floppy and run lilo manually on the new computer.
>> From bash type:
>> rdev /dev/hdc? /dev/hda?
>> where ? is the device number.
> Thanks for your fast reply!
> Ok, I tried:
> "rdev /dev/hdc2 /dev/hda2" and then "lilo -r /mnt -C /etc/lilo.conf"
> but I get:
> "Warning: The boot sector and map file are on different disks."
>
> When trying to boot, I get:
> "LILO 22.5.9 Loading Linux......"
> "LILO 22.5.9 Loading Linux"
> and then it hangs.
>
> What did I do wrong / any suggestions?
>
I hope I'm not totally out in left field, but after doing LILO, which
incidentally, I get the same message when I put LILO to floppy, then
trying to boot, are you trying to boot the drive _as_ hda, I mean,
plugged into the other adapter and all?

Just a thought.

Good Luck!
Rich

Message has been deleted

Lars

unread,
Sep 23, 2004, 10:29:05 PM9/23/04
to
> > When trying to boot, I get:
> > "LILO 22.5.9 Loading Linux......"
> > "LILO 22.5.9 Loading Linux"
> > and then it hangs.
> >
> > What did I do wrong / any suggestions?
> >
> I hope I'm not totally out in left field, but after doing LILO, which
> incidentally, I get the same message when I put LILO to floppy, then
> trying to boot, are you trying to boot the drive _as_ hda, I mean,
> plugged into the other adapter and all?

Thanks, but yes I physically move it over to the primary IDE cable.

/ Lars


Lars

unread,
Sep 23, 2004, 10:40:55 PM9/23/04
to
>
> Sorry, my mistake. It should be:
>
> rdev /whatever/path/vmlinuz /dev/hda2.
>
> That will make the vmlinuz image file bootable on /dev/hda2/ where
> it was once bootable on /dev/hdc2

That makes more sense. So with your approach:
1) Run /sbin/lilo with a lilo.conf that has
boot=/dev/hdc
root=/dev/hdc2

2) rdev (path to kernel) /dev/hda2.

3) Move disk from /dev/hdc to /dev/hda

I will try that. Meanwhile, I came up with a similar solution that
seems to work:

1) "/sbin/lilo -r /mnt -C /etc/lilo_inst.conf " The file lilo_inst.conf has:
boot=/dev/hdc
root=/dev/hda2
(The regular /etc/lilo.conf is untouched [boot=/dev/hda, root=hda2])

2) Move disk from /dev/hdc to /dev/hda

I tried my procedure, and it seems to work. The only concern I have
is some warnings during boot (the lines below repeats three times):
hda: dma_intr: error=0x84 { DriveStatusError BadCRC }
hda: dma_intr: status=0x51 { DriveReady SeekComplete Error }

Also, the first boot it always claims the disk has not been fsck:ed for
49782 days (or something) and forces a check. Odd...

I have not yet had time to try with a different disk, but I do not
recall having this problem with this disk earlier.

Do you (or anyone) see any problem with my procedure above?

Thanks,
Lars

Message has been deleted

Eric Moors

unread,
Sep 24, 2004, 2:09:43 AM9/24/04
to
Lars wrote:

I am not completely sure but I guess this would work:

-------------------------------
# Start LILO global section

boot = /dev/hdc


message = /boot/boot_message.txt
#prompt
timeout = 100
# Override dangerous defaults that rewrite the partition table:
change-rules
reset
vga = normal

disk=/dev/hdc
bios=0x80

# End LILO global section
# Linux bootable partition config begins
image = /boot/vmlinuz
root = /dev/hda2
label = Linux
read-only
# Linux bootable partition config ends
-------------------------------

success,

Eric

joseph philip

unread,
Sep 24, 2004, 9:56:06 AM9/24/04
to
No. There is no way to tell lilo to pretend that hdc will be used as hda.
Look at using GRUB. It's not so tightly bound to the disk geometry and ID.


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----

P.T. Breuer

unread,
Sep 24, 2004, 10:12:46 AM9/24/04
to
In alt.os.linux joseph philip <jos...@nntp.will.suffice> wrote:
> No. There is no way to tell lilo to pretend that hdc will be used as hda.

Ys ther eis. You can tell it what disk to use, and what bios code
to use for that disk, separately. Whether that will actually work, I
don't know ... it depends on precisely what the code lilo writes to
the boot sector is, so it's in the domain of "suck it and see".

> Look at using GRUB. It's not so tightly bound to the disk geometry and ID.

?? Grub is incomprehensible.

Peter

Ivan

unread,
Sep 24, 2004, 10:36:40 AM9/24/04
to
On Fri, 24 Sep 2004 09:56:06 -0400, joseph philip wrote:

> No. There is no way to tell lilo to pretend that hdc will be used as hda.
> Look at using GRUB. It's not so tightly bound to the disk geometry and ID.

did you maybe read lilo how-to?
http://www.tldp.org/HOWTO/LILO-4.html


JohnInSD At san DOT rr dot COM

unread,
Sep 24, 2004, 10:38:17 AM9/24/04
to
If you use LILO 22.6 (current release) then with a full setup on /dev/hdc, and
the root partition mounted as /mnt/diskC. It is also a good idea to label the
filesystem (tune2fs), as then it may be referenced by label, no matter where
it is actually mounted.


> lilo -r /mnt/diskC -b /dev/hdc

The config file should specify the kernel relative to the root of the new
filesystem.

boot=/dev/hda # overridden on the command line
#map=/boot/map # this is the default
...
image=/boot/vmlinuz # /boot means /boot on /dev/hdc?
root="LABEL=new" # more general than root=/dev/hda?
# root=/dev/hda? # must use this if FS is not labeled
# hda? is where the FS will be mounted later


LILO is now much more general that GRUB, in that it does not determine BIOS
device codes until boot-time.


On Fri, 24 Sep 2004 00:18:18 GMT, "Lars" <noe...@hotmail.com> wrote:

>Hi,
>
>I am trying setup a fairly automated linux installation procedure
>that uses a Linux "installation server" where I simply connect a
>blank IDE disk as /dev/hdc and run a script that partitions,
>formats, installs the FS, etc.
>
>All is working very well except for LILO: Is there a way to
>install LILO on a harddisk that is currently mounted as /dev/hdc
>so that it will work when the harddisk is moved to /dev/hda?
>
>In other words, the disk is at /dev/hdc during the installation,
>but after that it will be moved to the new computer and become
>/dev/hda. I am trying to accomplish this without having to boot
>from CD or floppy and run lilo manually on the new computer.
>
>-------------------------------
># Start LILO global section
>boot = /dev/hda

Override on the command line. Good for when the disk is re-inserted as hda

>message = /boot/boot_message.txt
>#prompt
>timeout = 100

># Override dangerous defaults that rewrite the partition table:
>change-rules
> reset

Totally unnecessary.

>vga = normal

Why use the default setting?

># End LILO global section
># Linux bootable partition config begins
>image = /boot/vmlinuz
> root = /dev/hda2

Fine. But the LABEL syntax, above (requires LILO 22.6) is more general.
Older versions of LILO did not support the LABEL syntax directly, but could do
the same thing with:

append = "root=LABEL=new"

Please note that the punctuation (quotes) will be different with this older
workaround.

> label = Linux
> read-only
># Linux bootable partition config ends
>-------------------------------
>
>Any help would be very much appreciated!
>
>Thanks,
>
>Lars
>

--John

Bit Twister

unread,
Sep 24, 2004, 11:23:55 AM9/24/04
to
On Fri, 24 Sep 2004 14:38:17 GMT, JohnInSD At san DOT rr dot COM wrote:
>
> boot=/dev/hda # overridden on the command line
> #map=/boot/map # this is the default
> ...
> image=/boot/vmlinuz # /boot means /boot on /dev/hdc?
> root="LABEL=new" # more general than root=/dev/hda?
> # root=/dev/hda? # must use this if FS is not labeled
> # hda? is where the FS will be mounted later
>
>
> Fine. But the LABEL syntax, above (requires LILO 22.6) is more general.
> Older versions of LILO did not support the LABEL syntax directly, but could do
> the same thing with:
>
> append = "root=LABEL=new"
>
> Please note that the punctuation (quotes) will be different with this older
> workaround.

If you are going to suggest the label feature, you should at least
tell them how to label the partition. man e2label

Lars

unread,
Sep 24, 2004, 12:14:34 PM9/24/04
to
Works fine now.

Thanks a lot to everybody for all helpful replies!

/ Lars


Bit Twister

unread,
Sep 24, 2004, 1:20:33 PM9/24/04
to
On Fri, 24 Sep 2004 16:14:34 GMT, Lars wrote:
> Works fine now.
>
> Thanks a lot to everybody for all helpful replies!

How sad that you did not provide the solution for people using goolge.

Lars

unread,
Sep 24, 2004, 2:35:25 PM9/24/04
to
"Bit Twister" <BitTw...@localhost.localdomain> wrote in message
news:slrncl8lr1.r...@wb.home.invalid...

But of course I did! Look at my post from 9/23, 7.40 pm:
-------------------------


Meanwhile, I came up with a similar solution that seems to work:

1) "/sbin/lilo -r /mnt -C /etc/lilo_inst.conf " The file lilo_inst.conf has:
boot=/dev/hdc
root=/dev/hda2
(The regular /etc/lilo.conf is untouched [boot=/dev/hda, root=hda2])
2) Move disk from /dev/hdc to /dev/hda

-------------------------

And with all the later replies, there are at least three other similar
solutions that also works.

Here is the exact solution I decided to use, just for the record:
lilo -r $TARGET_MOUNT -b $TARGET_DISK -C /etc/lilo.conf -v

Where /etc/lilo.conf has:
boot = /dev/hda # Overridden by the -b above to /dev/hdc
root = /dev/hda2

Also, the dma errors (different problem altogether), I fixed with
append = "ide=nodma" in the kernel section.

And again, thanks for all the help!

/ Lars

joseph philip

unread,
Sep 25, 2004, 2:35:42 PM9/25/04
to
On Fri, 24 Sep 2004 16:12:46 +0200, P.T. Breuer wrote:

> In alt.os.linux joseph philip <jos...@nntp.will.suffice> wrote:
>> No. There is no way to tell lilo to pretend that hdc will be used as hda.
>
> Ys ther eis. You can tell it what disk to use, and what bios code
> to use for that disk, separately. Whether that will actually work, I
> don't know ... it depends on precisely what the code lilo writes to
> the boot sector is, so it's in the domain of "suck it and see".

I stand corrected. As always, I learn something new each day..

Lawrence DąOliveiro

unread,
Oct 5, 2004, 5:02:59 AM10/5/04
to
In article <PiL4d.1759$nj....@newssvr13.news.prodigy.com>,
"Lars" <noe...@hotmail.com> wrote:

>What I am having a hard time with is installing LILO when the disk
>is on /dev/hdc in such a way that it can be moved to /dev/hda
>without having to re-run /sbin/lilo.

This is just so easy with grub. I did this on my very first solo Linux
install.

Casaxa

unread,
Oct 5, 2004, 8:46:45 AM10/5/04
to

If I'm not wrong you MUST issu /sbin/lilo after every update
of the /etc/lilo.conf file

Lawrence DąOliveiro

unread,
Oct 5, 2004, 3:22:51 PM10/5/04
to
In article <pan.2004.10.05....@localhost.it>,
Casaxa <cas...@localhost.it> wrote:

Exactly. grub doesn't require this.

Bit Twister

unread,
Oct 5, 2004, 3:40:41 PM10/5/04
to

Yes, but lose the menu.lst file and see if you can still boot. :(

0 new messages