Results 1 to 13 of 13
  1. #1
    5 Star Lounger
    Join Date
    Jan 2011
    Location
    Seattle, WA
    Posts
    1,070
    Thanks
    42
    Thanked 132 Times in 86 Posts

    Drive alignment and solid-state drives




    LANGALIST PLUS

    Drive alignment and solid-state drives


    By Fred Langa

    Partition alignment can enhance the performance of mechanical hard drives; now some sites are recommending the technique for solid-state drives. I disagree, and here's why along with an explanation of partition alignment and how to align any drive, mechanical or SSD.


    The full text of this column is posted at windowssecrets.com/langalist-plus/drive-alignment-and-solid-state-drives/ (paid content, opens in a new window/tab).

    Columnists typically cannot reply to comments here, but do incorporate the best tips into future columns.

  2. #2
    3 Star Lounger
    Join Date
    Dec 2009
    Location
    Courtenay, BC
    Posts
    244
    Thanks
    9
    Thanked 16 Times in 15 Posts
    Hi Fred
    Interesting article on something I'd not run into. However, on a Win7 64bit system, Disk Alignment Test said I had no AF drives. (which is nonsense) I tried the command line version and it said it had no access. I checked the web site and didn't find an obvious explanation.

    For myself, I still use separate partitions for programs and data, with a third for compiling optical disc archives and an-the-fly backups of active documents (such as with FileHamster). I use Win7's imaging tool for system backup and a copy tool for data (with Zip option). While this is a little more complex, it ensures the data is always available and not locked in a proprietary format. I've been bitten by that one before.

    Thanks for the continued excellent articles.

  3. #3
    4 Star Lounger
    Join Date
    Dec 2009
    Location
    New Hampshire USA
    Posts
    431
    Thanks
    12
    Thanked 37 Times in 34 Posts
    If you don't understand the reasons why alignment is important you won't know what to test for to verify that it is - and can easily wind up deciding that it isn't.

    With both rotating disks and SSDs, the main problem is smallish, random write operations - which even if not very frequent in the direct use some users make of files can be quite frequent indeed in the steps the operating system or applications take to support those user (or other internal) operations.

    With an unaligned partition on a rotating disk, in the worst case (4 KB random writes) the system must first read the two adjacent 4 KB disk sectors across which the single unaligned 4 KB write spans, then merge in the 4 KB write in memory, and finally (one disk revolution later) write back the two disk sectors to the platters - which takes roughly twice as long as simply positioning randomly to an aligned 4 KB sector and updating it without reading it first.

    With an unaligned SSD partition, while there is no rotating platter to deal with your single unaligned 4 KB write updates two adjacent 4 KB SSD sectors rather than just one, which not only means that the two 4 KB SSD sectors must be read before they are written (so that the portions of them which are NOT updated by the unaligned 4 KB write will be preserved) but also doubles the effective write load and thus the frequency with which the SSD 'blocks' (I think they're usually 128 KB in size) must be garbage-collected and 'cleaned' for reuse (this also will cause the SSD to wear out faster, though with good wear-leveling algorithms and a large SSD this may not be very significant).

    By contrast, lack of partition alignment has almost no effect upon read operations, as you discovered: reading one more contiguous sector than you otherwise would have needed to just doesn't take very long compared with random-access or bulk-transfer overheads. And it also has at least relatively little effect upon large, contiguous write operations (at least as long as the system performs them in large chunks and the disk or SSD is intelligent about optimizing how it handles them): a bit of extra work at the start and end of the chunk can be swamped by the overhead of the large transfer itself.

    Actually, 'partition alignment' is not quite the right term to be using here because the actual alignment in question is that of the file system clusters within the partition. NTFS and all modern Unix file systems typically use 4 KB file system clusters aligned at a multiple of 4 KB from the partition start, which means that you need only align the start of one of their partitions on a 4 KB sector boundary on SSDs and Advanced Format rotating disks to achieve file system cluster alignment, but while FAT32 also typically uses 4 KB (or multiple-of-4KB) clusters it does not typically align them at multiples of 4 KB from the partition start and neither the Disk Alignment Test tool nor the Disk Alignment Check Utility that you mentioned appears to assess the alignment of a FAT32 partition correctly (the latter also appears unable to handle very large partitions without generating an overflow exception). I didn't check the other vendor-specific utilities that you mentioned, but I wouldn't count on their handling FAT32 alignment correctly either.

    Unfortunately, it gets worse. The above issues only affect performance (and perhaps device wear), but when Microsoft in its infinite wisdom changed Vista (and its successors) to optimize file system alignment on 4 KB Advanced Format disks it did so in an incompatible manner, the result being that if you operate on a disk with both old-alignment-style and new-alignment-style utilities (whether from Microsoft or from third parties) you can wind up losing existing data on the disk (modern Linux variants and modern third-party utilities try to be a bit more suave by taking their cues from whatever existing partition layout they find on the disk or at least passing the buck to the user to say which flavor should be used). Microsoft did provide an optional update to change the way XP (but not earlier systems) handles partitions to be compatible with the way Vista and Win7 do, and also described Registry modifications one can make to Vista and Win7 to make them handle partitions the old way, but absent such modifications using a disk across environments that have different ideas about how partitions should be aligned on the disk (whether in multi-booting situations or just by moving an external disk around) can be a bit dicey.

    I prefer modifying Vista and Win7 to use the older methods and then carefully laying out the old-style partitions such that they achieve file system cluster alignment anyway (note that some third-party partitioning utilities may be able to do this to existing partitions without first taking an image and then restoring it, though if you have a second drive available the latter may actually be faster and doing the former without first taking an image just in case would be risky), but if one is scrupulous about never using old-style partitioning utilities (including older Windows Disk Management operations) doing everything with new-style software should work fine and avoids having to master manually laying out partitions such that they'll be correctly aligned for SSD or Advanced Format disks.
    Last edited by - bill; 2012-10-04 at 18:41.

  4. The Following User Says Thank You to - bill For This Useful Post:

    ruirib (2012-10-06)

  5. #4
    Lounger rodsmine's Avatar
    Join Date
    Dec 2009
    Location
    Seattle, WA, USA
    Posts
    35
    Thanks
    4
    Thanked 4 Times in 3 Posts
    What I've read says disk alignment applies only to Advanced Format drives. I downloaded the test tool and it says I do not have AF drives...

  6. #5
    Lounge VIP bobprimak's Avatar
    Join Date
    Feb 2009
    Location
    Hinsdale, IL, USA
    Posts
    2,483
    Thanks
    176
    Thanked 152 Times in 129 Posts
    Even Paragon, which has a vested financial interest in panicking users into buying their alignment tool, says that high-capacity and Solid State drives suffer the most noticeable alignment issues, due to their larger cluster sizes and advanced formatting. I suspect that for older drives with smaller cluster sizes, the issue is being greatly exaggerated. I also suspect that the Paragon claims about how much wear and inefficiency can be reduced by a drive alignment tool, are greatly exaggerated. Except in Solid State Drives, I would choose defragmentation over drive alignment, if I saw performance or longevity issues arising. With the new Windows 8 Storage Spaces, this issue might have to be revisited.
    Last edited by bobprimak; 2012-10-06 at 05:32.
    -- Bob Primak --

  7. #6
    4 Star Lounger
    Join Date
    Dec 2009
    Location
    New Hampshire USA
    Posts
    431
    Thanks
    12
    Thanked 37 Times in 34 Posts
    Quote Originally Posted by bobprimak View Post
    Even Paragon, which has a vested financial interest in panicking users into buying their alignment tool, says that high-capacity and Solid State drives suffer the most noticeable alignment issues, due to their larger cluster sizes and advanced formatting. I suspect that for older drives with smaller cluster sizes, the issue is being greatly exaggerated. I also suspect that the Paragon claims about how much wear and inefficiency can be reduced by a drive alignment tool, are greatly exaggerated. Except in Solid State Drives, I would choose defragmentation over drive alignment, if I saw performance or longevity issues arising. With the new Windows 8 Storage Spaces, this issue might have to be revisited.
    First, you should realize that the Paragon material to which you refer was written by a marketeer rather than by anything resembling a competent engineer, so needs to be taken with multiple large grains of salt. Whether alignment is an issue has nothing to do with the size of a disk, only with whether its sectors (not clusters - that's a file system unit) can be misaligned with respect to the typical write (and, though far less importantly, read) operations that the operating system performs. Since all PC file systems operate with suitable alignment for any disk with 512-byte sectors (regardless of the disk size) alignment just isn't an issue with such disks (regardless of their size) unless the file system is spread across multiple such disks such that a single - relatively small - read or write operation may span multiple disks (thus introducing an intermediate layer - e.g., RAID or, as you noted, Storage Spaces - with its own possible alignment issues) or (as Paragon noted) a virtualization facility has been unusually sloppy in preserving alignment between host and guest layers.

    The newer 'Advanced Format' disks, however, use 4096-byte sectors - again, regardless of the size of the disk. Since most modern file systems typically issue reads and writes in multiples of 4096 bytes this would create no new alignment problems if it weren't for the fact that, for backward-compatibility, most current Advanced Format disks pretend to have 512-byte sectors, thus allowing them to be accessed exactly the same way disks have been accessed for the past several decades (and Windows XP and older Windows variants do exactly that, as do all the older partitioning applications that run on them, which DOES affect their performance on Advanced Format disks if pains are not taken to align file system clusters with the underlying disk sectors).

    If you ignore pathological cases of negligible probability (e.g., where a bad sector on a disk has been remapped to somewhere else and thus a small read or write operation MIGHT include an extra internal seek operation if it spans two sectors), misalignment can only about halve file system performance for small writes that would otherwise be directed at a single 4096-byte Advanced Format disk sector. As I described before, instead of performing a 'blind' write to a single sector after seeking to its disk track and then waiting for the sector to arrive under the disk head, the disk's firmware must read the two adjacent sectors involved, merge in the changed 4096 bytes, and then write the two sectors back. However, the time it takes to perform all this is overwhelmingly dominated by the seek-plus-partial-disk-rotation required to get to the pair of sectors in the first place (just as would have been the case if the operation had been properly aligned) and the full disk rotation required between the read and the rewrite (both of which are comparable in magnitude, so introducing the additional full rotation roughly doubles the time the operation takes, as long as the disk firmware is smart enough not to introduce some other activity between the two unless doing so would be a net performance win; server-style workloads where queue-reordering may significantly improve overall performance complicate this analysis, but the result doesn't change much).

    If you go through a similar analysis for potential performance degradation for larger writes you'll find that the larger the write, the smaller the relative performance degradation. If you do so for reads you'll find virtually no degradation regardless of size. So, indeed, Paragon's claims for potential performance improvement are grossly exaggerated (even if the disk's write-back cache is not taking some of the sting out of the small-write performance hit as I suspect Seagate does when claiming that its Advanced Format drives perform just fine without alignment, though doing this without having reliable battery backup could reduce system integrity in the event of power loss).

    Thus the main performance impact of misalignment on rotating disks is on small, random write operations - a case where defragmentation is of no benefit whatsoever. Alignment and defragmentation address different aspects of performance and are thus complementary rather than at all redundant, unless you're writing to files fragmented into VERY small pieces (not a common situation, I suspect).

    Paragon's claims for performance improvement when aligning SSDs are similarly grossly exaggerated, though since access overheads don't as completely dominate transfer overheads as they do on rotating disks the performance impact of misalignment on larger writes and on reads may not be quite as negligible as it is with rotating media. And it's difficult to imagine proper alignment achieving any greater improvement in SSD lifespan than doubling it even if the ONLY access operations you perform are small writes.
    Last edited by - bill; 2012-10-06 at 12:07. Reason: qualified defragmentation comment

  8. The Following User Says Thank You to - bill For This Useful Post:

    ruirib (2012-10-06)

  9. #7
    Administrator
    Join Date
    Jun 2010
    Location
    Portugal
    Posts
    12,519
    Thanks
    152
    Thanked 1,398 Times in 1,221 Posts
    Nice, detailed explanations, Bill. Thanks .

  10. #8
    Lounger
    Join Date
    Jan 2001
    Location
    Houston, TX, USA
    Posts
    36
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Fred,
    Since the late 80's, when Spinrite came out (I got their beta, then have upgraded each version since) I have used it to check head/platter alignement. I have even on some old disks that have been in use for a while, run it to rewrite the tracks, and have found on several occasions, a very measurable increase in performance.

    I noticed Spinrite was not mentioned, and was just curious of the concept of platter/head alignment is no longer meaningful in the AF disks. On SSDs, without moving parts, I can understand that the r/w head moving to a position over the media to get/put data at a specific CCHHR is not very relevant, but on spinning media, so far they are still using the CCHHR concept from what I have seen. I don't read as much as everyone else probably, so may be behind the times on this, so was hoping for an educational moment in this area.

    Thanks for your dedication to bringing us all up to speed on just about everything related to computers.

  11. #9
    3 Star Lounger
    Join Date
    Dec 2009
    Location
    Northern California
    Posts
    327
    Thanks
    15
    Thanked 143 Times in 92 Posts
    Quote Originally Posted by PCGeek View Post
    I noticed Spinrite was not mentioned, and was just curious of the concept of platter/head alignment is no longer meaningful in the AF disks. On SSDs, without moving parts, I can understand that the r/w head moving to a position over the media to get/put data at a specific CCHHR is not very relevant, but on spinning media, so far they are still using the CCHHR concept from what I have seen.

    Modern operating systems use LBA. The reliance on CCHHR or CHS-addressing went out with Win95a.


    BTW, note that Steve Gibson himself has warned that Spinrite should not be used on SSDs. It serves no purpose, and the unnecessary write operations can shorten the life of the memory cells.

  12. The Following User Says Thank You to dg1261 For This Useful Post:

    PCGeek (2012-10-06)

  13. #10
    Lounger
    Join Date
    Jan 2001
    Location
    Houston, TX, USA
    Posts
    36
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Thank you DG for the update and for end short educational lesson.

  14. #11
    Lounge VIP bobprimak's Avatar
    Join Date
    Feb 2009
    Location
    Hinsdale, IL, USA
    Posts
    2,483
    Thanks
    176
    Thanked 152 Times in 129 Posts
    If I read Bill correctly, he and Ruirib are essentially agreeing with me that in modern hard drives, except for pathological cases of very many small write operations, drive alignment tools are essentially a waste of time, and my statement that there are better ways to improve drive performance stands unchallenged. This regardless of the technical details, which Paragon evidently misrepresented badly.

    Am I misreading what was presented?

    By the way, I never cited Paragon as an expert or unbiased source. I made quite clear their vested financial interest in the statements they make.
    Last edited by bobprimak; 2012-10-11 at 17:51.
    -- Bob Primak --

  15. #12
    New Lounger
    Join Date
    Feb 2012
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    External Hard Drive

    I have a 1.82 TB Seagate Replica that I seem to be having trouble aligning. I first used the diskat-gui.exe for the alignment test. My internal hard drives show aligned, but the Replica drive shows not aligned. I transferred everything off the Replica and formatted it ( 11 hrs to do ). When I ran the alignment test again, the drive was still not aligned. I then installed the HGST Align Tool. The result was the same. The Replica drive was not aligned. What am I missing here? Is the drive too large. I hooked up my Free Agent 500 GB drive and it showed aligned. Tom W

  16. #13
    4 Star Lounger
    Join Date
    Dec 2009
    Location
    New Hampshire USA
    Posts
    431
    Thanks
    12
    Thanked 37 Times in 34 Posts
    Quote Originally Posted by bobprimak View Post
    If I read Bill correctly, he and Ruirib are essentially agreeing with me that in modern hard drives, except for pathological cases of very many small write operations, drive alignment tools are essentially a waste of time
    Dear me, I lost track of this thread before you posted the above and see it now only because I revisited it after Fred repeated his misconceptions about the importance of alignment. But better late than never, I guess:

    You obviously didn't understand what I said (any more than Fred seems to have): proper alignment IS desirable for both 'advanced format' rotating disks and SSD disks, because small write operations - far from being 'pathological' - are very common in pre-Vista systems (later systems started using 4KB alignment by default and using 4 KB transfers for nearly ALL writes). E.g., most updates to file system metadata in XP (and possibly still in Vista as well) occur as small writes, and one or more such small updates tend to occur in conjunction with EVERY normal data write.

    my statement that there are better ways to improve drive performance stands unchallenged
    Sorry - wrong about that as well. How best to improve drive performance depends heavily upon the characteristics of the workload, and (as I already implied above) the choices are usually not 'either/or' but 'and' (i.e., multiple approaches together often result in the best performance).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •