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 04-28-2019, 07:22 PM   #1
drillsar
Member
 
Registered: Jan 2017
Posts: 144

Rep: Reputation: Disabled
Grub EFI Booting issues


OK I can't boot into my system and I dont know why. Could it be the HD number wrong or Partition number wrong?

Here is what I did:

My dev and partition info

I also have another hard drive which is /dev/sda but thats windows

/dev/sdb1 EFI
/dev/sdb2 Linux Partition

mount -vt vfat /dev/sdb1 /boot/efi

Installed Popt; Pciutils; Freetype2; dosfstools; EFIVAR-37; EFIBOOTMGR-14

Installed Grub2 with this:

./configure --prefix=/usr \
--sbindir=/sbin \
--sysconfdir=/etc \
--disable-efiemu \
--enable-grub-mkfont \
--with-platform=efi \
--target=x86_64 \
--program-prefix="" \
--with-bootdir="/boot" \
--with-grubdir="grub" \
--disable-werror

my /etc/fstab

/dev/sdb1 /boot/efi vfat defaults 0 2
/dev/sdb2 / ext4 defaults 1 1
efivarfs /sys/firmware/efi/efivars efivarfs defaults 0 1
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

# End /etc/fstab

Ran this:

grub-install --target=x86_64-efi --efi-directory=/boot/efi \
--bootloader-id=LFS --recheck --debug

Ran efibootmgr results:
Boot0001* LFS
Boot0005* Hard Drive
Boot0006 CD/DVD Drive
Boot0007 USB
Boot0008* UEFI: SanDisk

My grub.cfg:

# Begin /boot/grub/grub.cfg
set default=0
set timeout=5

insmod gzio
insmod part_gpt
insmod ext2
set root=(hd0, 1)
# hd[x] is the drive of the LFS partion and gpt[y] is the partition

insmod efi_gop
insmod efi_uga
insmod font
if loadfont /grub/unicode.pf2; then
loadfont /grub/unicode.pf2
set gfxmode=auto
insmod gfxterm
set gfxpayload=keep
terminal_output gfxterm
fi

menuentry "GNU/Linux, Linux <kernel name>" {
linux /boot/vmlinuz-4.20.12-lfs-8.4>; root=/dev/sdb2 ro
}

Did I miss something?

Last edited by drillsar; 04-28-2019 at 07:23 PM.
 
Old 04-28-2019, 08:28 PM   #2
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Devuan
Posts: 3,657
Blog Entries: 33

Rep: Reputation: 283Reputation: 283Reputation: 283
Hi, I think you need to change the the line...

set root=

to reflect the gpt partition, not the msdos naming... hd0

check this out...

https://wiki.mageia.org/en/How_to_set_up_kernel_options
 
Old 04-28-2019, 08:39 PM   #3
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,353

Rep: Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590
Quote:
OK I can't boot into my system and I dont know why.
How far are you getting in the boot process? No grub menu, boots straight into windows, grub menu but boot fails, what?
 
Old 04-28-2019, 10:40 PM   #4
drillsar
Member
 
Registered: Jan 2017
Posts: 144

Original Poster
Rep: Reputation: Disabled
No grub menu
 
Old 04-29-2019, 04:59 AM   #5
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,353

Rep: Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590
Have you tried to go into your bios boot selection by using your f-keys, etc, some other key to select grub?, do you get a grub prompt "grub>" The more information on where the boot process fails at will help in pinpointing the problem.

Last edited by colorpurple21859; 04-29-2019 at 05:40 AM.
 
Old 04-29-2019, 05:59 PM   #6
drillsar
Member
 
Registered: Jan 2017
Posts: 144

Original Poster
Rep: Reputation: Disabled
I was told you really don't need grub for EFI..
I am going to try this from this link:

https://unix.stackexchange.com/quest...boot-partition
 
Old 04-29-2019, 08:37 PM   #7
drillsar
Member
 
Registered: Jan 2017
Posts: 144

Original Poster
Rep: Reputation: Disabled
Ok I think making progress.. I installed efibootmgr and efivars.

Again Boot EFI partition is /dev/sdb1
Root Linux System partition /dev/sdb2

Code:
I ran blkid /dev/sdb2
results:
Code:
/dev/sdb2: UUID="f4320fbd-7ebc-46b8-8d1f-90ddc9348287" TYPE="ext4" PARTUUID="f9b06682-c0d1-442a-bf3f-5df9da35df21"
Code:
cp /boot/vmlinuz-4.20.12-lfs-8.4 /boot/efi/EFI/LFS/vmlinuz-4.20.12-lfs-8.4.efi
ran the following:

Code:
echo "root=UUID=f4320fbd-7ebc-46b8-8d1f-90ddc9348287 ro quiet rootfstype=ext4" |
  iconv -f ascii -t ucs2 |
  efibootmgr \
    --create --gpt \
    --disk /dev/sdb --part 1 \
    --label "Linux From Scratch OS" \
    --loader "\\EFI\\LFS\\vmlinuz-4.20.12-lfs-8.4.efi" \
    --write-signature --append-binary-args -
When I reboot I get the following:

Kernel Panic not syncing: VFS unable to mount root fs on unknown block (0,0)
 
Old 04-29-2019, 09:17 PM   #8
drillsar
Member
 
Registered: Jan 2017
Posts: 144

Original Poster
Rep: Reputation: Disabled
Solved

Instead of UUID I used root=/dev/sdb2

I think going to write up a hint for others.
 
1 members found this post helpful.
  


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] Ooooy. EFI boot mmx64.efi.efi not found bulgin Linux - Newbie 12 12-20-2018 11:03 AM
[SOLVED] Can't find /boot/efi/EFI/Slackware/vmlinuz kernel configuration ironQiu Slackware 4 02-09-2015 06:21 AM
boot efi disk with without a non-efi bios pc... masavini Programming 1 11-12-2013 08:48 PM
Infinite Grub Loop: GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB... beeblequix MEPIS 2 11-02-2013 10:56 PM
EFI main GPT overwritten everytime (when windows 7 runs) - structure of EFI masuch Linux - Newbie 2 07-20-2012 02:49 PM

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

All times are GMT -5. The time now is 05:15 PM.

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