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-21-2019 06:12 PM

Quote:

Originally Posted by bodge99 (Post 6017342)
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.

I am merely replicating everything I ever did on the first hard disk, always successfully.

Quote:

Originally Posted by bodge99 (Post 6017342)
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.

gdisk says it is and it does. It produces the exact same output for both disks except size.

bodge99 07-21-2019 06:35 PM

Hi,

Please don't think that I'm doubting you.. I'm not! It's just that installing grub to sda implies an MBR disk, whereas the report of GPT & protective MBR implies a GPT drive.

Without knowing more about the drive's history, then I can only guess the exact status of your drives. I'm of the opinion that the grub MBR write operation has bypassed the protective MBR and has ended up at the very front of the GPT drive.. In essence you may have something that is close to being a hybrid MBR/GPT drive.

I personally avoid these like the plague. I consider them virtual "time bombs" from the data security point of view. The drives may work perfectly fine on your machine now, but they may be "problematic" if moved to another.

Bodge99

colorpurple21859 07-21-2019 07:43 PM

Quote:

I think that poor UEFI firmware is behind most of these problems.. Just my 10p worth...
That is part of the problem not all uefi firmware behaves the same way. On my other system it wouldn't let you boot the internal drive in legacy mode. This system it will boot internal gpt drive in legacy mode when legacy mode is enabled and there are no efi entries in the bios firmware. I found that one out by accident. The other system efibootmgr worked as advertised, this system not so much.
Without knowing the ops ouput of fdisk -l and the bios settings can't tell what is really happening.

lucmove 07-22-2019 01:10 PM

I converted my GPT table to MBR with gdisk. It worked and stupid Grub finally decided to install.

AFTER TWO DAYS OF STRUGGLE, it's booting. Cue the angel choir and the heavenly light beam.

Whatever. As long as I don't have to wrestle with that hunk of garbage anymore.

I won't mark this as solved. What if I it was a larger disk and I really had to use GPT? Grub sucks and stinks to high heaven.

Moving on with my life. Thank you for the attention.

colorpurple21859 07-22-2019 02:09 PM

I believe a 1mb partition flagged as bios-grub would have also fixed the problem with the gpt disk.
https://en.wikipedia.org/wiki/BIOS_boot_partition that I mentioned in post 5.
Anyways at least you got working.:)

pan64 07-23-2019 02:04 AM

Quote:

Originally Posted by lucmove (Post 6017595)
I converted my GPT table to MBR with gdisk. It worked and stupid Grub finally decided to install.

AFTER TWO DAYS OF STRUGGLE, it's booting. Cue the angel choir and the heavenly light beam.

Whatever. As long as I don't have to wrestle with that hunk of garbage anymore.

I won't mark this as solved. What if I it was a larger disk and I really had to use GPT? Grub sucks and stinks to high heaven.

Moving on with my life. Thank you for the attention.


