Installing LFS on hd[x] for another machine

lanas lanas at securenet.net
Wed Feb 16 02:59:52 PST 2005


On Sat, 12 Feb 2005 18:14:54 -0500
kaladen <kaladen at cox.net> wrote:

> lanas wrote:

> > Thanks for the info.  The idea is, to prepare a hard disk that will
> > be used on another machine as sole hard disk, meaning that the
> > machine should boot immediately from that prepared disk without any
> > other configuration (i.e. by first booting from a CD, a floppy, USB
> > stick, etc...).

> I have done it.  Just setup grub as per chapter 8 using hd1,0 for the 
> root command, this tells grub which stage{1,2} files to use.  Use hd1 
> with setup, this installs the proper files to the MBR of the second
> lfs  disk.
> 
> When setting up menu.lst use:
> title ........
> root (hd0,0)
> kernel /boot/lfskernel-2.6.10 root=/dev/hda1
> 
> All of this assumes your root will be the first partition.

I have tried it.  Grub reported to find both stage 1 and 2 files, not
the one with ext2 in its name, and success initializing the disk hd1. 
But after many tries the disk thusly prepared didn't boot on the other
machine.

I've asked John Coffman (of lilo) and the following works very nicely:

- copy the lilo.conf from drive A to drive B, prune all non-necessary
  entries.  The first entry should be about how drive B will boot, where
  the root is, etc...  But always use hda to describe hdb.

- if creating a lilo.conf, a very basic one is OK, with again the
  correct information about drive B (treating it again as hda)

- mount drive B on /mnt/disk

- lilo -r /mnt/disk -b /dev/hdb

- take drive B out of the machine and put it in another machine and then
  boot this other machine with this disk.

On the other i'm not familiar with grub, but when trying pout the
above I've installed it on a machine and it works nicely and boots both
disks on the same machine, as well as Windows stuff.  I like the
possibility to edit on the fly boot options.  I'll take the time to read
its info files.

But in this very specific case lilo did resolve the problem.

The -r switch tells lilo to do a chroot before going on while the -b
switch tells it where to put the boot records.

Cheers,

Al



More information about the lfs-support mailing list