[SOLVED] My LFS system won't boot up after accidentally setting grub to hd1 instead of hd0
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.
at the grub menu press c for a grub prompt grub>
at the grub prompt
Code:
grub>set
post the following line
Code:
prefix=
In post 9 you say your mounting /dev/sda9 to /boot but according to your grub.cfg /dev/sda2 is the partition where your kernel is located not /dev/sda9
Which partition is suppose to be the / partition?
oh god i am only seeing this now
i actually set the root at hd1,6
here is the actual code:
Code:
cat > /boot/grub/grub.cfg << "EOF"
# Begin /boot/grub/grub.cfg
set default=0
set timeout=5
insmod ext2
set root=(hd1,6)
menuentry "GNU/Linux, Linux 5.10.17-lfs-10.1" {
linux /vmlinuz-5.10.17-lfs-10.1 root=/dev/sdb6 ro
}
EOF
everywhere i looked, the device name was sda, but for some reason mine is sdb (i have only one hdd). Back then i thought that hd0 = sda and hd1 = sdb, so i wrote hd1. Does this even matter?
also the insmod is set to ext2, but i set up /boot as ext4 in gparted. Again, does it even matter? as you can see i am total noob
Back then i thought that hd0 = sda and hd1 = sdb, so i wrote hd1. Does this even matter?
Yes, on some systems when a bootable usb is inserted before powering on, the internal drive will become hd1 instead of hd0, or there may be something else in your system for grub to see sda as hd1
Last edited by colorpurple21859; 05-18-2021 at 03:44 PM.
Yes, on some systems when a bootable usb is inserted before powering on, the internal drive will become hd1 instead of hd0, or there may be something else in your system for grub to see sda as hd1
can you please help me with an off topic question? i booted up from live cd and entered chroot, but for some reason the tools i built in previous chapter doesnt work, for example when i type make mrproper i get this:
Code:
bash: make: command not found
the path already includes :/usr/bin
mounted every device (including props, sys, run, tmpfs)
If the make command isn't found after chrooting into your system, you have made a mistake somewhere along the way. Most mistakes are made when exiting and/or re-entering chroot when you don't build lfs in one sitting. Running from live cd is even less forgiving as everything is ran/stored in ram on the live filsystem and lost when powering down, if it isn't stored on a mounted partition.
Last edited by colorpurple21859; 05-18-2021 at 06:10 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.