Did you try [to check] my post (#7)? I mean the link I posted.
(From my side if I have no idea about what's happening I used to say stupid me)

lucmove 07-23-2019 05:11 AM

Quote:

Originally Posted by pan64 (Post 6017741)
Did you try [to check] my post (#7)? I mean the link I posted.
(From my side if I have no idea about what's happening I used to say stupid me)

I saw it and I didn't like the idea of creating a new 2MB partition. I had an empty 1MB space. I don't know if that would be enough, but I know that adding it would change the labels/numbering of sda1, sda2, sda3 etc.

Let's face it: Grub only does a half-assed job of supporting EFI. It requires kludges, ropes and stepping stones to reach it. Do Win and Mac users (no dual boot) go through that too?

And there is nothing stupid about me. I want something very reasonable. I want to say, "Computer, apply the proper code to the boot sector of this disk so it will boot." I am not asking it to make coffee. I am asking that it boots. When the mere wish to BOOT UP is asking too much or requires so much bending over backwards, something is very wrong. I could not BOOT UP, for Turing's sake. That is ridiculous.

Thank you for your contribution. I kept that tab opened for most of the time of my predicament. I just thought it wasn't the best approach.

colorpurple21859 07-23-2019 05:46 AM

Quote:

Grub only does a half-assed job of supporting EFI
But your not booting in efi, your booting in legacy mode. Check to see if you have a /sys/firmware/efi folder.

lucmove 07-23-2019 10:53 AM

Quote:

Originally Posted by colorpurple21859 (Post 6017797)
But your not booting in efi, your booting in legacy mode. Check to see if you have a /sys/firmware/efi folder.

No, I don't. Do you?

I didn't choose that. When I boot up off a CD or USB, my motherboard offers me two boot menu items for it: UEFI and not. I booted into UEFI mode when I booted off the Debian CD and installed it. Debian or Grub in Debian decided to install the "legacy" flavor, not me.

Now, I don't have that option for hard disks. I guess it's whatever Grub tells the BIOS about them then.

Do you boot in EFI mode? Do you have trouble installing Grub in a legacy MBR disk, or does this problem only happen when it's the other way around?

hazel 07-23-2019 11:14 AM

Just a brief note on GPT disks. They can boot from a BIOS, a UEFI in legacy mode (which behaves like a BIOS) or a UEFI in native mode. But the GRUB requirements will vary.

If you are booting a GPT disk from a BIOS (or anything that behaves like one), the first part of GRUB will go into the "protective MBR" because that's where the BIOS will expect to find it. But the second part of GRUB can't go into its usual position between the MBR and the first partition because that space doesn't exist on a GPT disk. It's taken up by the further sectors of the partition table.

So in such cases, you need the first partition to be a "BIOS boot partition". This is a special type of partition created with gparted or gdisk to contain GRUB Stage 2. You don't put a filesystem on it because GRUB Stage 1 needs to find Stage 2 by its physical address, not by a filename. You obviously don't have such a partition; that's what grub-install is complaining about. If you can create one (it only needs to be a few MB), your problem is solved.

Some of the posters in this thread seem to be confusing the BIOS boot partition with the EFI System Partition. This will only exist if you have a UEFI. Unlike a BIOS boot partition, an ESP has a filesystem, which must be FAT-based. Usually it is FAT32. If you are booting with a UEFI in native mode, GRUB stage 2 will go here and the UEFI will boot it directly. You don't even need stage 1 in that case.

btw I agree with the OP about GRUB. It's a horrible mess.

bodge99 07-23-2019 11:41 AM

hi,

I've never had any problems with Grub at all.. For single installations (only one os per machine) I just use the distro boot tools.. these tend to be fully automated and work pretty well. One machines that I multi boot with, I tend to do things "my way". Basically put grub (and all of the grub support files) into the EFI partition. A manually created grub.cfg in /boot/efi/EFI/BOOT (or /EFI/BOOT wrt the tld of the EFI partition) allows each installation grub configuration to be totally independent.

Why would you attempt a UEFI/GPT installation on an MBR/legacy system or a legacy installation on a UEFI/GPT system?? This makes as much sense as putting diesel in a petrol engine..

Bodge99

colorpurple21859 07-23-2019 12:13 PM

Quote:

Do you boot in EFI mode? Do you have trouble installing Grub in a legacy MBR disk, or does this problem only happen when it's the other way around?
NO, not anymore I took the time to learn how grub works with gpt disks in efi and legacy mode both. I boot multiple distros along with windows on gpt disk without no problems on the hp laptop that I currently use. I'm able to boot in efi or legacy mode with the Linux distros

Quote:

I booted into UEFI mode when I booted off the Debian CD and installed it. Debian or Grub in Debian decided to install the "legacy" flavor, not me.
or at least you thought you was booting in uefi mode, henceforth the question did you have a /sys/firmware/efi directory, if the answer was no, you booted in legacy mode. Yes, I'm well aware of that being the problem, but none of the suggestions that was being made, you didn't won't to do for one reason or another and you wouldn't post some of the information that was asked, so like I said earlier it was just a guessing game.

Anyways at least you figured out a way to get it fixed to your liking.


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