Project

General

Profile

Bug #9116

fdisk limits heads to 254 (mostly)

Added by Andy Fiddaman over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
cmd - userland programs
Start date:
2018-02-15
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

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.

History

#1

Updated by Electric Monk over 1 year ago

  • % Done changed from 0 to 100
  • Status changed from New to Closed

git commit 7e934d3acc051b7ee3ef0d11571fd1225800a607

commit  7e934d3acc051b7ee3ef0d11571fd1225800a607
Author: Andy Fiddaman <omnios@citrus-it.co.uk>
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 <tsoome@me.com>
    Reviewed by: Jorge Schrauwen <sjorge@blackdot.be>
    Reviewed by: Dominik Hassler <hadfl@omniosce.org>
    Approved by: Robert Mustacchi <rm@joyent.com>

Also available in: Atom PDF