LinuxQuestions.org
Help answer threads with 0 replies.
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


Reply
  Search this Thread
Old 07-04-2017, 06:36 AM   #1
CHG
LQ Newbie
 
Registered: Jul 2017
Posts: 1

Rep: Reputation: Disabled
Multiple grub and boot folders. Which one is used at bootup?


Hi all,
would require some assistance here.

I have a Dell Inspiron 15 5000 series using amd64 bit. I installed Mint 18.1 from the Live CD. During installation, I created three partitions /swap, / and /home. I selected the already existing /dev/sda1 EFI System partition as the boot partition. After installing, when I reboot, it goes into "grub rescue>" prompt due to unrecognised file format.

It appears that due to previous installations and many attempts by me to fix this issue using the Live CD has resulted in grub getting installed in many folders.

sudo fdisk -l out put is:
Device Start End Sectors Size Type
/dev/sda1 2048 1026047 1024000 500M EFI System
/dev/sda2 1026048 1288191 262144 128M Microsoft reserved
/dev/sda3 1288192 1325110255 1323822064 631.3G Microsoft basic data
/dev/sda4 1927524352 1928466431 942080 460M Windows recovery environment
/dev/sda5 1928466432 1951135743 22669312 10.8G Windows recovery environment
/dev/sda6 1951137792 1953523711 2385920 1.1G Windows recovery environment
/dev/sda7 1325111296 1332922367 7811072 3.7G Linux swap
/dev/sda8 1332922368 1381750783 48828416 23.3G Linux filesystem
/dev/sda9 1381750784 1927524351 545773568 260.3G Linux filesystem
/dev/sda11 1951135744 1951137791 2048 1M BIOS boot

"Partition table entries are not in disk order."

While using the Live CD, I mounted /dev/sda8 (which is where I installed Mint 18.1) to /mnt
I then ran "ls /mnt/boot/grub". The output is
fonts grub.cfg grubenv locale unicode.pf2 x86_64-efi

In the /mnt/boot/grub/x86_64-efi folder the relevant .mod files are found.

I then unmounted /dev/sda8 and mounted /dev/sda1 (EFI System partition) to /mnt using "sudo mount /dev/sda1 /mnt"
Now "ls /mnt" gives:
boot boot-sav EFI grub

when I check /mnt/boot/ it has only one folder "grub". Inside /mnt/boot/grub the following files are found:
fonts grubenv locale x86_64-efi

When I enter "ls /mnt/boot/grub/x86_64-efi" it lists all the .mod files similar to /dev/sda8/boot/grub/x86_64-efi earlier

Most importantly, when I enter "ls /mnt/EFI", it shows:
Boot dell Microsoft ubuntu
* Reminder: this is while mounting /dev/sda1 (EFI partition) to /mnt....

In /mnt/EFI/ubuntu, the following files are found:
fw fwupx64.efi grub.cfg grubx64.efi mmx64.efi MokManager.efi shimx64.efi

In addition, when I enter, "ls /mnt/EFI/Boot/" it shows the following:
bkpbootx64.efi bootx64.efi

So can someone please let me know how to find out which grub version in which folder is used at bootup as it gives me "grub rescue>" prompt?
Note: During bootup, I can't change the boot settings to UEFI as it only lists IPv4 and IPv6 options. When the live CD is inserted, UEFI boot options shows the the additional DVD option along with IPv4 and IPv6. However, only the "legacy" boot option gives the "hard disk" option, so I am forced to change the boot options (by pressing F2) to legacy.

Note: I am also unable to install boot-repair while booting with the Live CD even after adding the repo.
 
Old 07-05-2017, 01:06 AM   #2
aragorn2101
Member
 
Registered: Dec 2012
Location: Mauritius
Distribution: Slackware
Posts: 552

Rep: Reputation: 270Reputation: 270Reputation: 270
Hi, welcome to LQ,

On UEFI systems, the EFI partition holds bootloaders. Normally when the computer boots, it will look in its settings to see which bootloader is first in the line and load it. Let's say it loads GRUB from EFI/ubuntu/grubx64.efi, then this program will use its configurations (grub.cfg) to display the possible options to boot.

The /boot/grub/ on your Linux filesystem is the traditional place where configuration files for GRUB were found in the time of MBR. It still contains certain files and usually a copy of these files are place on the EFI partition at EFI/ubuntu/.

What is bugging me are the 2 copies of grub.cfg, one in EFI/ubuntu/ and one in /boot/grub/. I do not use Ubuntu but I do boot my Linux distro with GRUB on an EFI machine. My grub.cfg is in /boot/grub/. Anyway, for the time being you can ensure that both copies are the same by copying back and forth, then later you can

experiment by modifying one of them and see if it changes anything.

You could boot the live DVD, chroot into your Linux filesystem and run grub-mkconfig:
Code:
# mount -t ext4 /dev/sda8 /mnt
# mount -t vfat /dev/sda1 /mnt/boot/efi

# mount -t proc /proc /mnt/proc
# mount --rbind /sys /mnt/sys
# mount --rbind /dev /mnt/dev
# mount --rbind /run /mnt/run

# chroot /mnt env -i HOME=/root TERM=$TERM PATH=/usr/bin:/usr/sbin:/bin:/sbin bash --login +h

# grub-mkconfig -o /boot/grub/grub.cfg
# cp /boot/grub/grub.cfg /boot/efi/EFI/ubuntu/grub.cfg
In case it still does not boot, the culprit is that Legacy boot.
 
1 members found this post helpful.
Old 07-05-2017, 06:34 AM   #3
colorpurple21859
Senior Member
 
Registered: Jan 2008
Location: florida panhandle
Distribution: slackware64-current, arch, ubuntu, others
Posts: 3,429

Rep: Reputation: 547Reputation: 547Reputation: 547Reputation: 547Reputation: 547Reputation: 547
at the grub rescue prompt enter "set" without the quotation marks. the line starting with "prefix" should tell you were grub is looking for the grub files.

edit: after reading again, here is part of your problem:
Quote:
I selected the already existing /dev/sda1 EFI System partition as the boot partition.
the efi partition /dev/sda1 should be mounted on /boot/efi when in efi mode, not on /boot. Not sure what you will have to do to fix this without knowing where your kernel and initrd is located.
at the very least will have to move /boot off of the efi partition and edit your /etc/fstab for /dev/sda1 to be mounted to /boot/efi and change where /boot is located and edit fstab for the /boot entry

Last edited by colorpurple21859; 07-05-2017 at 07:06 AM.
 
Old 07-05-2017, 10:01 AM   #4
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 8,604

Rep: Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772
On Ubuntu, the grub.cfg file in the EFI partition doesn't do any more than point to the actual grub.cfg file on the Ubuntu partition. The grub.cfg file on the Ubuntu partition has all the actual menuentries.
 
Old 07-05-2017, 04:17 PM   #5
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,513

Rep: Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004
You tried to configure the efi partition as /boot. Something went wrong, because there is a boot directory with contents on the root partition of the Linux installation. If you look in the /etc/fstab file of the Linux installation, it will tell you if anything is being mounted as /boot. If there is no entry in fstab, then /boot is a plain directory, not corresponding to a separate partition.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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] Weird: During bootup, I must enter input at grub menu to boot. hwclock related? Arodef Red Hat 1 11-08-2012 10:41 PM
STUCK: GRUB issue and multiple boot smiley_lauf Linux - Newbie 14 03-03-2006 07:31 AM
GRUB hanging at bootup (Fedora Linux, dual boot Windows XP) Forezt Linux - Software 4 12-07-2003 12:52 PM
GRUB using /boot partition for multiple Linux/Windows boot? cpv204 Linux - Newbie 7 04-01-2003 03:54 PM
using grub to boot multiple linux os's Smerk Linux - Software 9 03-21-2003 12:07 AM

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

All times are GMT -5. The time now is 09:37 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration