LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Headaches with Grub, as usual (https://www.linuxquestions.org/questions/linux-software-2/headaches-with-grub-as-usual-4175657739/)

lucmove 07-20-2019 07:33 AM

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?

BW-userx 07-20-2019 07:45 AM

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.

lucmove 07-20-2019 08:16 AM

Quote:

Originally Posted by BW-userx (Post 6016921)
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?

BW-userx 07-20-2019 08:32 AM

that's a new on one me, found this, with a little searching on that subject.
https://unix.stackexchange.com/quest...ybrid-mbr-disk

colorpurple21859 07-20-2019 09:11 AM

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

lucmove 07-20-2019 09:31 AM

Quote:

Originally Posted by colorpurple21859 (Post 6016954)
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...

pan64 07-20-2019 11:13 AM

probably this helps: https://blog.hostonnet.com/grub-inst...nt-be-possible

colorpurple21859 07-20-2019 11:24 AM

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.

colorpurple21859 07-20-2019 05:15 PM

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

lucmove 07-21-2019 03:28 PM

Quote:

Originally Posted by colorpurple21859 (Post 6017072)
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 (Post 6017072)
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?

BW-userx 07-21-2019 03:46 PM

to find out what type of partition table you have. GPT,MBR, or other.

colorpurple21859 07-21-2019 04:12 PM

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.

lucmove 07-21-2019 04:31 PM

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.

colorpurple21859 07-21-2019 04:40 PM

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.

bodge99 07-21-2019 05:04 PM

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


All times are GMT -5. The time now is 08:42 AM.