Author Topic: Partition alignment  (Read 413 times)

robertapengelly

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Partition alignment
« on: March 18, 2024, 10:57:54 am »
Looking at the Partition Alignment section at https://www.arcanoae.com/faqwd/how-can-i-tell-if-my-current-disk-drive-is-compatible-with-arcaos/ it says:

 > ArcaOS expects partitions to be CHS-aligned

Does anyone know what it means by CHS-aligned?
« Last Edit: March 18, 2024, 01:14:07 pm by Martin Iturbide »

Lars

  • Hero Member
  • *****
  • Posts: 1271
  • Karma: +65/-0
    • View Profile
Re: Parition alignment
« Reply #1 on: March 18, 2024, 12:23:54 pm »
I remember that that would mean that the number of sectors of a partition has to be a multiple of the NUMBER_OF_HEADS * NUMBER_OF_SECTORS_PER_TRACK (where that product is identical to a cylinder size) and that a partition has to start on a sector number that is a multiple of that product and, as a consequence, also end on a sector number that is a multiple of that product minus 1.

At least that is the formula that I used when implementing "virtual partition support" (wrapping a "large floppy" type of USB MSD into a partition) in USBMSD.ADD so that LVM and MINILVM would accept such a media as partioned media without complaining.
I vaguely remember that if the media contained a number of sectors that was not a multiple of that product, that it was acceptable if the partition at least ended on a sector number being a multiple of that product minus 1 (and could start at an offset to that product) but it is possible that that is only allowed for the very first partition on a media (that said: the "virtual partition support" only requires exactly 1 partition for the whole media).

There are specific rules for the NUMBER_OF_SECTORS_PER_TRACK that apply to OS/2 and this number varies with the size of the media.
Typically it is 63, if that is not sufficient with the max NUMBER_OF_HEADS being 255 then it is increased to 127 and further increased to 255 in case 127 is still too small.
« Last Edit: March 18, 2024, 12:40:19 pm by Lars »

robertapengelly

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: Partition alignment
« Reply #2 on: March 18, 2024, 02:57:05 pm »
What do you mean by (where that product is identical to a cylinder size)?

Rich Walsh

  • Sr. Member
  • ****
  • Posts: 331
  • Karma: +23/-0
  • ONU! (OS/2 is NOT Unix!)
    • View Profile
Re: Partition alignment
« Reply #3 on: March 18, 2024, 05:41:06 pm »
Looking at the Partition Alignment section at https://www.arcanoae.com/faqwd/how-can-i-tell-if-my-current-disk-drive-is-compatible-with-arcaos/ it says:

 > ArcaOS expects partitions to be CHS-aligned

Does anyone know what it means by CHS-aligned?

For a comprehensive discussion of hard drive geometry (including some helpful illustrations) see https://en.wikipedia.org/wiki/Cylinder-head-sector. After reading that, the following will make sense: a CHS-aligned partition can start and end at any cylinder but it must start at the very beginning of the first cylinder (i.e. Head 0 Sector 1) and end at the very end of the last cylinder (typically, Head 255 Sector 63).

F.Y.I.  the AOS FAQ you cited is out-of-date: AOS 5.1 supports both NVME drives and the GPT partitioning scheme. It is also incorrect since OS/2 _does_ support partitions that are not cylinder-aligned (though no OS/2 tool will ever create a non-aligned partition).

robertapengelly

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: Partition alignment
« Reply #4 on: March 18, 2024, 05:54:50 pm »
 > the AOS FAQ you cited is out-of-date

Ohh okay, I was given that link by someone and I thought it was recent.  That would explain why I can create partitions on different CHS values instead of head 1 and sector 1.  I still have some partition problems though so maybe Lars was on to something.

robertapengelly

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: Partition alignment
« Reply #5 on: March 18, 2024, 06:06:01 pm »
Just realized I messed the last sentance up, it should have said:
I still have some partition problems though so maybe Lars was on to something with the end sector.

robertapengelly

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: Partition alignment
« Reply #6 on: March 18, 2024, 06:25:11 pm »
Okay new question (still related to alignment), how exactly would I align a sector exactly?  Say I have:

    starting sector: 128
    ending sector: 65536

How exactly would I align that?  Also, would I round up or down?

robertapengelly

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: Partition alignment
« Reply #7 on: March 18, 2024, 07:26:16 pm »
Never mind the last message, Lars alignment actually seems to fix the partitions.  Thanks for the help guys.