Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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.
Distribution: Artix, Slackware, Devuan etc. No systemd!
Posts: 368
Rep:
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.
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.
Last edited by colorpurple21859; 07-21-2019 at 07:49 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.
Last edited by colorpurple21859; 07-22-2019 at 02:27 PM.
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.
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?
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.
Distribution: Artix, Slackware, Devuan etc. No systemd!
Posts: 368
Rep:
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..
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.
Last edited by colorpurple21859; 07-23-2019 at 12:18 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.