[haiku-bugs] Re: [Haiku] #8990: intel partiton addon allows creating partitions > 2TB (easy)

  • From: "phoudoin" <trac@xxxxxxxxxxxx>
  • Date: Mon, 26 Jan 2015 11:12:35 -0000

#8990: intel partiton addon allows creating partitions > 2TB (easy)
------------------------------------------+----------------------------
   Reporter:  luroh                       |      Owner:  bonefish
       Type:  bug                         |     Status:  new
   Priority:  normal                      |  Milestone:  R1
  Component:  Partitioning Systems/Intel  |    Version:  R1/Development
 Resolution:                              |   Keywords:
 Blocked By:                              |   Blocking:
Has a Patch:  1                           |   Platform:  All
------------------------------------------+----------------------------

Comment (by phoudoin):

 Replying to [comment:9 pdziepak]:
 > I don't think that MBR assumes anything. Its data structures just use
 sector as a base unit and the size of the sector isn't really important
 here.

 The MBR itself assumes nothing indeed as it's unit is sector, not byte.
 But softwares (BIOS, OS, everything using MBR info) does assumes a 512
 bytes sector.
 Relying on the hope that they will be able to detect when to assume
 another sector size when interpreting MBR values is too risky and can lead
 to data corruption.

 There is GPT for that, please don't play with fire. And user's data
 safety.

 > > > 2. What was wrong with `partition->Size() / partition->BlockSize() <
 UINT32_MAX` ?
 > >
 > > It was not checking that partition *offset* was also within 32 bits
 limits?
 >
 > That's not what I was asking about. I understand the problem with the
 partition offset. My question is, what was wrong with that line of code
 that it needed to be changed?

 That it's broken *if* BlockSize() is not 512.

--
Ticket URL: <https://dev.haiku-os.org/ticket/8990#comment:11>
Haiku <https://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: