LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Closed Thread
  Search this Thread
Old 06-19-2018, 08:48 AM   #1
KNSI
LQ Newbie
 
Registered: Jun 2018
Posts: 3

Rep: Reputation: Disabled
GRUB menu not getting updated even after changing /boot/grub/grub.cfg


Hi,

i have completed compiling Linux From Scratch 8.1 on Ubuntu-16.04(minimal).
while setting up GRUB i have set the root to the wrong partition, the grub.cfg file is shown below:

Code:
set default=0
set timeout=5
insmod ext2
set root=(hd1,0)
menuentry "GNU/Linux, Linux 4.12.7-lfs-8.1" {
        linux   /boot/vmlinuz-4.12.7-lfs-8.1 root=/dev/sdb1 ro
}
plus i had run

Code:
grub-install /dev/sda
hence GRUB had shown the following error:

Code:
error: no such partition
so i clicked on 'c' and set the root to (hd1,1) and the OS booted. After which i updated the grub.cfg file to:

Code:
set default=0
set timeout=5
insmod ext2
set root=(hd1,1)
menuentry "GNU/Linux, Linux 4.12.7-lfs-8.1" {
        linux   /boot/vmlinuz-4.12.7-lfs-8.1 root=/dev/sdb1 ro
}
and again rebooted to check the configuration, but it seems as though the change is not getting reflected as it still gives me the same error and i have to once again set the root to (hd1,1).

so my question is how do you permanently update the grub? i have also tried

Code:
grub-install /sda/sdb
but it seems to not make a difference.
 
Old 06-19-2018, 10:32 AM   #2
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,573

Rep: Reputation: 2499Reputation: 2499Reputation: 2499Reputation: 2499Reputation: 2499Reputation: 2499Reputation: 2499Reputation: 2499Reputation: 2499Reputation: 2499Reputation: 2499
Are the entries in grub.cfg you refer to on the Ubunt system or on the LFS?
Your output shows LFS on sdb1 so I would think you would want to install Grub to that drive: grub-install /dev/sdb (as root or using sudo).

I haven't used LFS but I see on their site they have a 'live' option. Post a link to what you used. If you are creating a 'live' system you won't be able to edit the grub.cfg file and save the changes on reboot. You should be able to put an entry in the grub.cfg file of Ubuntu and boot it any time.
 
1 members found this post helpful.
Old 06-19-2018, 11:30 AM   #3
KNSI
LQ Newbie
 
Registered: Jun 2018
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by yancek View Post
Are the entries in grub.cfg you refer to on the Ubunt system or on the LFS?
Your output shows LFS on sdb1 so I would think you would want to install Grub to that drive: grub-install /dev/sdb (as root or using sudo).

I haven't used LFS but I see on their site they have a 'live' option. Post a link to what you used. If you are creating a 'live' system you won't be able to edit the grub.cfg file and save the changes on reboot. You should be able to put an entry in the grub.cfg file of Ubuntu and boot it any time.
Hi,

It is the grub.cfg of the LFS system.
i did run grub-install /dev/sdb as the sudo user, but when i run fdisk -l, it still shows /dev/sda as the boot partition.
I also tried running the grub-install command in the chroot environment as instructed in http://www.linuxfromscratch.org/lfs/...sedchroot.html.

i built the GRUB configuration as instructed in http://www.linuxfromscratch.org/lfs/...er08/grub.html.
 
Old 06-19-2018, 04:43 PM   #4
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,573

Rep: Reputation: 2499Reputation: 2499Reputation: 2499Reputation: 2499Reputation: 2499Reputation: 2499Reputation: 2499Reputation: 2499Reputation: 2499Reputation: 2499Reputation: 2499
If the device on which you have created LFS is sdb and you installed Grub to the MBR of sdb, it should boot if you have sdb set to first boot priority in the BIOS. The only reason the changes aren't save that is logical is that it is a live system, therefore read-only and no changes are saved on reboot. Haven't used LFS so I doubt I'll be much help.
 
Old 06-19-2018, 06:37 PM   #5
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
Manual changes to grub.cfg are lost when reinstalling or updating grub. Grub.cfg is built using the scripts in /etc/grub.d.
 
Old 06-19-2018, 07:16 PM   #6
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,396

Rep: Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594Reputation: 1594
Is this an efi system with an esp/efi partition formatted fat32?
 
Old 06-20-2018, 01:54 PM   #7
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.

Please use your original question on this topic, https://www.linuxquestions.org/quest...fg-4175632183/
 
  


Closed Thread



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
GRUB menu not getting updated even after changing /boot/grub/grub.cfg KNSI Linux From Scratch 4 06-20-2018 09:13 PM
Files in /etc/grub.d not included in /boot/grub/grub.cfg. stf92 Slackware 21 05-27-2018 04:38 PM
[SOLVED] Boot menu not matching grub.cfg spoovy Linux - Newbie 10 02-01-2011 03:45 PM
[SOLVED] How come I can't edit /boot/grub/grub.conf or /boot/grub/menu.lst in Fedora 14? trien27 Fedora 4 01-22-2011 04:02 PM
Setting password on grub, wha to do after changing default values in /boot/grub/menu. sarajevo Linux - Security 1 08-17-2005 08:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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