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.
Hi guys, so I recently just finished up an LFS project, but I'm having some trouble with GRUB. Background: my host system is Ubuntu, which is located on /dev/sda. My LFS project is on /dev/sdb. Here's my partition info:
Code:
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 1953523711 1953521664 931.5G 83 Linux
Device Start End Sectors Size Type
/dev/sdb1 2048 206847 204800 100M BIOS boot
/dev/sdb2 206848 4401151 4194304 2G Linux swap
/dev/sdb3 4401152 625142414 620741263 296G Linux filesystem
It might be worth noting that I set up my second drive as a GPT table.
But when I booted, the GRUB had somehow taken up the /dev/sda drive, and Ubuntu on /dev/sdb. Booting into /dev/sda got me to the GRUB login, but when clicking my LFS distro, it says that the partition is not found. Weirdly enough, going into the sdb drive somehow allowed me to enter the LFS distro, but the Ubuntu boot is there as well???
Here is my grub.cfg:
Code:
# Begin /boot/grub/grub.cfg
set default=0
set timeout=5
insmod ext2
set root=(hd1,3)
menuentry "GNU/Linux, Linux 4.15.3-nebula-8.2" {
linux /boot/vmlinuz-4.15.3-nebula-8.2 root=/dev/sdb3 ro
}
(I named my OS Nebula for funsies.)
So I guess my question is, what's going on, and how do I get everything to their right places?
If this is a uefi computer, mixing legacy booting with efi booting can cause this. Check your boot order in your bios.
at the lfs grub prompt hit c and then ls to see what the grub sees as the lfs drive/partition and change accordingly for lfs menu
Most easy way to go if you get to the end of (any) lfs-book at chapter 9.1
Code:
cat > /etc/lsb-release << "EOF"
LSB_VERSION="5.0"
DISTRIB_ID="Linux From Scratch"
...
Add the LSB_VERSION line and let update-grub of Ubuntu do your job of adding the lfs boot, it will be recognized and perfectly added to your grub boot menu
Doing the mentioned version number with respect to chapter LFS and Standards in the start of used lfs-book.
Note: you can skip all instructions about making a grub.cfg file in the lfs-book
I would like to add that Debian-based distros update their grub.cfg files fairly often when they do a general software update. This tends to interfere with the handwritten grub.cfg file that LFS uses. That's why it's probably better not to install GRUB in LFS at all when you have this kind of multiboot setup. The developers suggest that if you do, you should have a separate boot partition and transfer all your kernels and initrds onto it.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.