> 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).

You can certainly make a case for aligning things on 4k boundaries on both 
modern and old disks, but I don't think it has anything to do with wear on 
non-magnetic disks.  From what I understand, much like magnetic disks a 
non-magnetic disk can (theoretically) be read a virtually infinite number of 
times -- it's only the writing that wears things out.  And again, much like 
modern magnetic disks, even if the native physical alignment is 4k (instead of 
512 like the older disks) the firmware in the disk handles that all 
automatically.

That is, if you are modifying only a single 512-byte sector the firmware does a 
read-modify-write sequence (it reads the entire 4k physical sector the 512-byte 
virtual sector is part of, modifies the part that's changed, and then writes 
the entire 4k sector back to disk).  That's only one read and one write 
operation and the write is (supposedly) the only one that causes wear.  If you 
use some sort of disk caching program (especially one that caches the writes) 
it gets more complicated, but in general the caching makes things more 
efficient both in terms of speed and wear.

I think the justification for 4k alignment would come from speed rather than 
wear, since if cluster alignment and physical sector alignment don't match 
writing a _cluster_ can take multiple writes (but not to the _same_ physical 
sector so wear doesn't really come into play).

On older magnetic disks, the reason they aligned things on odd-numbered sector 
boundaries was not for wear but for speed.  The old disks would sometimes 
needed to physically move the head to a new location and wait for the disk to 
spin around again before it could start reading or writing.  If that happened 
in the middle of a cluster read/write it slowed things down and did cause wear 
on the head movement mechanism.  But odd-numbered sectors never aligned with 
cluster sizes of more than one sector anyway, so the alignment never really 
made much (if any) difference in terms of wear or speed.  In reality, 4k 
alignment is just as good as odd-numbered alignment for both speed and wear on 
older disks, and 4k alignment is much better on new disks.


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

Reply via email to