> 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. 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. 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. Greetings, Bernd _______________________________________________ Freedos-devel mailing list Freedos-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/freedos-devel