Installing LFS on hd[x] for another machine

kaladen kaladen at
Sat Feb 12 15:14:54 PST 2005

lanas wrote:
> On Sat, 12 Feb 2005 09:46:04 -0600
> William <kb0iic at> wrote:
> Hi,
>>For grub, just make a grub bootdisk with the instructions in the
>>book.  Install the drive in the other machine. Determine if you are
>>going to install it as {primary,secondary}/{master,slave} and make
>>note of it. Just boot from your floppy, if you have one, or use a live
>>cd since it is using grub, too, and then setup your drive just like in
>>the book but just changing the number ya use to locate the drive.
> 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...).
> So maybe what you described with the setup of the grub
> configuration from a floppy or CD can be done while the hard disk is
> still being prepared on the main computer (i.e. when it is still hdb
> and not hda). I'll give it a try.
> Any ideas are welcomed.
> Cheers,
> Al

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 

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.

The only problem with this is you cannot test the drive before moving it 
to the new computer.  If you have problems you have to move it back. 
You might want to try and setup your build computer's menu.lst with an 
additional boot entry similar to this:

# This entry is for the new LFS disk.
title LFS New Disk (or something you prefer)
root (hd1,0)
kernel /boot/lfskernel-2.6.10 root=/dev/hdb1

Then make sure your /etc/fstab entries use /dev/hdb.

When grub comes up select the new disk to make sure it boots and 
everything works properly.  If everything works change your /etc/fstab 
entries to /dev/hda.  Change the build computer menu.lst to remove 
reference to the second disk and move the second disk to the new computer.

More information about the lfs-support mailing list