View previous topic :: View next topic |
Author |
Message |
cwc Veteran
Joined: 20 Mar 2006 Posts: 1386 Location: Tri-Cities, WA USA
|
Posted: Wed Nov 13, 2024 7:16 pm Post subject: grub-install help bios boot{slvd} |
|
|
I've chrooted back into this new system that will not boot
openrc
please throw me a bone
three partitions
/boot ext4 <- this might be a mistake /boot ext4
swap
/ ext4
livecd /boot # grub-install /dev/sda
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.
livecd /boot # grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-6.6.58-gentoo-r1-gentoo-dist
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings ...
done
fdisk -l
Code: |
Device Start End Sectors Size Type
/dev/sda1 2048 2099199 2097152 1G Linux filesystem
/dev/sda2 2099200 69208063 67108864 32G Linux filesystem
/dev/sda3 69208064 500117503 430909440 205.5G Linux filesystem
|
livecd /boot # _________________ Without diversity there can be no evolution:)
Last edited by cwc on Thu Nov 14, 2024 6:57 pm; edited 1 time in total |
|
Back to top |
|
|
GDH-gentoo Veteran
Joined: 20 Jul 2019 Posts: 1709 Location: South America
|
Posted: Wed Nov 13, 2024 7:26 pm Post subject: Re: grub-install help bios boot |
|
|
cwc wrote: | grub-install: warning: this GPT partition label contains no BIOS Boot Partition; embedding won't be possible. |
Did you make a GPT on /dev/sda? Full output of fdisk should tell. If yes, and you are planning to use GRUB, then you are missing a BIOS boot partition for it, as seen in the "Type" column of your output. _________________
NeddySeagoon wrote: | I'm not a witch, I'm a retired electronics engineer |
Ionen wrote: | As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though |
|
|
Back to top |
|
|
bstaletic Guru
Joined: 05 Apr 2014 Posts: 374
|
Posted: Wed Nov 13, 2024 7:30 pm Post subject: |
|
|
cvc wrote: | /boot ext4 <- this might be a mistake /boot ext4 |
/boot being ext4 is fine, but where's your "EFI system partition"? ESP has to be FAT32. |
|
Back to top |
|
|
bstaletic Guru
Joined: 05 Apr 2014 Posts: 374
|
Posted: Wed Nov 13, 2024 7:32 pm Post subject: Re: grub-install help bios boot |
|
|
GDH-gentoo wrote: | cwc wrote: | grub-install: warning: this GPT partition label contains no BIOS Boot Partition; embedding won't be possible. |
Did you make a GPT on /dev/sda? Full output of fdisk should tell. If yes, and you are planning to use GRUB, then you are missing a BIOS boot partition for it, as seen in the "Type" column of your output. |
BIOS boot partition is only needed if booting GPT/legacy BIOS. For GPT/UEFI OP is missing EFI system partition instead. |
|
Back to top |
|
|
cwc Veteran
Joined: 20 Mar 2006 Posts: 1386 Location: Tri-Cities, WA USA
|
Posted: Wed Nov 13, 2024 7:33 pm Post subject: Re: grub-install help bios boot |
|
|
GDH-gentoo wrote: | cwc wrote: | grub-install: warning: this GPT partition label contains no BIOS Boot Partition; embedding won't be possible. |
Did you make a GPT on /dev/sda? Full output of fdisk should tell. If yes, and you are planning to use GRUB, then you are missing a BIOS boot partition for it, as seen in the "Type" column of your output. |
Thank you. I'm setting up a bios boot.
I created the partitions with fdisk. I did not perform the following option:
Code: |
Command (m for help):g
Created a new GPT disklabel (GUID: 3E56EE74-0571-462B-A992-9872E3855D75).
|
I'm not sure how to make /dev/sda1 /boot GPT. Did I miss a step? partitioning? _________________ Without diversity there can be no evolution:) |
|
Back to top |
|
|
GDH-gentoo Veteran
Joined: 20 Jul 2019 Posts: 1709 Location: South America
|
Posted: Wed Nov 13, 2024 7:46 pm Post subject: Re: grub-install help bios boot |
|
|
cwc wrote: | I created the partitions with fdisk. I did not perform the following option:
Code: |
Command (m for help):g |
|
And what did you do with fdisk, then? Did /dev/sda already have partitions before, and you are repartitioning it now, or what?
bstaletic wrote: | BIOS boot partition is only needed if booting GPT/legacy BIOS. |
Which seems to be this case (perhaps unintentionally?), but I'd like cwc's confirmation. _________________
NeddySeagoon wrote: | I'm not a witch, I'm a retired electronics engineer |
Ionen wrote: | As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though |
|
|
Back to top |
|
|
cwc Veteran
Joined: 20 Mar 2006 Posts: 1386 Location: Tri-Cities, WA USA
|
Posted: Wed Nov 13, 2024 7:57 pm Post subject: |
|
|
I'm bios booting.
All I did with fdisk was create the partitions then I formatted then with mkfs.ext4 /dev/sda1 and /dev/sda3
https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Disks#GUID_Partition_Table_.28GPT.29
Device Start End Sectors Size Type
/dev/sda1 2048 2099199 2097152 1G Linux filesystem
/dev/sda2 2099200 69208063 67108864 32G Linux filesystem
/dev/sda3 69208064 500117503 430909440 205.5G Linux filesystem
fdisk /dev/sda
Welcome to fdisk (util-linux 2.39.4).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
This disk is currently in use - repartitioning is probably a bad idea.
It's recommended to umount all file systems, and swapoff all swap
partitions on this disk.
Command (m for help): p
Disk /dev/sda: 238.47 GiB, 256060514304 bytes, 500118192 sectors
Disk model: FTM56N325H
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 000CD5C5-21DA-4446-AA17-0B0E72DE8BC1
Device Start End Sectors Size Type
/dev/sda1 2048 2099199 2097152 1G Linux filesystem
/dev/sda2 2099200 69208063 67108864 32G Linux filesystem
/dev/sda3 69208064 500117503 430909440 205.5G Linux filesystem
I just noticed this in the docs:
Code: |
Creating a new disklabel / removing all partitions
Pressing the g key will instantly remove all existing disk partitions and create a new GPT disklabel:
Command (m for help):g
Created a new GPT disklabel (GUID: 3E56EE74-0571-462B-A992-9872E3855D75).
Alternatively, to keep an existing GPT disklabel (see the output of p above), consider removing the existing partitions one by one from the disk. Press d to delete a partition. For instance, to delete an existing /dev/sda1:
|
Also:
Code: |
gdisk /dev/sda1
GPT fdisk (gdisk) version 1.0.10
Partition table scan:
MBR: not present
BSD: not present
APM: not present
GPT: not present
Creating new GPT entries in memory.
|
_________________ Without diversity there can be no evolution:) |
|
Back to top |
|
|
bstaletic Guru
Joined: 05 Apr 2014 Posts: 374
|
|
Back to top |
|
|
cwc Veteran
Joined: 20 Mar 2006 Posts: 1386 Location: Tri-Cities, WA USA
|
Posted: Wed Nov 13, 2024 8:14 pm Post subject: |
|
|
when using fdisk which option should I use to create the boot partition? {I'm going for a walk }
M or g ( I want a bios boot)
Code: |
GPT
M enter protective/hybrid MBR
Generic
d delete a partition
F list free unpartitioned space
l list known partition types
n add a new partition
p print the partition table
t change a partition type
v verify the partition table
i print information about a partition
Misc
m print this menu
x extra functionality (experts only)
Script
I load disk layout from sfdisk script file
O dump disk layout to sfdisk script file
Save & Exit
w write table to disk and exit
q quit without saving changes
Create a new label
g create a new empty GPT partition table
G create a new empty SGI (IRIX) partition table
o create a new empty MBR (DOS) partition table
s create a new empty Sun partition table
|
_________________ Without diversity there can be no evolution:) |
|
Back to top |
|
|
GDH-gentoo Veteran
Joined: 20 Jul 2019 Posts: 1709 Location: South America
|
Posted: Wed Nov 13, 2024 8:29 pm Post subject: |
|
|
cwc wrote: | I'm bios booting. |
Noted.
cwc wrote: | Disklabel type: gpt |
And you have a GPT. So you need to make a choice now.
cwc wrote: | Device Start End Sectors Size Type
/dev/sda1 2048 2099199 2097152 1G Linux filesystem
/dev/sda2 2099200 69208063 67108864 32G Linux filesystem
/dev/sda3 69208064 500117503 430909440 205.5G Linux filesystem |
First remark: If you are going to use GRUB, you don't need to have a separate partition for /boot, but can if you want to.
Second remark: If you are going to use GRUB in this scenario, as the Handbook says, you need a BIOS boot partition. This is a small partition of 1 or 2 MB (compared to that, your existing 1GB /dev/sda1 is huge), doesn't have a filesystem, and is never mounted. And must not be confused with "the partition that will be mounted at /boot", which might be none.
So, you can repurpose /dev/sda1 as the BIOS boot partition for GRUB, even though it is huge, and leave /boot as part of your future rootfs (/dev/sda3 I suppose), or repartition.
What do you want to do? _________________
NeddySeagoon wrote: | I'm not a witch, I'm a retired electronics engineer |
Ionen wrote: | As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though |
Last edited by GDH-gentoo on Wed Nov 13, 2024 8:34 pm; edited 1 time in total |
|
Back to top |
|
|
grknight Retired Dev
Joined: 20 Feb 2015 Posts: 1923
|
Posted: Wed Nov 13, 2024 8:33 pm Post subject: |
|
|
Alternate option, use gdisk (from gptfdisk package) to convert GPT -> MBR |
|
Back to top |
|
|
GDH-gentoo Veteran
Joined: 20 Jul 2019 Posts: 1709 Location: South America
|
Posted: Wed Nov 13, 2024 8:38 pm Post subject: |
|
|
grknight wrote: | Alternate option, use gdisk (from gptfdisk package) to convert GPT -> MBR |
Will that preserve existing partitions? _________________
NeddySeagoon wrote: | I'm not a witch, I'm a retired electronics engineer |
Ionen wrote: | As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though |
|
|
Back to top |
|
|
bstaletic Guru
Joined: 05 Apr 2014 Posts: 374
|
Posted: Wed Nov 13, 2024 8:42 pm Post subject: |
|
|
Could the BIOS boot partition fit inside those 2048 sectors at the start of the disk?
2048*512B == 1MiB
I know that the 1st sector is the boot sector, but I seem to remember myself creating the BIOS boot partition inside those first 2048 sectors and booting fine. |
|
Back to top |
|
|
grknight Retired Dev
Joined: 20 Feb 2015 Posts: 1923
|
Posted: Wed Nov 13, 2024 8:48 pm Post subject: |
|
|
GDH-gentoo wrote: | grknight wrote: | Alternate option, use gdisk (from gptfdisk package) to convert GPT -> MBR |
Will that preserve existing partitions? |
In most cases, yes. Very rarely it might fail but never seen it before. |
|
Back to top |
|
|
cwc Veteran
Joined: 20 Mar 2006 Posts: 1386 Location: Tri-Cities, WA USA
|
Posted: Wed Nov 13, 2024 10:17 pm Post subject: |
|
|
I'm going to start over from scratch. It will be good for me.
Now when partitioning to a bios boot (simple) with grub
What is a good method to make sure the disk/partition is GPT? _________________ Without diversity there can be no evolution:) |
|
Back to top |
|
|
GDH-gentoo Veteran
Joined: 20 Jul 2019 Posts: 1709 Location: South America
|
Posted: Wed Nov 13, 2024 11:02 pm Post subject: |
|
|
cwc wrote: | What is a good method to make sure the disk/partition is GPT? |
To create a GUID Partition Table with fdisk? What the Habdbook says:
cwc wrote: | Code: | Creating a new disklabel / removing all partitions
Pressing the g key will instantly remove all existing disk partitions and create a new GPT disklabel:
Command (m for help):g
Created a new GPT disklabel (GUID: 3E56EE74-0571-462B-A992-9872E3855D75). |
|
If you meant to ask how do you make a BIOS boot partition, then you do the same as with any other partition, but then mark it using fdisk's 't' command. The Handbook shows how to mark a partition as the EFI System Partition; this is the same, but with another number I don't recall. You can search that number in the output of the 'l' command:
cwc wrote: | Code: | l list known partition types |
|
_________________
NeddySeagoon wrote: | I'm not a witch, I'm a retired electronics engineer |
Ionen wrote: | As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though |
|
|
Back to top |
|
|
pingtoo Veteran
Joined: 10 Sep 2021 Posts: 1252 Location: Richmond Hill, Canada
|
Posted: Thu Nov 14, 2024 12:13 am Post subject: |
|
|
cwc wrote: | I'm going to start over from scratch. It will be good for me.
Now when partitioning to a bios boot (simple) with grub
What is a good method to make sure the disk/partition is GPT? | Being idle, I want to refresh my sgdisk skill, so I come up following script Code: | sgdisk -a 1 --new=1:34:2047 --change-name=1:"boot" --typecode=1:ef02 --partition-guid=1:21686148-6449-6E6F-744E-656564454649 /dev/sda
sgdisk --new=2:0:+32G --change-name=2:"linux" --typecode=2:8300 /dev/sda
sgdisk --new=3:0:+210432M --change-name=3:"root" --typecode=3:8300 /dev/sda
sgdisk -p /dev/sda |
I cannot guarantee the correctness of this code for Grub, I don't use Grub. I just follow that Archlinux article.
NOTE: - The BIOS Boot Partition size is 1007.0 KiB, if your "core.img" somehow larger than that you will need to adjust the command.
- You can try use "grub-mkimage -o /tmp/core.img <list of modules used in your grub.cfg> to check its size. (this is not installation. it is just for checking)
- The partition guid is follow Archlinux GUID Partition Table (GPT) specific instructions
- Partition name, i.e "boot", "linux" or "root" is just my guess you are welcome to change it anything you want it does not affect how grub discover where is BIOS Boot Partition.
- typecode for BIOS Boot Partition is important, it should be "ef02"
- Other typecode can be obtain from command sgdisk -L /dev/sda
- The "-a 1" in the first sgdisk is because the default alignment is 2048, with it sgdisk will realignment first partition to 2048 sector
- You most likely need root privilege to run these sgdisk command.
- You can use sgdisk -i 1 -i 2 -i 3 for more detail information.
|
|
Back to top |
|
|
cwc Veteran
Joined: 20 Mar 2006 Posts: 1386 Location: Tri-Cities, WA USA
|
Posted: Thu Nov 14, 2024 3:05 pm Post subject: |
|
|
[*]Other typecode can be obtain from command sgdisk -L /dev/sda
wow! thank you!
Code: |
sgdisk -L /dev/sda
0700 Microsoft basic data 0701 Microsoft Storage Replica
...m-crypt LUKS block write-ahe
f817 Ceph dm-crypt LUKS OSD fb00 VMWare VMFS
fb01 VMWare reserved fc00 VMWare kcore crash protection
fd00 Linux RAID
***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory.
***************************************************************
Warning! Secondary partition table overlaps the last partition by
33 blocks!
You will need to delete this partition or resize it in another utility
|
_________________ Without diversity there can be no evolution:)
Last edited by cwc on Thu Nov 14, 2024 6:58 pm; edited 1 time in total |
|
Back to top |
|
|
cwc Veteran
Joined: 20 Mar 2006 Posts: 1386 Location: Tri-Cities, WA USA
|
Posted: Thu Nov 14, 2024 4:07 pm Post subject: boot failed |
|
|
Reinstalled everything after formatting disks as GPT.
Could it be the bios.
Still I get this error. I'll stay calm.
Code: |
ivecd /boot # grub-install /dev/sda
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.
|
Code: |
#gdisk /dev/sda
GPT fdisk (gdisk) version 1.0.10
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Command (? for help):
|
Code: |
# grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-6.6.58-gentoo-r1-gentoo-dist
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings ...
done
(chroot) livecd ~ #
|
_________________ Without diversity there can be no evolution:) |
|
Back to top |
|
|
sMueggli Guru
Joined: 03 Sep 2022 Posts: 497
|
Posted: Thu Nov 14, 2024 4:18 pm Post subject: Re: boot failed |
|
|
cwc wrote: | Reinstalled everything after formatting disks as GPT.
Could it be the bios.
Still I get this error. I'll stay calm.
Code: |
ivecd /boot # grub-install /dev/sda
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.
|
|
Please show |
|
Back to top |
|
|
cwc Veteran
Joined: 20 Mar 2006 Posts: 1386 Location: Tri-Cities, WA USA
|
Posted: Thu Nov 14, 2024 4:28 pm Post subject: Re: boot failed |
|
|
sMueggli wrote: | cwc wrote: | Reinstalled everything after formatting disks as GPT.
Could it be the bios.
Still I get this error. I'll stay calm.
Code: |
ivecd /boot # grub-install /dev/sda
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.
|
|
Please show |
thank youlivecd ~ # fdisk -l
Disk /dev/sda: 238.47 GiB, 256060514304 bytes, 500118192 sectors
Disk model: FTM56N325H
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 3499D78F-6BDB-4665-BFAB-6B3915871DE6
Device Start End Sectors Size Type
/dev/sda1 2048 2099199 2097152 1G Linux filesystem
/dev/sda2 2099200 69208063 67108864 32G Linux filesystem
/dev/sda3 69208064 500117503 430909440 205.5G Linux filesystem _________________ Without diversity there can be no evolution:) |
|
Back to top |
|
|
sMueggli Guru
Joined: 03 Sep 2022 Posts: 497
|
Posted: Thu Nov 14, 2024 4:37 pm Post subject: |
|
|
You still did not create a "BIOS boot" partition.
Using fdisk, you need to select "BIOS boot" as partition type. The size should be 1MiB. |
|
Back to top |
|
|
flysideways Guru
Joined: 29 Jan 2005 Posts: 491
|
Posted: Thu Nov 14, 2024 4:45 pm Post subject: |
|
|
cwc,
The Handbook does not presently give guidance on the install that you are choosing.
It presently only describes using GPT with UEFI, or, MBR with BIOS.
The GRUB Wiki page describes using GPT with BIOS that you are attempting.
The short version is, you need four partitions, if following the /boot /swap / partitioning scheme, there must also be an additional BIOS Boot Partition, not to be confused with the /boot partition.
Quote: | Partitioning for BIOS with GPT
When a GPT partition table is present on the system, a small BIOS boot partition with type EF02 (which is different from the EFI System Partition (ESP) which has type EF00) will need to be available. 1 MiB will be enough to work, but 2-4 MiB is a safer option. This BIOS boot partition will hold the stage 2 of the bootloader. BIOS boot partitions do not need to be formatted with a filesystem; the grub-install command will overwrite any existing filesystem with one of its own. |
The example in that wiki entry for the partitioning scheme is for dual boot with Windows, hence the extra partitions.
Quote: | Important
The BIOS boot partition is not the same partition that is commonly mounted at /boot. The /boot and BIOS boot are different partitions and should be handled separately. The BIOS boot partition should not be regularly mounted on the system (i.e., it should not be defined in /etc/fstab). The /boot partition can be regularly mounted with no issues and therefore can be present in the /etc/fstab file. |
|
|
Back to top |
|
|
cwc Veteran
Joined: 20 Mar 2006 Posts: 1386 Location: Tri-Cities, WA USA
|
Posted: Thu Nov 14, 2024 5:57 pm Post subject: |
|
|
thank you flysideways
I have a bios boot with openrc with the following configuration on another system.
Code: |
fdisk -l
Disk /dev/sda: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: WDC WDS100T2B0A
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x1d6021cc
yoda ~ # gdisk /dev/sda
GPT fdisk (gdisk) version 1.0.10
Partition table scan:
MBR: MBR only
BSD: not present
APM: not present
GPT: not present
|
I really do not know what I want to do now. MBR or GPT? _________________ Without diversity there can be no evolution:) |
|
Back to top |
|
|
grknight Retired Dev
Joined: 20 Feb 2015 Posts: 1923
|
Posted: Thu Nov 14, 2024 6:10 pm Post subject: |
|
|
Since you are still having problems, convert from GPT to MBR like I've said previously.
gdisk /dev/sda, then press: r, Enter, g, Enter |
|
Back to top |
|
|
|