LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 07-20-2019, 07:33 AM   #1
lucmove
Senior Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian
Posts: 1,432

Rep: Reputation: 110Reputation: 110
Headaches with Grub, as usual


My old nemesis is back. The single most dreadful piece of software to ever plague the Linux landscape: Grub (not legacy).

Code:
# grub-install /dev/sdb 
Installing for i386-pc platform.
grub-install: warning: this GPT partition label contains no BIOS Boot Partition; embedding won't be possible.
grub-install: warning: Embedding is not possible.  GRUB can only be installed in this setup by using blocklists.  However, blocklists are UNRELIABLE and their use is discouraged..
grub-install: error: will not proceed with blocklists.

# gdisk -l /dev/sdb
GPT fdisk (gdisk) version 1.0.1

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

Found valid GPT with protective MBR; using GPT.
Note that gdisk produces the exact same output for sda and sdb, except number and size of partitions. Grub installed on sda. What in the Grub Hell is going on?
 
Old 07-20-2019, 07:45 AM   #2
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Well, if your disks are GPT then you have no MBR for grub to install on, because GPT does not use MBR it is GPT, not MBR. If you have a UEFI boot, then you need to follow the instructions to install UEFI grub. Which in this case you must have UEFI because you stated exact same output for sda and sdb. Look into UEFI grub and how to install and manage it.

I do not do UEFI, or I'd probably have more info for you, but this should be enough to get you on the right track.

Last edited by BW-userx; 07-20-2019 at 07:46 AM.
 
Old 07-20-2019, 08:16 AM   #3
lucmove
Senior Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian
Posts: 1,432

Original Poster
Rep: Reputation: 110Reputation: 110
Quote:
Originally Posted by BW-userx View Post
Well, if your disks are GPT then you have no MBR for grub to install on, because GPT does not use MBR it is GPT, not MBR. If you have a UEFI boot, then you need to follow the instructions to install UEFI grub. Which in this case you must have UEFI because you stated exact same output for sda and sdb. Look into UEFI grub and how to install and manage it.
How come the same grub installed on sda, also GPT, also with a protective MBR?
 
Old 07-20-2019, 08:32 AM   #4
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
that's a new on one me, found this, with a little searching on that subject.
https://unix.stackexchange.com/quest...ybrid-mbr-disk
 
Old 07-20-2019, 09:11 AM   #5
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,345

Rep: Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588
Grub needs extra room between the mbr and first partition to install everything, this extra space exist on mdos disk but not on a gpt disk. On a gpt disk create an empty 1mb partition flagged as bios-grub for legacy install of grub. I think this might work without a bios-grub partition to make fit in mbr of gpt but not sure
Code:
grub-install --target=i386-pc --no-rs-codes --force /dev/sdx

Last edited by colorpurple21859; 07-20-2019 at 09:52 AM.
 
Old 07-20-2019, 09:31 AM   #6
lucmove
Senior Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian
Posts: 1,432

Original Poster
Rep: Reputation: 110Reputation: 110
Quote:
Originally Posted by colorpurple21859 View Post
Grub needs extra room between the mbr and first partition to install everything
which I don't have on sda, where grub installs fine.

And people complain about systemd...
 
Old 07-20-2019, 11:13 AM   #7
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,804

Rep: Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306
probably this helps: https://blog.hostonnet.com/grub-inst...nt-be-possible
 
1 members found this post helpful.
Old 07-20-2019, 11:24 AM   #8
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,345

Rep: Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588
Quote:
which I don't have on sda, where grub installs fine.
I'm just going by what research I have done on the subject.
 
Old 07-20-2019, 05:15 PM   #9
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,345

Rep: Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588
Quote:
# grub-install /dev/sdb
Installing for i386-pc platform.
This would indicate the op is booting in legacy mode. Is it possible the op is mixing legacy and efi on the same system, windows installed in efi mode and debian installed in legacy mode, hence forth the problem. If your booting in legacy mode /sys/firmware/efi won't exit.

If debian is install in legacy mode and assuming debian is 64bit, one way would be to boot installation disk in efi mode, run fdisk -l or parted -l to determine efi partition
mount system partition to /mnt
create /mnt/boot/efi
mount efi partition to /mnt/boot/efi
then
Code:
grub-install --target=x86_64-efi --boot-directory /mnt/boot /dev/sda
If this works then after booting into system install grub-efi and add entry for efi partition in fstab

without installation disk, boot into debian, run fdisk -l or parted -l to determine efi partition
Code:
apt install grub-efi
mkdir /boot/efi
mount <efi partition> /boot/efi
grub-install --target=x86_64-efi
you will get error about efivars or something similar.
reboot, at restart use esc/f-keys to get boot options, you should have one for debian.

If your able to boot into debian efi mode,
mount efi partition to /boot/efi run grub-install
Create an entry in fstab to mount efi partition to /boot/efi

Last edited by colorpurple21859; 07-20-2019 at 05:34 PM.
 
1 members found this post helpful.
Old 07-21-2019, 03:28 PM   #10
lucmove
Senior Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian
Posts: 1,432

Original Poster
Rep: Reputation: 110Reputation: 110
Quote:
Originally Posted by colorpurple21859 View Post
This would indicate the op is booting in legacy mode. Is it possible the op is mixing legacy and efi on the same system, windows installed in efi mode and debian installed in legacy mode, hence forth the problem. If your booting in legacy mode /sys/firmware/efi won't exit.
I use EFI. Debian only, no other OS. I never chose to boot in legacy mode. Why does it happen?

I used to have the 'grub-pc' package, still have 'grub-pc-bin.' I removed grub-pc and intalled grub-efi, grub-efi-amd64, and grub-efi-amd64-bin.

Quote:
Originally Posted by colorpurple21859 View Post
run fdisk -l or parted -l to determine efi partition
What does "determine" mean exactly? Do you mean I need to know my partition table or actually create that efi partition?

Last edited by lucmove; 07-21-2019 at 03:30 PM.
 
Old 07-21-2019, 03:46 PM   #11
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
to find out what type of partition table you have. GPT,MBR, or other.
 
Old 07-21-2019, 04:12 PM   #12
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,345

Rep: Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588
You need a fat32 formatted esp flagged partition about 200-300mb to boot in uefi mode. If this is a system with windows 10 preinstalled it probably already exist. If this is an empty drive you will need to create one.

Last edited by colorpurple21859; 07-21-2019 at 04:14 PM.
 
Old 07-21-2019, 04:31 PM   #13
lucmove
Senior Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian
Posts: 1,432

Original Poster
Rep: Reputation: 110Reputation: 110
Again, Windows is not involved at all in any of this. I never had Windows installed in any of these disks. Please stop mentioning Windows.

I don't have a FAT32 formatted ESP flagged partition about 200-300MB to boot in UEFI mode in the other hard disk. How did Grub ever get installed in it? I have /boot as ext2 in a 200MB partition. Would that fit the purpose?

If I have to sacrifice 200-300MB of my hard disk just so I can do something as unbelievably basic as BOOTING, then I'll just ditch this horrible POS and look for boot loaders that won't impose ridiculous demands.
 
Old 07-21-2019, 04:40 PM   #14
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,345

Rep: Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588Reputation: 1588
This doesn't have anything to do with grub. It is an efi thingy. Your system may have had legacy mode enabled and switched to legacy automatically. With out info on you drive setup it is all a guessing game.

Last edited by colorpurple21859; 07-21-2019 at 07:40 PM.
 
Old 07-21-2019, 05:04 PM   #15
bodge99
Member
 
Registered: Oct 2018
Location: Ashington, Northumberland
Distribution: Artix, Slackware, Devuan etc. No systemd!
Posts: 368

Rep: Reputation: 66
Hi,

I've just seen this thread.. Sorry, must disagree.. IMHO Grub2 is the best, most versatile bootloader available. It's very powerful when used properly.

All of the advice given above is totally correct. It would appear that the OP is attempting to use the Grub tools in a "non-standard" way.
The initial error messages are purely a report on why grub-install cannot perform the requested action. i.e. the drive is either not an MBR drive or doesn't have any allocated space for a bios boot partition.

I've seen machines with GPT drives (UEFI firmware, legacy mode disabled) where a legacy installation succeeds. Some tools then reported an MBR installation and others a UEFI one.
The machine seemed to run reasonably O.K. but an examination of the partition structures showed "a real mess". I advised the owner to backup his user files and start from scratch. Create a GPT drive and reinstall.

I've also seen a couple of UEFI machines that had pre-formatted MBR drives used (without creating GPT drives). Installation succeeded but drive performance was poor. Again, reinstalling with GPT solved this.

I think that poor UEFI firmware is behind most of these problems.. Just my 10p worth...

Bodge99
 
  


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
Booting my new ubuntu install = "GRUB GRUB GRUB GRUB GRUB" etc. dissolved soul Ubuntu 2 01-13-2007 12:55 PM
lilo to grub headaches harry349 Linux - General 3 05-23-2004 09:17 PM
GRUB GRUB GRUB GRUB "Whats Going on?" Gaweph Linux - Newbie 6 03-26-2004 10:40 AM
Usual partitioning/cylinder problems from an ignoramus. Scuttler Linux - Software 3 12-03-2001 11:00 PM

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

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