LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This 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


Reply
  Search this Thread
Old 12-14-2021, 07:13 PM   #16
bayou self
Member
 
Registered: Sep 2018
Location: Louisiana
Distribution: Debian 11.1 (bullseye)
Posts: 81

Original Poster
Rep: Reputation: Disabled

I got in!
Code:
grub> linux (hd1,2)/boot/vmlinuz-5.13.12-lfs-11.0 root=/dev/sda4
 
Old 12-14-2021, 07:23 PM   #17
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,365

Rep: Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591
Thats good, looks like you may have a boot parition.
another command that may work
Code:
configfile (hd1,2)/boot/grub/grub.cfg
or
Code:
configfile (hd1,1)/efi/debian/grub.cfg

Last edited by colorpurple21859; 12-14-2021 at 07:27 PM.
 
1 members found this post helpful.
Old 12-14-2021, 07:35 PM   #18
bayou self
Member
 
Registered: Sep 2018
Location: Louisiana
Distribution: Debian 11.1 (bullseye)
Posts: 81

Original Poster
Rep: Reputation: Disabled
Thank you very much, colorpurple21859!
I'm sure I'll have more questions tomorrow!
 
Old 12-14-2021, 07:39 PM   #19
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,365

Rep: Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591
You're Welcome
 
Old 12-15-2021, 07:53 AM   #20
bayou self
Member
 
Registered: Sep 2018
Location: Louisiana
Distribution: Debian 11.1 (bullseye)
Posts: 81

Original Poster
Rep: Reputation: Disabled
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
 
Old 12-15-2021, 08:18 AM   #21
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,365

Rep: Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591
Quote:
prefix=(hd0,msdos1)/grub/grub
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.
 
1 members found this post helpful.
Old 12-15-2021, 09:19 AM   #22
bayou self
Member
 
Registered: Sep 2018
Location: Louisiana
Distribution: Debian 11.1 (bullseye)
Posts: 81

Original Poster
Rep: Reputation: Disabled
efibootmgr
Code:
BootCurrent: 0001
Timeout: 0 seconds
BootOrder: 0001,0003,0009,000A,0000,0002
Boot0000  ubuntu
Boot0001* debian
Boot0002  DEB
Boot0003* LFS
Boot0009  Onboard NIC (IPV4)
Boot000A  Onboard NIC (IPV6)
 
Old 12-15-2021, 09:27 AM   #23
bayou self
Member
 
Registered: Sep 2018
Location: Louisiana
Distribution: Debian 11.1 (bullseye)
Posts: 81

Original Poster
Rep: Reputation: Disabled
/etc/fstab
Code:
#file system   mount-point    type     options               dump    fsck order
/dev/sda4          /          ext4     defaults               1         1
/dev/sda3        swap         swap     pri=1                  0         0
proc             /proc        proc     nosuid,noexec,nodev    0         0
sysfs            /sys         sysfs    nosuid,noexec,nodev    0         0
devpts           /dev/pts     devpts   gid=5,mode=620         0         0
tmpfs            /run         tmpfs    defaults               0         0
devtmpfs         /dev         devtmpfs mode=0755,nosuid       0         0
 
Old 12-15-2021, 10:10 AM   #24
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,365

Rep: Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591
Is the fstab debian or lfs?
Are you able to boot into debian with post 21?
post the output of
Code:
df -h
lsblk -f
 
1 members found this post helpful.
Old 12-15-2021, 10:56 AM   #25
bayou self
Member
 
Registered: Sep 2018
Location: Louisiana
Distribution: Debian 11.1 (bullseye)
Posts: 81

Original Poster
Rep: Reputation: Disabled
The fstab was LFS.

I was not able to boot into debian per Post #21.
When I typed it as is, it showed `hd1,2 not found'.
When I substituted hd0 for hd1, it froze.

Code:
df -h
/dev/root    /
devtmpfs     /dev
tmpfs        /run
Code:
lsblk -f
sda1  vfat   FAT32
sda2  ext4   1.0
sda3  swap   1        [SWAP]
sda4  ext4   1.0      /
 
Old 12-15-2021, 11:01 AM   #26
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,365

Rep: Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591
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.
 
1 members found this post helpful.
Old 12-15-2021, 11:16 AM   #27
bayou self
Member
 
Registered: Sep 2018
Location: Louisiana
Distribution: Debian 11.1 (bullseye)
Posts: 81

Original Poster
Rep: Reputation: Disabled
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
 
Old 12-15-2021, 12:45 PM   #28
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,365

Rep: Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591
boot into debian and as root run
Code:
grub-install
 
1 members found this post helpful.
Old 12-15-2021, 01:20 PM   #29
bayou self
Member
 
Registered: Sep 2018
Location: Louisiana
Distribution: Debian 11.1 (bullseye)
Posts: 81

Original Poster
Rep: Reputation: Disabled
Yes, sir!
Code:
bash-5.1# sudo grub-install
Installing for x86_64-efi platform.
Installation finished. No error reported.
bash-5.1#
 
Old 12-15-2021, 02:18 PM   #30
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,365

Rep: Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591
Did that fix the grub Problem for debian?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] No package 'x11' found No package 'xext' found No package 'xdamage' found No package 'xfixes' found No package 'x11-xcb' found Jigsaw Linux From Scratch 14 02-23-2021 08:35 PM
error: hd0 out of disk. (???) oznola Linux - General 7 06-27-2012 09:00 AM
[SOLVED] grub hd0,0 hd0,1 clarification for using single /boot partition zeebra Linux - General 2 02-28-2012 03:07 PM
Ubunutu 11.10 grub2 can boot but error hd0 no disk from bootable usb config help craig6398 Linux - Newbie 1 02-06-2012 05:10 AM
Fresh 11.4 usb hard drive install results hd0 out of disk grub console natlose Ubuntu 23 01-17-2012 10:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 08:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration