LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 07-05-2020, 06:44 AM   #1
Shah404
Member
 
Registered: Jun 2020
Posts: 43

Rep: Reputation: Disabled
LFS Version 9.1, 8.4.3. Setting Up the GRUB Configuration


Hello Users,
I can't install grub on my LFS. I did everything according to the book.
The command
Code:
grub-install /dev/sda
returns
Code:
(lfs chroot) root:/boot/grub# grub-install /dev/sda
grub-install: error: /usr/lib/grub/x86_64-efi/modinfo.sh doesn't exist. Please specify --target or --directory.
As decribed in the book, that this problem can occur, as some files arent yet installed
Quote:
If the system has been booted using UEFI, grub-install will try to install files for the x86_64-efi target, but those files have not been installed in chapter 6. If this is the case, add --target i386-pc to the command above.
So the command
Code:
grub-install /dev/sda --target i386-pc
returns
Code:
Installing for i386-pc platform.
grub-install: warning: this GPT partition label contains no BIOS Boot Partition; embedding won't be possible.
grub-install: error: embedding is not possible, but this is required for cross-disk install
My lfs is on my pendrive.
These are my partitions
after running lsblk
Code:
sdc      8:32   1  28.7G  0 disk 
|-sdc1   8:33   1   100M  0 part 
|-sdc2   8:34   1    12G  0 part /
`-sdc3   8:35   1     4G  0 part [SWAP]
sdc1 is for boot

This is my /etc/fstab
Code:
# Begin /etc/fstab

# file system  mount-point  type     options             dump  fsck
#                                                              order

/dev/sdc2     /            ext4    defaults            1     1
/dev/sdc3     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

# End /etc/fstab
Do i need to mention boot there?
its type is ext2, and what aboutoptions, dump and fsck order, i am a beginner, i dont know much about that.

My GRUB directory has:
Code:
(lfs chroot) root:/boot/grub# ls
fonts  grubenv	i386-pc
Thank You
 
Old 07-05-2020, 08:14 AM   #2
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,682
Blog Entries: 19

Rep: Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492
The problem is that GRUB comes in two parts. The first part is just a stub which goes in the MBR. The second, which the stub points to, is a larger program that actually boots your system. On a traditional DOS disk, this goes into the gap between the MBR and the first partition.

If you have a GPT disk, this gap will not be present, so you need a small BIOS boot partition as sda1 and GRUB will go there. This is a special type of partition on which you have no filesystem. It is not the same as the boot partition that the Book recommends as a location for kernels and initrds in multi-booting machines, which is a normal filesystem partition.

Last edited by hazel; 07-05-2020 at 08:24 AM.
 
Old 07-05-2020, 08:33 AM   #3
Shah404
Member
 
Registered: Jun 2020
Posts: 43

Original Poster
Rep: Reputation: Disabled
Hello Sir,
i already have linux installed on sda1,
i have actually dual booted ubuntu and another ubuntu(but with minimal installation, for working with lfs).
and it already has grub installed.
so you are telling me that i should make a new Bios BOOT partition and then it will work!!
using command lsblk
Code:
(lfs chroot) root:/# lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
loop0    7:0    0 255.6M  1 loop 
loop1    7:1    0    55M  1 loop 
loop2    7:2    0 240.8M  1 loop 
loop3    7:3    0  62.1M  1 loop 
loop4    7:4    0  49.8M  1 loop 
loop5    7:5    0  49.8M  1 loop 
loop6    7:6    0    55M  1 loop 
loop7    7:7    0  27.1M  1 loop 
loop8    7:8    0  29.8M  1 loop 
loop9    7:9    0 127.3M  1 loop 
loop10   7:10   0 163.7M  1 loop 
loop11   7:11   0 127.3M  1 loop 
sda      8:0    0 465.8G  0 disk 
├─sda1   8:1    0 196.3G  0 part 
├─sda2   8:2    0 170.5G  0 part 
├─sda3   8:3    0   9.3G  0 part 
├─sda4   8:4    0    28G  0 part 
└─sda6   8:6    0  61.2G  0 part 
sdc      8:32   1  28.7G  0 disk 
├─sdc1   8:33   1   100M  0 part 
├─sdc2   8:34   1    12G  0 part /
└─sdc3   8:35   1     4G  0 part [SWAP]
sr0     11:0    1  1024M  0 rom
Code:
sudo gdisk -l /dev/sda
GPT fdisk (gdisk) version 1.0.5

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /dev/sda: 976773168 sectors, 465.8 GiB
I think its GPT. Forgive my asking.

Last edited by Shah404; 07-05-2020 at 08:39 AM.
 
Old 07-05-2020, 08:47 AM   #4
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,682
Blog Entries: 19

Rep: Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492
Yes, that's a GPT disk. But if you already have GRUB installed, it would be better to add LFS to it. The Book points out that installing GRUB afresh from LFS is not necessarily what you want to do in a multiboot situation.

If you have Ubuntu, you will have the complete set of Debian GRUB scripts in /etc/grub.d. There are a couple of "custom" scripts, if I remember correctly, that you can edit to add further systems for GRUB to recognise and boot. In your place, I would go down that route.
 
1 members found this post helpful.
Old 07-05-2020, 09:12 AM   #5
Shah404
Member
 
Registered: Jun 2020
Posts: 43

Original Poster
Rep: Reputation: Disabled
How do i do that?
Can you please redirect me to some references
 
Old 07-05-2020, 10:44 AM   #6
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,682
Blog Entries: 19

Rep: Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492Reputation: 4492
I haven't used GRUB for years. I don't even use it for LFS, where it is recommended. But I found this by googling. Which you could have done too by the way!
 
1 members found this post helpful.
Old 07-06-2020, 01:21 AM   #7
Shah404
Member
 
Registered: Jun 2020
Posts: 43

Original Poster
Rep: Reputation: Disabled
Oh thank You.

Last edited by Shah404; 07-06-2020 at 01:29 AM.
 
  


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
Infinite Grub Loop: GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB... beeblequix MEPIS 2 11-02-2013 10:56 PM
LFS version check gcc version higher than recommended EDDY1 Linux From Scratch 1 12-27-2012 06:39 PM
[SOLVED] Which version of book to use for BLFS??? (LFS-6.7 used for building LFS) rkmv Linux From Scratch 3 02-21-2012 05:32 PM
[SOLVED] LFS 6.7 : $LFS/sources and $LFS/tools folders missing prakashsince92 Linux From Scratch 5 12-09-2010 02:26 PM
Booting my new ubuntu install = "GRUB GRUB GRUB GRUB GRUB" etc. dissolved soul Ubuntu 2 01-13-2007 12:55 PM

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

All times are GMT -5. The time now is 07:52 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