LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora > Fedora - Installation
User Name
Password
Fedora - Installation This forum is for the discussion of installation issues with Fedora.

Notices


Reply
  Search this Thread
Old 07-18-2020, 10:45 AM   #1
mlaget
LQ Newbie
 
Registered: Feb 2019
Location: Marseille, France
Distribution: Fedora 32
Posts: 8

Rep: Reputation: Disabled
Grub2 points to the wrong partition


Hello LQ users. I am on a multi-boot pc with 6-HDD (legacy mode):

- Default boot (sda1/sda3, double boot win10/Fedora 30);
- FC32 installed on sdb (/boot on sdb1);
- sdc has FC28 installed; sdd has no system installed; sde has Scientic linux

The grub2 menu allows normal booting from sda3/sda1 (FC30/Win10). The
issue is that FC32 cannot be booted. The grub2 menu points to the wrong partition (/) sdb3 instead of (/boot) sdb1. gparted and fdisk confirm sdb1 is the boot partition.

Installing/reinstalling FC30 and/or FC32 does not make any change in the grub2 menu. Consistently, when runing grub2-mkconfig, the os-prober returns an error on sdb3. Cautious but non expert tentative to simply manually edit grub.cfg did not solve the issue.

During re-install, anaconda does not or cannot update the boot loader; on live system, grub2-mkconfig does not detect/load the right partition for FC32.

Thanks for any advice.
 
Old 07-18-2020, 12:41 PM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,304

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
Hi, mlaget,

FC28, FC30, FC32, Scientific Linux, and of all things, Windoze 10? You can do this if you really want to, but you're not making life easy for yourself. You have to do this from one /boot partition. That means 4 kernels, 4 initrds, 4 System.map files, & 4 kernel config files.

If you want my advice, take your empty disk and make it a backup for your data. Then remove FC29 & FC30. Why bother when you have FC32? They'll be obsolete first anyhow. The file that sets what boots is /boot/grub/menu.lst and it doesn't need all that palaver and space-wasting the distros put in. Open it, and search for the term 'menuentry'; the next line should begin with
Code:
linux    /path/to/kernel
followed by the root drive, and the next has the initrd. Fix the one for FC32.

A better way to get to know stuff is with VMs. You can install new systems as a Guest in your normal system. With that many choices you'll spend half of your time rebooting anyhow. And you'll never get to know anything.
 
1 members found this post helpful.
Old 07-19-2020, 08:21 AM   #3
mlaget
LQ Newbie
 
Registered: Feb 2019
Location: Marseille, France
Distribution: Fedora 32
Posts: 8

Original Poster
Rep: Reputation: Disabled
Thank you Business_kid for your reply and suggestions. I do realize the complexity.
For years i have been using such a mounting or equivalent without problem.

- I make ample use of a professional software which usually compiles and installs itself
on Fedoras. It does not anymore on FC31 or FC32. Therefore i keep FC30 (ssd_0; default boot)
to use it with the scripts/codes i developed over the years. To keep up with Fedora 32
i have it installed on ssd_1 which turns out not to be accessable since grub2 is somehow locked
to point at sdb3 instead of sdb1. This is the real issue i was not able to get
rid of.

- The four other disks which contain various developments are on the
primary and secondary IDEs. Easy to unplug, successive booting with only the two ssds
did not provide any change. Grub2 sticks to pointing to the wrong partition.
Same for running grub2-mkconfig.

- I do not have anymore the menu.lst in /boot you mention. I rather tryied to
manually change sdb3 to sdb1 and modify the UUID accordingly in /boot/grub2/grub.cfg.
No success.

