- Boot from an existing Linux distro or any live-cd
- Download the LFS LiveCD iso from http://www.linuxfromscratch.org/livecd/download.html
- Use exist Partition or make a new Partition of your harddisk (ERASING ALL DATA) with the command echo ",,b,*" | sfdisk /dev/sdX or we will know tool
- sdX should be replaced with the block device name of your harddisk (sda1 or hda1)
- Format the newly partitioned disk with mkfs.ext2 /dev/sdX1
- Create a folder for mounting the new disk with mkdir /mnt/lfs-hd
- Mount the new partition with mount /dev/sdX1 /mnt/lfs-hd
- Create a directory to mount the LFS LiveCD iso with the command mkdir /mnt/iso
- Mount the iso with the command mount -o ro,loop lfslivecd-x86-6.3-r2160.iso /mnt/iso
- Change lfslivecd-x86-6.3-r2160.iso to match the iso file you downloaded
- mkdir /mnt/lfs-hd/boot
- cp /mnt/iso/boot/isolinux/linux /mnt/lfs-hd/boot
- cp /mnt/iso/boot/isolinux/initramfs_data.cpio.gz /mnt/lfs-hd/boot
- Create a folder for mounting the root.ext2 ( It is compressed ext2 filesystem it will uncompressed to RAM and run as live lfs-cd ) with mkdir /mnt/rootfs
- Mount root.ext2 to /mnt/rootfs
- mount /mnt/iso/root.ext2 /mnt/rootfs -o loop
- Copy /mnt/rootfs file and folders to /mnt/lfs-hd
- cp -Rvf /mnt/rootfs/* /mnt/lfs-hd
- Use exist Linux grub bootloader file form step 17 or Create folder for bootloder
- mkdir /mnt/lfs-hd/boot/grub
- Copy stage1,stage2,fat_stage1_5 /mnt/lfs-hd/boot/grub
- cp /boot/grub/{stage1,stage2,fat_stage1_5} /mnt/lfs-hd/boot/grub
- Create a file named /mnt/lfs-hd/boot/grub/menu.lst with the following content
default 0
title LFS HD
root (hdX,Y)
kernel /boot/linux root=/dev/sdaX
initrd /boot/initramfs_data.cpio.gz
title Windows rootnoverify (hd0,0) chainloader +1
- Replace sdaX with your lfs harddisk some PC have hdaX (x is partition number).
- Replace sdaX with your lfs harddisk some PC have hdaX (x is partition number).
- Unmount your harddisk with umount /mnt/sdaX
- Start grub with the command grub
- Enter the grub command root (hdX,Y) it is root hard disk for the
- Enter the grub command setup (hdX).
- Note that you do NOT include the Y partition number
- Enter the grub command quit
- You are done. Try booting from the key now
Grub www.gnu.org/software/grub/manual/html_node/index.html
LFS-backup www.linuxfromscratch.org/hints/downloads/files/lfsbackup.txt
LFS-liveusb
http://www.rodneybeede.com/Booting_the_Linux_From_Scratch_LiveCD
_from_a_usb_key_drive.html
Rute-linux
http://rute.2038bug.com/node22.html.gz