fdisk limits heads to 254 (mostly)
The fdisk utility currently (mostly, see below) limits the number of heads in the CHS table to the range 0-254 rather than 0-255.
Therefore, when an LBA is encountered that cannot be expressed as a CHS value, it sets C/H/S to 1023/254/63 - see Set_Table_CHS_Values()
However, at startup it will set CHS to 1023/255/63 for a disk with no MBR.
libefi uses 1023/255/63 when creating a protective MBR for an EFI-partitioned disk.
Limiting the number of heads to 254 is a workaround for a very old MSDOS bug which is no longer required; the inconsistency between the tools/libraries should be fixed and heads allowed to be set to 255.
Updated by Electric Monk over 4 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
commit 7e934d3acc051b7ee3ef0d11571fd1225800a607 Author: Andy Fiddaman <firstname.lastname@example.org> Date: 2018-03-30T01:17:56.000Z 9067 Support PMBR customisation with EFI label 9116 fdisk limits heads to 254 (mostly) Reviewed by: Toomas Soome <email@example.com> Reviewed by: Jorge Schrauwen <firstname.lastname@example.org> Reviewed by: Dominik Hassler <email@example.com> Approved by: Robert Mustacchi <firstname.lastname@example.org>