Hallo Herr Bernd Boeckmann via Freedos-devel,

am Montag, 27. Februar 2023 um 13:07 schrieben Sie:


>> Am 27.02.2023 um 07:26 schrieb Deposite Pirate <dpir...@metalpunks.info>:
>> 
>> I'm not sure if this fdisk can already do that, but additionally it
>> would also be very useful if it could align partitions to 4k rather than
>> 63 sectors to lower wear on flash drives (SSD, CompactFlash).

> The current behaviour is to always align partitions to cylinder
> boundaries. This may be a multiple of 63 sectors if it corresponds to the 
> disk geometry.

> I did not find any option in the source code to force FDISK to use
> other alignment options . All the calculations are done on a
> cylinder basis, and the sector size is hardcoded to 512 bytes.

> Can it be modified with reasonable effort to at least support 4k
> alignment without rewriting 50% of the code? I think yes. One
> solution could be that within the calculated cylinder boundaries one
> could increase the starting sector by at most 7 to force an
> alignment to 4k. That would make the partition start on a 4k
> boundary.

that sounds like a really good idea, and old versions of anyDOS should
also handlethis well.

>  I am not sure if it is also necessary to decrease the end
> sector by at most 7 to make the partition size a multiple of 4k, but
> for safety reasons one should consider doing that.

I don't think this would be necessary; I don't think any reasonable
formatter that allows for a starting sector != 0 but not respecting
endsector!= maxsec-1


> This method would have the shortcoming that there can be little
> gaps of at most 15 sectors between the partitions. And I am not sure
> what that change would mean to the compatibility with older DOS
> versions in general, so that should better be hidden behind a feature flag.

I hate feature flags as they must be decovered first.

hiding it behind

   if lba_supported_by_disk and
      total_disk_size > 8,4 GB // max total size for CHS addressing
      {
      place partitions on 4K boundary
      }

Tom














_______________________________________________
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to