LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-12-2015, 09:49 PM   #1
CollieJim
Member
 
Registered: Mar 2005
Distribution: Gentoo, Kubuntu
Posts: 582

Rep: Reputation: 28
grub-install and grub-update are ignored


Hi,

I have a 750GB SATA drive with GPT and 13 partitions, the last of which is a BIOS partition EF02.

I installed Mint 17.1 KDE, and it works, mostly. KDE startup is a bit flaky.

Then I installed Gentoo. No systemd. I ran
Code:
grub2-install /dev/sda
grub2-mkconfig -o /boot/grub/grub.cfg
When I rebooted, the menu I got only had Mint 17.1 entries.
I booted Mint, ran update-grub, and rebooted. This time I got an entry for Gentoo.

Next I installed Ubuntu 14.04.1. Same procedure with grub, same result. I booted Mint again, ran update-grub, rebooted, and got an Ubuntu entry.

It seems that Mint has done something that requires that only it can install and configure grub. Not Nice!

When Mint was installed there was no BIOS partition and no problem. When I tried to install grub under Gentoo it complained that it was missing so I created it. No more erros, but no result either.

My HP Pavilion dv6 gives me a Setup option when booting which gives the usual abbreviated BIOS type menu. Secure Boot is greyed and disabled. The GPT disk works OK.

What do I need to do to allow Gentoo and Ubuntu to update grub's configuration?

thanks
Jim
 
Old 01-12-2015, 11:18 PM   #2
Teufel
Member
 
Registered: Apr 2012
Distribution: Gentoo
Posts: 616

Rep: Reputation: 142Reputation: 142
There is some explanations and tricks about BIOS+GPT
http://www.rodsbooks.com/gdisk/bios.html
 
Old 01-13-2015, 12:54 AM   #3
CollieJim
Member
 
Registered: Mar 2005
Distribution: Gentoo, Kubuntu
Posts: 582

Original Poster
Rep: Reputation: 28
Thanks. It's informative, but not what I need.
 
Old 01-13-2015, 01:26 PM   #4
Head_on_a_Stick
Senior Member
 
Registered: Dec 2014
Location: London, England
Distribution: Debian stable (and OpenBSD-current)
Posts: 1,187

Rep: Reputation: 285Reputation: 285Reputation: 285
Please post the output of:
Code:
# parted -l
If your disk was GPT when you installed Mint and no BIOS boot partition (ef02) was present, it must be booting in EFI-mode -- it is not possible to boot a GPT disk in non-EFI mode without a BIOS boot partition.

If you have an EFI system partition (ef00) in the output of parted then you will need to install GRUB in EFI-mode:
Code:
# grub2-install --target=x86_64 /dev/sda
http://wiki.gentoo.org/wiki/GRUB2#UEFI_with_GPT

EDIT: You will need to mount /boot at the EFI system partition.
http://wiki.gentoo.org/wiki/Handbook...ion#Using_UEFI

Last edited by Head_on_a_Stick; 01-13-2015 at 01:29 PM.
 
Old 01-13-2015, 01:38 PM   #5
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
You may just not have installed GRUB to the master boot record when you installed the other OSs besides Mint. However, even if you did you need to decide which OS is "in charge" of the GRUB setup you can't, that I've seen or heard of, update the GRUB installed by one OS with another just to add an entry for it -- the OS which installed GRUB updates all the GRUB related files.
 
Old 01-13-2015, 08:11 PM   #6
CollieJim
Member
 
Registered: Mar 2005
Distribution: Gentoo, Kubuntu
Posts: 582

Original Poster
Rep: Reputation: 28
Code:
# parted -l
Model: ATA WDC WD7500BPVX-0 (scsi)
Disk /dev/sda: 750GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system     Name                 Flags
13      17.4kB  1049kB  1031kB                  BIOS boot partition  bios_grub
 1      1049kB  200MB   199MB   fat32                                boot, esp
 2      200MB   8393MB  8193MB  linux-swap(v1)
 3      8393MB  49.4GB  41.0GB  ext4
 4      49.4GB  90.3GB  41.0GB  ext4
 5      90.3GB  121GB   30.7GB  ext4
 6      121GB   152GB   30.7GB  ext4
 7      152GB   162GB   10.2GB  ext4
 8      162GB   203GB   41.0GB  ext4
 9      203GB   223GB   20.5GB  ext4
10      223GB   633GB   410GB   ext2
11      633GB   654GB   20.5GB  ext4
12      654GB   664GB   10.2GB  ext2

# gdisk /dev/sda
GPT fdisk (gdisk) version 0.8.10

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

Found valid GPT with protective MBR; using GPT.

Command (? for help): p
Disk /dev/sda: 1465149168 sectors, 698.6 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 47B630FC-BE27-414E-BC50-6AED591BB1B6
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 1465149134
Partitions will be aligned on 8-sector boundaries
Total free space is 168752847 sectors (80.5 GiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048          391167   190.0 MiB   EF00  
   2          391168        16392191   7.6 GiB     8200  
   3        16392192        96393215   38.1 GiB    8300  
   4        96393216       176394239   38.1 GiB    8300  
   5       176394240       236394495   28.6 GiB    8300  
   6       236394496       296394751   28.6 GiB    8300  
   7       296394752       316395519   9.5 GiB     8300  
   8       316395520       396396543   38.1 GiB    8300  
   9       396396544       436396031   19.1 GiB    8300  
  10       436396032      1236396031   381.5 GiB   8300  
  11      1236396032      1276395519   19.1 GiB    8300  
  12      1276395520      1296396287   9.5 GiB     8300  
  13              34            2047   1007.0 KiB  EF02  BIOS boot partition
Partition 1 has EFI, and is mounted at /booot/efi by Mint.
Where does grub get installed when "grub2-install /dev/sda" is run?
In all cases with non-Mint distros I ran grub2-install before grub2-mkconfig, which should give the new distro control...
Code:
# grub2-install --target=x86_64 /dev/sda
grub2-install: error: /usr/lib/grub/x86_64/modinfo.sh doesn't exist. Please specify --target or --directory.
Changing x86_64 to x86_64-efi gives
Code:
# grub2-install --target=x86_64-efi /dev/sda
Installing for x86_64-efi platform.
Installation finished. No error reported.
# grub2-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.17.7-gentoo-03
Found Linux Mint 17.1 Rebecca (17.1) on /dev/sda4
Found Ubuntu 14.04.1 LTS (14.04) on /dev/sda8
done
One would think that this would give a grub menu with Gentoo first, yet when I reboot I get the same old menu with Mint & Mint with options entries first.
 
Old 01-13-2015, 08:23 PM   #7
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,605

Rep: Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503Reputation: 2503
You have a BIOS boot partition at the beginning of your drive which is used for GPT when you are not using UEFI.
You also have an efi partition, the 200MB partition which is for GPT/UEFI. These conflict and is the probably cause of your problem.
When you use the BIOS boot with GPT, you install Grub to the MBR.
When you use UEFI, you do not install Grub to the mbr.
You might try running the bootinfoscript or the boot repair script and posting the output. I don't use UEFI myself so don't know how to repair the problem but you might be able to do it from boot repair.

https://help.ubuntu.com/community/Boot-Repair
 
Old 01-13-2015, 08:30 PM   #8
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,416

Rep: Reputation: 1601Reputation: 1601Reputation: 1601Reputation: 1601Reputation: 1601Reputation: 1601Reputation: 1601Reputation: 1601Reputation: 1601Reputation: 1601Reputation: 1601
Did you mount partition 1 at /boot/efi in gentoo before running grub install? Maybe going into bios efi boot menu to select gentoo as first boot. The grub.cfg may also have to be in directory on efi partition that gentoo boot files are in. This might help http://croutchie.blogspot.com/2013/0...in-gentoo.html
 
Old 01-14-2015, 12:43 AM   #9
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Quote:
Originally Posted by yancek View Post
You have a BIOS boot partition at the beginning of your drive which is used for GPT when you are not using UEFI.
You also have an efi partition, the 200MB partition which is for GPT/UEFI. These conflict and is the probably cause of your problem.
When you use the BIOS boot with GPT, you install Grub to the MBR.
When you use UEFI, you do not install Grub to the mbr.
You might try running the bootinfoscript or the boot repair script and posting the output. I don't use UEFI myself so don't know how to repair the problem but you might be able to do it from boot repair.

https://help.ubuntu.com/community/Boot-Repair
Also Bios boot partition will not work unless efi is disabled.
 
Old 01-14-2015, 01:00 AM   #10
CollieJim
Member
 
Registered: Mar 2005
Distribution: Gentoo, Kubuntu
Posts: 582

Original Poster
Rep: Reputation: 28
I will check out Boot-Repair.
grub2-install requires that the EFI partition be mounted at /boot/grub/efi, so yes, it was mounted.
I deleted the BIOS partition with gdisk and tried installing again, with the same bad result. I ran gdisk to delete the BIOS partition, rebooted to use the new table, grub2-install, and reboot.

Last edited by CollieJim; 01-14-2015 at 01:03 AM.
 
Old 01-14-2015, 01:22 AM   #11
Head_on_a_Stick
Senior Member
 
Registered: Dec 2014
Location: London, England
Distribution: Debian stable (and OpenBSD-current)
Posts: 1,187

Rep: Reputation: 285Reputation: 285Reputation: 285
As I said, you are booting in EFI-mode and the reason the Gentoo GRUB menu is not displayed is because /boot is not mounted at the EFI system partition -- the firmware ("BIOS") can only read the FAT formatted EFI system partition and this is where GRUB must be installed: check the Gentoo documentation on this that I have linked.

There is no conflict between the BIOS boot partition and the EFI system partition, which one is used depends on which mode is selected from your firmware ("BIOS") menu options -- if you enable "CSM" or "Legacy" mode the BIOS boot partition will be read, otherwise the EFI system partition will be used.

Here is my table:
Code:
Number  Start (sector)    End (sector)  Size       Code  Name
   1       233394176       234441614   511.4 MiB   EF00  EFI System
   2            2048       201326579   96.0 GiB    8300  Linux filesystem
   3              34            2047   1007.0 KiB  EF02  BIOS boot partition
   4       209712510       233394175   11.3 GiB    8300  Linux filesystem
   5       201326592       209711103   4.0 GiB     8200
It will boot up just fine in either EFI-mode or "Legacy" mode.

EDIT: We can check the mount point is correct using:
Code:
empty@Arch ~ % lsblk -f
NAME   FSTYPE LABEL  UUID                                 MOUNTPOINT
sda                                                       
├─sda1 vfat          9669-102D                            /boot
├─sda2 ext4          dc7b15ff-6725-4918-b0fd-4bfcc5560ffa /
├─sda3                                                    
├─sda4 ext4   Debian 191c641f-66ed-47fc-9adb-df2b189ed367 /debian
└─sda5 swap          7fac1c92-59df-40c9-b602-49cba7b5110d [SWAP]

Last edited by Head_on_a_Stick; 01-14-2015 at 01:25 AM.
 
1 members found this post helpful.
Old 01-14-2015, 02:25 AM   #12
CollieJim
Member
 
Registered: Mar 2005
Distribution: Gentoo, Kubuntu
Posts: 582

Original Poster
Rep: Reputation: 28
Thank you all for your help. Sorry I'm so thick!

BIOS Legacy mode was set. I cleared it and all is well now.

Until I turn the computer on again...
 
  


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
Infinite Grub Loop: GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB... beeblequix MEPIS 2 11-02-2013 10:56 PM
[SOLVED] Recurring Grub rescue mode after update-grub harris4got Linux - Software 6 04-23-2012 09:30 AM
Booting my new ubuntu install = "GRUB GRUB GRUB GRUB GRUB" etc. dissolved soul Ubuntu 2 01-13-2007 12:55 PM
GRUB splashimage configuration / update GRUB rudL Linux - Software 1 05-10-2004 07:16 AM
Update grub during rh install BBehemoth Linux - Software 11 07-19-2003 12:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:57 AM.

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