1. Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

Partition Alignment Spreadsheet

Discussion in 'Storage' started by techspec6, Oct 29, 2009.

  1. techspec6 New Member

    Joined:
    Sep 20, 2009
    Messages:
    40 (0.02/day)
    Thanks Received:
    20
    I created an excel spreadsheet that auto-calculates whether your raid array is properly aligned. It also auto-calculates non-raid partitions. You must meet the requirements of all Rules to be considered Aligned.

    Using this spreadsheet's calculations, TechPowerUp!'s W1zzard wrote a great Javascript applet that calculates SSD alignment without the need to download the spreadsheet! The Javascript applet is linked below.

    You must input your own data. It will not fetch your system information automatically. That's why the example column is there.

    Let me know of any corrections or additions I can make to the sheet.

    Partition alignment is the single most important performance tweak you can do for any SSD.

    Lets break it down to it's simplist form. The SSD is divided into Blocks of 512k which are divided into pages of 4k in most cases. 128 pages = 1 block.

    There is a certain amount of space before the start of the first partition, which is what is referred to as the offset. Vista and W7 use a default offset of 1024k, meaning there's 1024k of empty space before the partition. Starting at 1024k means that the partition starts at the beginning of the third block, since blocks are 512k (512k x 2 = 1024k).

    The goal is to not start a partition in the middle of a block or a page. That way, you don't split any boundaries. If you split a page (4k) section, then 2 writes are necessary to write the page instead of 1, doubling the work. It will happen repeatively every 8th page, reducing overall performance and I/O commands. Blocks have a similar performance hit but not to the same degree as pages. It's easy to align to both.

    Alignment has to be done when the partition is created. There are tools such as a gparted boot CD that can change alignment after it's created, but it's not 100%. Sometimes, you can lose your data with that method. It's best to fresh install and correctly create the partition at the beginning. Windows Vista/7 will both correctly align a partition. You must not have any previous partitions on the SSD and allow Windows to create and quick format the partition during the installation procedure.

    WinXP is another story because it will not align a partition correctly by default. Extra steps are involved. The easiest way to align a WinXP OS volume is to get the downloadable Vista Recovery DVD and create the OS partition before the installation of WinXP. The partition created by the Vista Recovery DVD will be the same as the Vista Installation DVD and will be aligned at 1024kb by default which is a valid alignment for todays hardware.

    It takes a moment to wrap your head around the new technology, but the sooner you forget HDDs, sectors, tracks, and cylinders, the better off you'll be. It's all about the blocks and pages now.

    Online SSD Alignment Calculator written by TechPowerUp!'s W1zzard.

    VBScript Alignment Checking Tool originally written by TcpDump's Tom Hirt. Discovered by Halk and edited by me to work with all SSDs with 512kb block sizes.

    SSD Alignment Spreadsheet created by me.

    Jason
     

    Attached Files:

    Last edited: Jan 21, 2010
    Dylock, D4S4, Frogger and 5 others say thanks.
  2. techspec6 New Member

    Joined:
    Sep 20, 2009
    Messages:
    40 (0.02/day)
    Thanks Received:
    20
    [​IMG]

    SSD Drive Specifications:

    All OCZ Drives to date
    NAND Page = 4096 bytes (4k)
    NAND Erase Block Size = 524288 bytes (512k)

    Intel X25-M
    NAND Page = 4096 bytes (4k)
    NAND Erase Block Size = 524288 bytes (512k)

    G.Skill Falcon
    NAND Page = 4096 bytes (4k)
    NAND Erase Block Size = 524288 bytes (512k)

    Supertalent Ultra Drive GX
    NAND Page = 4096 bytes (4k)
    NAND Erase Block Size = 524288 bytes (512k)

    Patriot Torqx
    NAND Page = 4096 bytes (4k)
    NAND Erase Block Size = 524288 bytes (512k)

    ------------------------------------------------------------------

    Consolidated list of threads containing info on parititon alignment:

    http://www.ocztechnologyforum.com/forum/showthread.php?t=48309 by therookie
    http://www.ocztechnologyforum.com/forum/showthread.php?t=55238 by Chrisped
    http://blogs.msdn.com/jimmymay/archi...-template.aspx
    http://www.ocztechnologyforum.com/forum/showthread.php?t=50376 by Tony

    **Notice- These guides will recommend all sorts of partition offsets. SSDs are divided into pages and blocks. Early guides did not take in the importance of aligning to blocks, but instead only pages. Please use the recommended partition alignment of 1024kb (Vista and W7 default) or you may not be aligned to the blocks which can result in less IO performance.

    ------------------------------------------------------------------

    Commands to check alignment:

    start > run > type "cmd" to enter command prompt, then type "wmic partition get Name,StartingOffset,Size". This method works in XP, Vista and W7.

    or

    within windows, type msinfo32. When the info program runs, navigate to Components > Storage > DISKS and look for "partition starting offset" with a value in bytes. This method works in XP, Vista and W7.

    ------------------------------------------------------------------

    Some alignment misconception:

    I've seen some on the forum state that "sectors/track" is what to check when looking at alignment. That is incorrect.

    In Tony's post HERE, he states that the start of the first partition begins on sector 63 in Windows XP which we all know as the default misaligned partition. Sector 63 is the same as 32256 byte offset. Sectors/Track is a totally different disk parameter and has NOTHING to do with disk alignment. Tony was not referring to Sectors/Track.

    The math behind it is: starting offset / bytes per sector = starting sector boundary
    In the case of windows xp: 32256 / 512 = 63rd sector (not sectors/track)
    In Vista/W7: 1048576 / 512 = 2048

    HERE is a good read on how disk technology has evolved and why "63 sectors/track" means nothing.

    Jason
     
    Last edited: Nov 1, 2009
    D4S4, Super XP, Frogger and 2 others say thanks.
  3. mcloughj

    Joined:
    Oct 27, 2005
    Messages:
    307 (0.09/day)
    Thanks Received:
    66
    Location:
    Dublin, Ireland
    Got this from you at the OCZ forums. Very simple and effective! Good job!
     
  4. lemonadesoda

    lemonadesoda

    Joined:
    Aug 30, 2006
    Messages:
    6,267 (2.08/day)
    Thanks Received:
    968
    Getting hold of some of the data isnt easy. My Supertalent doesnt advertise some of the statistics needed in their spec sheets.

    It also seems that my partitions are "not aligned". So what?

    Can I suggest you update your OP and/or spreadsheet:

    1./ Say why it is important to have it aligned, ie. i) faster, and ii) on average you will use 10-100% less write cycles (depending on caching) which therefore reduces wearing/trashing of the drive. The factor could be small... but could be as much as 100%, so worth doing.

    2./ Provide DEFAULT values, or recommended values, based on your experience from the other website of hundreds of SSD users. How to do this? I guess that the max/worse case SSD would be the one to use. If that is aligned, then any "better" SSD (ie smaller sized block size, so long as a binary divisor) would also be aligned.

    3./ OK, so my SSD isnt aligned. WHAT THE HECK AM I SUPPOSED TO DO ABOUT IT? AND HOW?

    Maybe you have this information on the another website. But it isnt here, and there is no link, so it is useless. (You updated your posts. Thanks! :toast:)

    *****

    PS. If you have a partition at the START of a drive, then am I right assuming it MUST be aligned? So it my problem that there is a hidden system-recovery partition at the start. If I nuke that, will I be aligned?
     
    Last edited: Oct 30, 2009
  5. techspec6 New Member

    Joined:
    Sep 20, 2009
    Messages:
    40 (0.02/day)
    Thanks Received:
    20
    Hold tight, that's actually why I reserved the first 2 post of this thread. I was wanting to gauge interest before overloading you guys with enough information to make your ears bleed. I have a lot of time in November coming up, so expect this thread to expand between now and then.

    And you're right. Some SSD manufacturers are not as forthcoming about their specs. I'll see what I can do about getting them anyways. ;-)

    Jason
     
    exon1 and lemonadesoda say thanks.
  6. techspec6 New Member

    Joined:
    Sep 20, 2009
    Messages:
    40 (0.02/day)
    Thanks Received:
    20
    So far, to my knowledge, if you use the Vista/W7 default offset of 1024kb, you have a very high chance of being aligned no matter what brand SSD you use. The reason is because I do not believe any manufacturer is using an erase block larger than 1024kb and they all divide into 1024kb, thus far. I made the calculator as a spreadsheet so that information could be updated with future SSD technology without making the whole thing obsolete.

    Also, W7 creates that second 100MB partition. As long as sequential partitions are multiples of 1024kb, then you're still aligned in most all cases. Both default W7 partitions meet this criteria.

    Jason
     
    Last edited: Oct 30, 2009
  7. techspec6 New Member

    Joined:
    Sep 20, 2009
    Messages:
    40 (0.02/day)
    Thanks Received:
    20
    The very first partition must be aligned. Sequential partitions must also be aligned. The easiest method is to make sure the first partition is a particular MB of capacity.

    For example:
    Say you have Windows 7 with it's default offset of 1024kb on the first partition.
    The second partition it creates is 100MB, meaning that the offset of the OS partition will be 100MB + 1024kb (1MB) = 101MB, thus the second partitions offset will be an even 101MB. If you create another sequential partition, you must be sure that the OS partition is an exact MB value also. If you end a partition with a capacity that's not a whole MB amount, you run the risk of splitting a block or a page. Resulting in a misaligned partition.

    Microsoft's 100MB partition could have been 99MB, 101MB or 102MB, as long as it's a whole MB. Keep in mind that 1048576 bytes = 1024KB = 1MB

    Jason
     
  8. W1zzard

    W1zzard Administrator Staff Member

    Joined:
    May 14, 2004
    Messages:
    15,013 (3.90/day)
    Thanks Received:
    11,880
    Super XP, Frogger, Cold Storm and 5 others say thanks.
  9. lemonadesoda

    lemonadesoda

    Joined:
    Aug 30, 2006
    Messages:
    6,267 (2.08/day)
    Thanks Received:
    968
    Jason, thanks for editing first 2 posts. Much clearer now.

    W1z, nice javascript.
    [​IMG]

    Question remains open. I've got W2K3 installed. Incl. all applications. I'm not going to reformat and reinstall. So HOW do I fix it? Can acronis disk director, or other partition management software, be used to fix a misaligned drive. What tool do you recommend? How do we overcome the silly "drive size is shown in GB, but is 1GB exactly aligned or is there a counting problem with 2^n and power10 notation?
     
  10. techspec6 New Member

    Joined:
    Sep 20, 2009
    Messages:
    40 (0.02/day)
    Thanks Received:
    20
    Your answer is gparted. There is a risk of data loss, as with anything that edits drives that contain data. Be sure you backup your important files prior to tinkering. When it asks, you want 2048 sectors as the offset. That's equivalent to 1024kb offset which is the windows vista/w7 default.

    GPARTED to fix alignment

    Jason
     
    Last edited: Oct 30, 2009
    lemonadesoda says thanks.
  11. lemonadesoda

    lemonadesoda

    Joined:
    Aug 30, 2006
    Messages:
    6,267 (2.08/day)
    Thanks Received:
    968
    Jason,

    I have a suggestion. How about updating the spreadsheet to have a section "Proposed remedy"

    What it would do is calculate how many bytes you have to move the partition forwards or backwards to achieve alignment. That way, we can just use the resulting data in a partition manager to fix it.
     
  12. lemonadesoda

    lemonadesoda

    Joined:
    Aug 30, 2006
    Messages:
    6,267 (2.08/day)
    Thanks Received:
    968
    On the road to discovery:

    1./ START, Run... wmic (better than cmd) (type /? for help )
    2./ type partition

    the additional data will help you figure out what is going on... i discovered my O_S partition was#2! And that my other partitions were hidden within an "extended partition"
     
    Last edited: Nov 1, 2009
  13. techspec6 New Member

    Joined:
    Sep 20, 2009
    Messages:
    40 (0.02/day)
    Thanks Received:
    20
    I like this GUI utility a little better.
    Start > run > type msinfo32. When the info program runs, navigate to Components > Storage > DISKS

    Jason
     
  14. lemonadesoda

    lemonadesoda

    Joined:
    Aug 30, 2006
    Messages:
    6,267 (2.08/day)
    Thanks Received:
    968
    After spending some time playing with Acrons Disk Director, and with EASEUS Partition Master, I find neither tool is sufficiently "granular" to be able to solve the misalignment issue. In fact, I wonder if the design/structure of NTFS is such that IF the first partition (#0) is misaligned then, de facto, all other partitions will be misaligned if those partitions have been created by the standard MS disk management tools (and programs like Acronis or EASEUS included).

    Since this is such a SERIOUS issue for SSDs, then perhaps Acronis and the like should include alignment tools in their software.
     
  15. techspec6 New Member

    Joined:
    Sep 20, 2009
    Messages:
    40 (0.02/day)
    Thanks Received:
    20
    Some cloning software will restore an image to a partition without changing the partition's alignment. That means that if you image your system to another drive, delete your misaligned partition, create an aligned partition, quick format it and restore the image back to the newly aligned partition, your result is an aligned partition with your software and OS as they were originally. It's much preferable to create an aligned partition and restore to it rather than fix a misaligned partition.

    Jason
     
    Frogger says thanks.
  16. techspec6 New Member

    Joined:
    Sep 20, 2009
    Messages:
    40 (0.02/day)
    Thanks Received:
    20
    Speaking of good drive cloning software, Windows 7 drive backup works really well and preserves the original alignment of the drive's partition. Images created with it can be restored by booting from the Win7 installation DVD.

    Jason
     
  17. Nomgle

    Joined:
    Dec 16, 2008
    Messages:
    14 (0.01/day)
    Thanks Received:
    1
    Location:
    UK
    Which cloning software exactly are you referring to ?
    I'll shortly need to do this re-alignment on a couple of old Laptops when their new SSDs arrive :)
     
  18. sethm1 New Member

    Joined:
    Apr 26, 2011
    Messages:
    1 (0.00/day)
    Thanks Received:
    0
    Turns out my new SSD (OCZ Vertex 3) is misaligned.
    I am lost in this thread- would the 2 filess within the zip folder (post #1) help me to re-align the drive?

    Thx
     

Currently Active Users Viewing This Thread: 1 (0 members and 1 guest)

Share This Page