Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Mistake in Gentoo Handbook regarding BIOS Partitioning?
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
Greemngreek
n00b
n00b


Joined: 09 Sep 2019
Posts: 10

PostPosted: Tue Feb 09, 2021 5:48 am    Post subject: Mistake in Gentoo Handbook regarding BIOS Partitioning? Reply with quote

The Handbooks suggests a 2mb partition for BIOS Boot in the 'Preparing the Disks' Section

In the 'Using fdisk' Section, from what I've understood, it suggests marking it 'BIOS boot' for UEFI Systems and leave it be for BIOS Systems.
https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Disks#Creating_the_BIOS_boot_partition

Code:

Mark the partition for UEFI purposes:
Command (m for help):t

Selected partition 1
Hex code (type L to list codes): 4
Changed system type of partition 1 to 4 (BIOS boot)


And then in the next step when the boot partition (for BIOS) / EFI partition (for UEFI) is created (from the POV that you are installing it on a BIOS machine [1]) and the partition table is printed again, the 2mb partition is marked 'EFI (FAT-12/16/32)' for some reason
https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Disks#Creating_the_boot_partition

Code:

Now, when pressing p, the following partition printout is displayed:
Command (m for help):p

Disk /dev/sda: 30.0 GB, 30005821440 bytes
240 heads, 63 sectors/track, 3876 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes
 
   Device Boot    Start       End    Blocks   Id  System
/dev/sda1             1         3      5198+    ef  EFI (FAT-12/16/32)
/dev/sda2             3        14    105808+  83  Linux


Is this a mistake or did I miss anything? Do I need to mark the partition (on my BIOS laptop)? If so, as EFI or BIOS ?

[1] During the creation of the partition, fdisk asks whether it's primary or extended which happens only on BIOS/MBR systems
Back to top
View user's profile Send private message
Zucca
Moderator
Moderator


Joined: 14 Jun 2007
Posts: 3386
Location: Rasi, Finland

PostPosted: Tue Feb 09, 2021 9:10 am    Post subject: Reply with quote

You need to have BIOS boot partition if
  • you boot using legacy BIOS booting method (bootloader on MBR)
  • AND you decide to use GPT partition table.


(I guess it then easier to switch to UEFI boot if you swap the hard drive to a new machine. Although you need to have EFI partition as well then.)

So you don't need it if you're going use MBR partition table...

Further reading.
_________________
..: Zucca :..
Gentoo IRC channels reside on Libera.Chat.
--
Quote:
I am NaN! I am a man!
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54391
Location: 56N 3W

PostPosted: Tue Feb 09, 2021 9:16 am    Post subject: Reply with quote

Greemngreek,

That section of the handbook needs some TLC.

The idea is that that the harndbook would only cover EFI booting and point to an Annex for BIOS Booting.
That link covers the How do I choose and BIOS booting.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Greemngreek
n00b
n00b


Joined: 09 Sep 2019
Posts: 10

PostPosted: Tue Feb 09, 2021 10:17 am    Post subject: Reply with quote

Zucca wrote:
You need to have BIOS boot partition if you boot using legacy BIOS booting method (bootloader on MBR) AND you decide to use GPT partition table.


I intend to use GPT on my system and I understood the purpose of the partition. It's just that some parts are a little inconsistent/unclear in the Handbook : I need to set the type of the partition as 'BIOS boot' 'for UEFI purposes'? Does that mean I shouldn't change the type for BIOS systems or that I should change the type if I'm using GPT on a BIOS system?

And the printed partition table in the next part shows the type of the 2 Mb BIOS boot partition as EFI for some reason?

Anyways, I have Neddy's guide so I think I can get back to the installation without further confusion :D

@Neddy Thanks! The guide looks very comprehensive and I dont think I'll have problems for the rest of the installation...
Hope the Handbook gets its due TLC soon :D
Back to top
View user's profile Send private message
GDH-gentoo
Veteran
Veteran


Joined: 20 Jul 2019
Posts: 1569
Location: South America

PostPosted: Tue Feb 09, 2021 3:16 pm    Post subject: Reply with quote

Greemngreek wrote:
In the 'Using fdisk' Section, from what I've understood, it suggests marking it 'BIOS boot' for UEFI Systems and leave it be for BIOS Systems.
https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Disks#Creating_the_BIOS_boot_partition

Wow. I never looked at that section, but now that I did, AFAICT it contains a lot of errors and IMO it should be simply removed.

