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.
I need to repair my grub. I'm typing from my screen to a laptop. Still cannot get back into Debian. Without the host system, I don't know how to effect any changes.
Here is the LFS grub.cfg file
Code:
grub> cat (hd0,2)/boot/grub/grub.cfg
# Begin /boot/grub/grub.cfg
set default=0
set timeout=5
insmod part_gpt
insmod ext2
set root=(hd0,4)
if loadfont /boot/grub/fonts/unicode.pf2; then
set gfxmode=auto
insmod all_video
terminal_output gfxterm
fi
menuentry "GNU/Linux, Linux 5.13.12-lfs-11.0" {
linux /boot/vmlinux-5.13.12-lfs-11.0 root=/dev/sda4 ro
}
menuentry "Firmware Setup" {
fwsetup
}
When I type
Code:
configfile (hd0,2)/boot/grub/grub.cfg
I am taken back to the opening menu.
Last edited by bayou self; 12-15-2021 at 07:57 AM.
Reason: more info
this is the location the grub bootloader is looking for the grub.cfg file. Grub counts drives from 0 and partitions from 1. If you copy the grub.cfg to this location should give you the grub menu.
This should allow you to boot into debian may have to change sdb2 to sda2 or sdc2
Code:
grub> insmod part_gpt
grub> linux (hd1,2)/vmlinuz root=/dev/sdb2
grub> initrd (hd1,2)/initrd.img
after booting into one of your systems, post the output of
Code:
efibootmgr
Last edited by colorpurple21859; 12-15-2021 at 08:33 AM.
when I originally posted 21, I left out insmod part_gpt, I went back and changed it. Did you try it after I corrected the error? That was based on post 15.
Last edited by colorpurple21859; 12-15-2021 at 11:02 AM.
I was able to get into debian (sort of) by substituting hd0 for hd1 in Post #21!
However, it says "/dev/sdb2 does not exist. Dropping to a shell!" My prompt is (initramfs)
I do not know how to copy grub.cfg to (hd0,msdos1)/grub/grub.
EDIT: I'm back into debian all the way, by substituting sda2 for sdb2.
Thank you so much!
I don't mind manually entering all the boot specifics, but I would still like to fix grub.
Last edited by bayou self; 12-15-2021 at 11:27 AM.
Reason: new info
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.