Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] GRUB not working on GPT + BIOS
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
elnll002
n00b
n00b


Joined: 15 Jul 2016
Posts: 9

PostPosted: Wed May 30, 2018 5:40 pm    Post subject: [Solved] GRUB not working on GPT + BIOS Reply with quote

Hi there. I'm having a headache on this...

I have 3 disks:

SDA: Just a partition ext4 with data...

SDB: Where I'm trying to install gentoo... It is a GPT disk, as I'm booting with BIOS.
sdb1: 2MB as EF00 for bios
sdb2: boot partition, 500mb
sdb3: 20GB swap
sdb4: 90GB aprox for root.
It is a SDD disk

SDC: Windows in a whole separate disk.


I installed grub2 and configured. It detects both gentoo and windows when I make grub-mkconfig. None errors found on installation nor configuration.

But when I try to start the system, grub does not shows up. it shows a black screen with a pointer for a few secconds, then reboot and starts with another disk (windows in this case, but tryes to start any other disk).

I used genkernel in the instalation. (I run out of time).

I dont know what any more data to share. I dont have any logs as I never had booted in.

Hope someone can help me. Thank you!


Last edited by elnll002 on Fri Jun 01, 2018 2:48 am; edited 1 time in total
Back to top
View user's profile Send private message
ValerieVonck
n00b
n00b


Joined: 17 Aug 2017
Posts: 25
Location: Erpe-Mere, Oostvlaanderen

PostPosted: Wed May 30, 2018 6:12 pm    Post subject: Reply with quote

elnll002,

You were taking about Grub + BIOS, but you partitioned it according to uEFI?
Why?

Please see: https://forums.gentoo.org/viewtopic-t-1080586.html for my reply on a previous question.

Be careful!
Did you do a: when setting this up???
Code:
mkfs.fat -T 32 /dev/sdbX


Chroot into your install:

Do a
Code:

grub-install /dev/sdX


so in your case:

Code:

grub-install /dev/sdb


then

BIOS:
Code:
grub-mkconfig -o /boot/grub/grub.cfg


EFI:
Code:

- echo 'GRUB_PLATFORMS="efi-64"' >> /etc/portage/make.conf
- emerge -av grub
- grub-install --target=x86_64-efi --efi-directory=/boot
- mount -o remount,rw /sys/firmware/efi/efivars (if needed)
- grub-install --target=x86_64-efi --efi-directory=/boot --removable


- grub-mkconfig -o /boot/grub/grub.cfg

Please post the content of:

/etc/fstab
/boot

You can enter grub at boot time if boot fails
For more details, please refer to
Code:
man grub

or

https://www.gnu.org/software/grub/manual/grub/grub.html#Naming-convention

-> Section 2, naming convention,
For starting your install, you must confirm, you have a kernel / system map / initramfs

Quote:

First of all, GRUB requires that the device name be enclosed with ‘(’ and ‘)’. The ‘fd’ part means that it is a floppy disk. The number ‘0’ is the drive number, which is counted from zero. This expression means that GRUB will use the whole floppy disk.

(hd0,msdos2)
Here, ‘hd’ means it is a hard disk drive. The first integer ‘0’ indicates the drive number, that is, the first hard disk, the string ‘msdos’ indicates the partition scheme, while the second integer, ‘2’, indicates the partition number (or the PC slice number in the BSD terminology). The partition numbers are counted from one, not from zero (as was the case in previous versions of GRUB). This expression means the second partition of the first hard disk drive. In this case, GRUB uses one partition of the disk, instead of the whole disk.

(hd0,msdos5)
This specifies the first extended partition of the first hard disk drive. Note that the partition numbers for extended partitions are counted from ‘5’, regardless of the actual number of primary partitions on your hard disk.

(hd1,msdos1,bsd1)
This means the BSD ‘a’ partition on first PC slice number of the second hard disk.

Of course, to actually access the disks or partitions with GRUB, you need to use the device specification in a command, like ‘set root=(fd0)’ or ‘parttool (hd0,msdos3) hidden-’. To help you find out which number specifies a partition you want, the GRUB command-line (see Command-line interface) options have argument completion. This means that, for example, you only need to type