Note: the recommended procedure given in the FC26 administrator guide for resetting
and reinstalling grub2 did not succeded for me (ie; rm /etc/grub.d/* && rm /etc/sysconfig/grub
and grub2-mkconfig -o /boot/grub2/grub.cfg). The latter returned grub2-mkconfig unknown.

I am now considering a corrupted or locked sdb1 ssd partition. we'll see what come next.
 
Old 07-19-2020, 09:40 AM   #4
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,575
Blog Entries: 19

Rep: Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453Reputation: 4453
menu.lst was a legacy GRUB thing. GRUB2 uses a configuration file written in GRUB's shell language, and the shell module reads it at boot time and generates a visible menu.

It is possible to write this config file by hand, if the scripts give wrong results, though the GRUB team don't encourage this. There's a section in Linux From Scratch on how to do it.
 
1 members found this post helpful.
Old 07-19-2020, 10:05 AM   #5
verndog
Member
 
Registered: Oct 2007
Posts: 278

Rep: Reputation: 67
Quote:
Originally Posted by hazel View Post
menu.lst was a legacy GRUB thing. GRUB2 uses a configuration file written in GRUB's shell language, and the shell module reads it at boot time and generates a visible menu.

It is possible to write this config file by hand, if the scripts give wrong results, though the GRUB team don't encourage this. There's a section in Linux From Scratch on how to do it.
I've been doing it that way for years. I keep a copy or two of my grub.cfg on hand if it gets overwritten. I don't spend much time looking at my grub menu. I know where I'm headed when I boot up. I also edit update-grub:
Code:
sudo sed -i 's/cfg/cfg.CRAP/' /usr/sbin/update-grub
, to stop writing a new grub file.
 
Old 07-19-2020, 10:48 AM   #6
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,304

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
Thank you, hazel. Yes, menu list is gone 10+years but I still have it hardwired in.

Use /boot/grub/grub.cfg
 
Old 07-19-2020, 12:54 PM   #7
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,352

Rep: Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590
Quote:
the os-prober returns an error on sdb3.
what was the error?
I
Quote:
rather tryied to
manually change sdb3 to sdb1 and modify the UUID accordingly in /boot/grub2/grub.cfg.
No success.
after editing the grub.cfg at the next reboot, did you press e for edit to check that the changes took place for the grub menu entry that you changed?
sometimes grub2 won't pick up a separate boot partition and will need to create a menu entry in /etc/grub.d/40_custom, then rerun grub2-mkconfig

Last edited by colorpurple21859; 07-19-2020 at 01:36 PM.
 
Old 07-19-2020, 03:03 PM   #8
mlaget
LQ Newbie
 
Registered: Feb 2019
Location: Marseille, France
Distribution: Fedora 32
Posts: 8

Original Poster
Rep: Reputation: Disabled
Thank you color Purple for your point. I did not check whether the changes
were effective after a direct editing of grub.cfg.

I suspect grub.cfg is produced at every boot following the grub.d directives which suggests
the direct editing is not permanent and requires a change via 40_custom as you indicate.

I'll try the next coming days.
 
Old 07-19-2020, 03:26 PM   #9
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,352

Rep: Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590Reputation: 1590
Quote:
I suspect grub.cfg is produced at every boot following the grub.d directives which suggests
Whenever grub2-mkconfig is run any changes to the grub.cfg will be lost, which normally happens with kernel update.

Last edited by colorpurple21859; 07-19-2020 at 03:27 PM.
 
Old 07-20-2020, 06:48 AM   #10
mlaget
LQ Newbie
 
Registered: Feb 2019
Location: Marseille, France
Distribution: Fedora 32
Posts: 8

Original Poster
Rep: Reputation: Disabled
Interesting to know, thank you.

Re-installing FC32 on its disk as i did twice (one using anaconda, one using blivet to re-declare the existing partitions) the new kernel should have updated grub2. May be a fresh install with re-partitioning a formated disk is required to force grub2 to a new version.
 
  


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
how to install grub2 on the first section of a partition and then how to chainload to this grub2 bootloader? centguy Linux - Software 9 09-14-2017 10:03 AM
grub2 can't see my win 7 partition and yast2 bootloader can't reinstall grub2 jjrojaspy SUSE / openSUSE 5 07-07-2013 10:38 PM
[SOLVED] GRUB2 after a minor update of GRUB2 /boot prefix no longer needed?? wikapuki Linux - Software 1 10-24-2010 02:39 PM
play free (World of WarCraft , xBox Live, Live Points, Wii Points, Free Habbo) laraaj Linux - Games 1 02-09-2007 05:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora > Fedora - Installation

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