Linux From ScratchThis Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Just to clarify, I install the qrub as the same location as as that of the host?
When you reach the grub chapter you basically have 2 choices to consider:
1) Use the bootloader that your host has set up and add an entry for LFS. If you decide to do this then you can skip the grub chapters mentioned in the LFS book.
You do need to add an entry to Debian's grub configuration (run update-grub2 on your Debian box). You'll end up with a dual boot system (Debian and lfs in your case).
2) Install and configure grub as described by the LFS book.
This does have a possible down side: Debian's grub will be overwritten and become useless. If, on the other hand, Debian is only used as a temporary host (Debian will be removed once LFS is up and running) then you will have to build and configure grub as shown in the LFS book.
The configuration needs to be tailored to your needs/setup, you cannot just copy the current settings used by Debian.
2) Install and configure grub as described by the LFS book.
This does have a possible down side: Debian's grub will be overwritten and become useless. If, on the other hand, Debian is only used as a temporary host (Debian will be removed once LFS is up and running) then you will have to build and configure grub as shown in the LFS book.
The configuration needs to be tailored to your needs/setup, you cannot just copy the current settings used by Debian.
I wish to go by this option. So, shall I go on by installing grub to sda (or should it be sda1)?
I wish to go by this option. So, shall I go on by installing grub to sda (or should it be sda1)?
Thank you for the very clear explanation .
It should be installed to the MBR (disk) and not a partition.
If the disk is assigned to sda then you need to use grub-install /dev/sda.
You did mention this being done inside a VM, this might indicate that the disk assignment might be different (vda for example). Run df -h or fdisk -l on your Debian host to show what's being used. This info might also be handy for the construction of the /boot/grub/grub.cfg file.
Device Boot Start End Blocks Id System
/dev/sda1 * 1 973 7811072 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 973 1066 748545 5 Extended
/dev/sda3 1066 2610 12403161 83 Linux
/dev/sda5 973 1066 748544 82 Linux swap / Solaris
This is my partitioning scheme, so accordingly there's no problem and can use sda straightaway, I believe.
Also, for the grub.cfg file I'm a bit confused about some parts and their meanings.
Code:
cat > /boot/grub/grub.cfg << "EOF"
# Begin /boot/grub/grub.cfg
set default=0
set timeout=5
insmod ext2
set root=(hd0,2)
menuentry "GNU/Linux, Linux 3.8.1-lfs-7.3" {
linux /boot/vmlinuz-3.8.1-lfs-7.3 root=/dev/sda3 ro
}
EOF
As my LFS partition is sda3, I've modified the file accordingly. My problem is with the set root value. Is the current value correct?
LFS is using /dev/sda3 and I do not see a separate /boot partition:
Code:
cat > /boot/grub/grub.cfg << "EOF"
# Begin /boot/grub/grub.cfg
set default=0
set timeout=5
insmod ext2
set root=(hd0,3)
menuentry "GNU/Linux, Linux 3.8.1-lfs-7.3" {
linux /boot/vmlinuz-3.8.1-lfs-7.3 root=/dev/sda3 ro
}
EOF
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.