set root=(
followed by a TAB, and GRUB will display the list of drives, partitions, or file names. So it should be quite easy to determine the name of your target partition, even with minimal knowledge of the syntax.

Note that GRUB does not distinguish IDE from SCSI - it simply counts the drive numbers from zero, regardless of their type. Normally, any IDE drive number is less than any SCSI drive number, although that is not true if you change the boot sequence by swapping IDE and SCSI drives in your BIOS.

Now the question is, how to specify a file? Again, consider an example:

(hd0,msdos1)/vmlinuz
This specifies the file named ‘vmlinuz’, found on the first partition of the first hard disk drive. Note that the argument completion works with file names, too.

That was easy, admit it. Now read the next chapter, to find out how to actually install GRUB on your drive.

_________________
Inter antecessum est melius
Back to top
View user's profile Send private message
elnll002
n00b
n00b


Joined: 15 Jul 2016
Posts: 9

PostPosted: Wed May 30, 2018 10:48 pm    Post subject: Reply with quote

ValerieVonck wrote:
elnll002,

You were taking about Grub + BIOS, but you partitioned it according to uEFI?
Why?



Do you say that by the sdb1 partition? I believed it was necessary even on BIOS. Anyway, I tried to make grub-install without this and I get an error. It says I need that partition.

ValerieVonck wrote:

Did you do a: when setting this up???
Code:
mkfs.fat -T 32 /dev/sdbX


I didn't. I made /boot as ext4. In the bottom I put a pastebin with the output of fdisk -l

ValerieVonck wrote:

Do a
Code:

grub-install /dev/sdX


so in your case:

Code:

grub-install /dev/sdb


then

BIOS:
Code:
grub-mkconfig -o /boot/grub/grub.cfg



That's what I do.

ValerieVonck wrote:

You can enter grub at boot time if boot fails
For more details, please refer to
Code:
man grub

or

https://www.gnu.org/software/grub/manual/grub/grub.html#Naming-convention

I can't, because grub never starts. I dont get any place to write anything. It only shows a black screen with a pointer for a few seconds, then restarts and my bios starts with another disk..


ValerieVonck wrote:

Please post the content of:

/etc/fstab
/boot



Here you are:

/etc/default/grub
https://paste.pound-python.org/show/KYl8M4heNR6V03DlNaOU/

/etc/fstab
https://paste.pound-python.org/show/HyIR8nwIk0PqvCWVfAsA/

ls -l /boot
https://paste.pound-python.org/show/1Y2WujiVTh89TZcG87GJ/

/boot/grub.cfg (once generated)
https://paste.pound-python.org/show/qAiqJEH7052X3VI00sDO/

fdisk -l
https://paste.pound-python.org/show/XbwVnd69lQD0A34qgDEG/


Thank you for help!!


UPDATE: I tried to unistall GRUB, and install LILO in replace. I get the SAME problem: Black screen with a pointer, just a few seconds then restarts and the bios chose another disk to start with ... So I supose is something with the bios or my partition scheme. I think the last one, because I had a qubes os perfectly installed few days ago...
I dont know what else to do to fix this.. :P I already installed it three times.
Back to top
View user's profile Send private message
ValerieVonck
n00b
n00b


Joined: 17 Aug 2017
Posts: 25
Location: Erpe-Mere, Oostvlaanderen

PostPosted: Thu May 31, 2018 5:13 am    Post subject: Reply with quote

From your fstab:

Code:
#/dev/sdb2      /boot      ext4      default,noatime         0 0
/dev/sdb4      /      ext4      default,noatime,discard      0 1
/dev/sdb3      none      swap      sw            0 0
UUID=abfee9f6-ba01-4777-8f09-7ee1ea8090d1   /boot   ext4   defaults   0   2


Why did you commented out the first line?
Why did you made a gpt label?

Can you uncomment the first line and comment the last line?

Your grub.cfg seems fine.

Did you enable the boot flag on boot partition
- Fdisk
- a
- which partition...

Can you do a gparted -l and paste it here?

Thank you,
Kr,
V
_________________
Inter antecessum est melius
Back to top
View user's profile Send private message
Marcih
Apprentice
Apprentice


Joined: 19 Feb 2018
Posts: 152

PostPosted: Thu May 31, 2018 8:00 am    Post subject: Reply with quote

Just my $0.02:

Why did you use GPT? There's no reason to use the GPT layout with "classic" BIOS unless you're working with >2TB disk (as far as my knowledge goes, anyone more knowledgeable feel free to correct me). If you hadn't used GPT, you could've omitted the 2MB BIOS partition at the start (MBR has small, unpartitioned space on the very start of the disk that GRUB uses when booting on classic BIOS. GPT doesn't have this space so you create a small, unformatted partition on the beginning of the GPT disk. It would be useful for the handbook to mention that you should ideally be using either MBR+BIOS or GPT+UEFI and that the 2MB bios_grub partiton is needed only in the rare event of GPT+BIOS).

You say:
elnll002 wrote:
But when I try to start the system, grub does not shows up. it shows a black screen with a pointer for a few secconds, then reboot and starts with another disk (windows in this case, but tryes to start any other disk).
Does that mean you don't see the GRUB menu options at all? I noticed that your grub.cfg is in the root directory of /dev/sdb2 (your boot partition, therefore /boot/grub.cfg), yet all the documentation refers to it being in /boot/grub/grub.cfg. Since it is that config file that "draws" that menu selection and it's how GRUB knows what to do, that may be your issue. Try deleting your current grub.cfg and putting it in the "correct" place. So, chrooted into your install and /dev/sdb2 mounted at /boot:
Code:
# rm /boot/grub.cfg
# grub-mkconfig -o /boot/grub/grub.cfg


What is it that you tried with LILO? Did you follow the handbook? Can you post any more details about that attempt?
_________________
Bones McCracker wrote:
It wouldn't be so bad, if it didn't suck.

===
I refuse to move on from GTK+2.
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 3076
Location: Illinois, USA

PostPosted: Thu May 31, 2018 12:45 pm    Post subject: Reply with quote

There is nothing wrong with partitioning with gpt and having a bios boot. It sets up the disk for eventual UEFI boot without repartitioning.

That's not his problem. Possibly the UUID is, but I don't know that. Maybe it's the wrong UUID which would fit the symptoms.
Back to top
View user's profile Send private message
elnll002
n00b
n00b


Joined: 15 Jul 2016
Posts: 9

PostPosted: Thu May 31, 2018 7:35 pm    Post subject: Reply with quote

Marcih wrote:
Just my $0.02:

What is it that you tried with LILO? Did you follow the handbook? Can you post any more details about that attempt?


Yes, I followed the handbook.

Thank you every one for answer. I will try a little bit of everyone and I will post here the results. I think Marcih is rigth about the place where I put the grub.

Marcih wrote:

Why did you commented out the first line?

Because I used the last one.

I used GPT because It was there before. No reason at all jaja. I can't change it now because it would imply to make the install from beginning.
Back to top
View user's profile Send private message
elnll002
n00b
n00b


Joined: 15 Jul 2016
Posts: 9

PostPosted: Thu May 31, 2018 8:10 pm    Post subject: Reply with quote

No way... I tried reinstalling grub. (Before I added grub_platforms="pc" on make.conf). I writed grub.conf in the rigth folder (/boot/grub/grub.cfg), I changed the fstab file to use /dev/sdb2 instead uuid.

Nothing worked... same error.

I will try a fresh install using mbr... Hope it works:P
Back to top
View user's profile Send private message
Tyrus
Tux's lil' helper
Tux's lil' helper


Joined: 03 Feb 2018
Posts: 141

PostPosted: Thu May 31, 2018 8:46 pm    Post subject: Reply with quote

@elnll002:
You said in the first post that everything was installed correctly. And for me that's mostly correct.
The problem is grubs does not start.

The Gentoo Handbook says (https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Disks):
Quote:

[...]

GPT or MBR

From the description above, one might think that using GPT should always be the recommended approach, however there are a few caveats.

Using GPT on a BIOS-based computer works, but then one cannot dual-boot with a Microsoft Windows operating system. The reason is that Microsoft Windows will boot in UEFI mode if it detects a GPT partition label.

Some buggy motherboard firmware configured to boot in BIOS/CSM/legacy mode might also have problems with booting from GPT labeled disks. If that is the case, it might be possible to work around the problem by adding the boot/active flag on the protective MBR partition which has to be done through fdisk with the -t dos option to force it to read the partition table using the MBR format.

[...]


So according to the handbook you can't dual boot into Windows with GPT.
The reason grub is not starting could be also GPT. Reason could be the motherboard.

The easiest solution seems to me, to work with MBR and not GPT.
Back to top
View user's profile Send private message
elnll002
n00b
n00b


Joined: 15 Jul 2016
Posts: 9

PostPosted: Fri Jun 01, 2018 2:47 am    Post subject: Reply with quote

No. But I have windows in a whole separated disk.

I finally could fix it doing a fresh install wit MBR and now it works...

Now I have a problem with the fonts :P But thats for another topic in case I cant fix it... jejeje.

Thank you everyone!
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 3076
Location: Illinois, USA

PostPosted: Fri Jun 01, 2018 9:13 am    Post subject: Reply with quote

Apparently you have one of those broken BIOS's. Would you mind posting your motherboard model/manufacturer so we can avoid it?
Back to top
View user's profile Send private message
elnll002
n00b
n00b


Joined: 15 Jul 2016
Posts: 9

PostPosted: Mon Jun 11, 2018 10:06 pm    Post subject: Reply with quote

Sorry for late answer tony. As it was solved I didnt make atention on the topic.

Here is:

Manufacturer: ASUSTeK COMPUTER INC.
Product Name: B85M-E
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 3076
Location: Illinois, USA

PostPosted: Mon Jun 11, 2018 10:57 pm    Post subject: Reply with quote

Thanks!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum