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
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
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
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
> "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
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
Just a thought.
Good Luck!
Rich
Thanks, but yes I physically move it over to the primary IDE cable.
/ Lars
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
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
-----= 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! =-----
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
> 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
> 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
If you are going to suggest the label feature, you should at least
tell them how to label the partition. man e2label
Thanks a lot to everybody for all helpful replies!
/ Lars
How sad that you did not provide the solution for people using goolge.
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
> 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..
>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.
If I'm not wrong you MUST issu /sbin/lilo after every update
of the /etc/lilo.conf file
Exactly. grub doesn't require this.
Yes, but lose the menu.lst file and see if you can still boot. :(