The section on fdisk states that it is assuming an MS-DOS partition table, and the Handbook defines the term "BIOS boot partition" as the partition that GRUB2 installs itself to. But:
  • As previously mentioned, the BIOS boot partition can only exist on disks with a GPT. On disks with an MS-DOS partition table, GRUB2 installs itself (normally) to the free space between the MBR and the first partition.
  • When fdisk's t command is used to change the partition type, on disks with an MS-DOS partition table, partition type 4 is not "BIOS boot", it's "FAT 16 <32M".
  • Then, fdisk's p command shows a partition type that would not match the previous t command. Partition type EF (hexadecimal) is shown instead, and that is also not "BIOS boot", but the type specified by the UEFI specification for marking the EFI system partition (ESP) —although I don't know how many firmware implementations actually support an ESP in an MS-DOS partition table—.
Yes, I'm probably going to add that to the "discussion" page.
Back to top
View user's profile Send private message
Tony0945
Watchman
Watchman


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

PostPosted: Tue Feb 09, 2021 7:13 pm    Post subject: Reply with quote

Zucca wrote:
You need to have BIOS boot partition if
  • you boot using legacy BIOS booting method (bootloader on MBR)
  • AND you decide to use GPT partition table.


(I guess it then easier to switch to UEFI boot if you swap the hard drive to a new machine. Although you need to have EFI partition as well then.)

So you don't need it if you're going use MBR partition table...[/url]

Confirming that, I recently built a PC using an old motherboard that doesn't support UEFI. I used a 500GB Samsung 860 EVO SSD, partition as MBR with two partitions, sda1 as 470GB root and sda2 as 30GB swap, since it's an SSD, the physical location of swap doesn't matter, no heads to move. Installed grub-legacy, not even grub2, and it boots fine. Even grub-legacy latest versions don't need /boot close to the from of the disk as long as the disk is smaller than 2.2TB.

IMO, if your mobo supports UEFI, don't install as BIOS and switch later, just go for UEFI from the start.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54391
Location: 56N 3W

PostPosted: Tue Feb 09, 2021 7:23 pm    Post subject: Reply with quote

Tony0945,

On an SSD, the concept of physical location is not useful. There as a layer of abstraction at the erase block level that rearranges physical location.
The concept of a partition being a contiguous sequence of physical blocks is an illusion too.
Still HDD started that with sector remapping.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Tony0945
Watchman
Watchman


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

PostPosted: Tue Feb 09, 2021 7:25 pm    Post subject: Reply with quote

NeddySeagoon wrote:
The concept of a partition being a contiguous sequence of physical blocks is an illusion too.
Still HDD started that with sector remapping.

Forgot about that!
Back to top
View user's profile Send private message
Tony0945
Watchman
Watchman


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

PostPosted: Tue Feb 09, 2021 9:12 pm    Post subject: Reply with quote

Got the numbers slightly wrong. It's the GB GiB thingy.
Code:
tony@Quad4 ~ $ fdisk -l /dev/sda
Disk /dev/sda: 465.78 GiB, 500107862016 bytes, 976773168 sectors
Disk model: Samsung SSD 860
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: 0x05b95ece

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sda1  *         2048 911237119 911235072 434.5G 83 Linux
/dev/sda2       911237120 976773119  65536000  31.3G 82 Linux swap / Solaris
tony@Quad4 ~ $ uname -a
Linux Quad4 5.4.72-gentoo #11 SMP PREEMPT Sat Jan 30 22:03:48 CST 2021 x86_64 AMD Athlon(tm) II X3 440 Processor AuthenticAMD GNU/Linux

Code:
tony@Quad4 ~ $ sudo dmidecode -t 2
# dmidecode 3.2
Getting SMBIOS data from sysfs.
SMBIOS 2.6 present.

Handle 0x0002, DMI type 2, 15 bytes
Base Board Information
   Manufacturer: MICRO-STAR INTERNATIONAL CO.,LTD
   Product Name: 785GTM-E45 (MS-7549)
   Version: 1.0
   Serial Number: To be filled by O.E.M.
   Asset Tag: To Be Filled By O.E.M.
   Features:
      Board is a hosting board
      Board is replaceable
   Location In Chassis: To Be Filled By O.E.M.
   Chassis Handle: 0x0003
   Type: Motherboard
   Contained Object Handles: 0
Boots like a champ! Never going back to Gigabyte
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