Can someone explain why SSD needs to be aligned

paulsiu

Member
Feb 7, 2005
156
0
76
I recently purchased a SSD for my wife to use in her laptop, but is puzzled about SSD alignment. A lot of article tell you how to align it, but not why. From what I can determine, it's probably the following reason:

1. SSD page is typically 4K (is this always true? How can I tell what page size the SSD is using?).
2. A typical partition cluster is 4K, however by default, the partition may not fall on a 4K boundary, so that the 4K may overlap several pages.
3. When a cluster is updated, it has to update multiple pages, resulting in performance lost.

The trick is to then make the partition start and end on a 4K boundary. Is this correct?

Thanks.

Paul
 

FishAk

Senior member
Jun 13, 2010
987
0
0
Basically, I understand it this way:


The OS's file system is made with pages of a certain size. If the storage container's pages don't line up properly with the OS pages, than the OS must look at more than one page to read one page of information.
 

RaiderJ

Diamond Member
Apr 29, 2001
7,582
1
76
Newer spindle drives also need to be aligned... but only with OS's that are not aligned to begin with, Windows XP being the main example. I know Windows 7 is already aligned, and my guess is Vista and Linux is as well.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Yea, I believe you have the why correct but AFAIK you really only need to be concerned if you're a luddite clinging to XP.
 

paulsiu

Member
Feb 7, 2005
156
0
76
Yea, I believe you have the why correct but AFAIK you really only need to be concerned if you're a luddite clinging to XP.

Ha, there are a lot of luddites out there. Most of the work places I worked at are very slow to change. It'll be a long time before we see post-XP system.

Thanks for the info folks, I was wondering, do I need to start and end partition on a 4K boundary or just start?

Paul
 

sub.mesa

Senior member
Feb 16, 2010
611
0
0
Alignment is required when storage devices do not use a proper sectorsize to communicate their limitations when storing data. Virtually all SSDs still use legacy 512-byte sectors, even though they cannot store information in those chunks in one pass. It would need to emulate that.

SSDs now have 4KiB pages; but soon this will be 8KiB instead; so aligning to 4K boundaries is not enough. 1MiB or 2048 sector alignment is recommended.

Alignment is perfect when not using any partitions, and should also be no alignment issues when you use the recommended offset of 2048 sectors or 1MiB; which is what Vista and later use when creating partitions. This offset is properly aligned for almost anything, except RAID 4/5/6.

Why you need alignment is complicated, but you can look at how several SSDs perform with good and bad alignment. For example, the Intel controller only gets a small ~23% performance decrease when used misaligned; due to remapping. But the Sandforce/Micron controllers are less forgiving and their random IOps performance crashes when not aligned to 4K boundaries.

A sectorsize of 4KiB would solve this; but much like the newer 4K HDDs like Samsung F4 and WD EARS you get a situation where the sectorsize stays at 512 bytes for compatibility reasons and you get messy situations with alignment sometimes. So this issue is not different from alignment with 4K HDDs or alignment with striping RAID arrays.
 

wpcoe

Senior member
Nov 13, 2007
586
2
81
In addition to the luddite <g> XP users, I think alignment is also an issue for Vista/Win7 when cloning a partition from an old drive to a new one, no?

I thought I read that Vista/Win7 installation takes care of the alignment during the install process. However, that is not necessarily the case when cloning. Is that true?
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
In addition to the luddite <g> XP users, I think alignment is also an issue for Vista/Win7 when cloning a partition from an old drive to a new one, no?

I thought I read that Vista/Win7 installation takes care of the alignment during the install process. However, that is not necessarily the case when cloning. Is that true?

Whatever is creating the partition must align it, whether it's the OS installer or the cloning software.
 

FishAk

Senior member
Jun 13, 2010
987
0
0
Cloning and alignment is a little more complicated, and depends on the software.


I haven't used Acronis, but I understand there are issues with alignment not being maintained in versions prior to and maybe including 2010.



I know from experience that Macrium Reflect will keep alignment if the partition was aligned when it was imaged. If it was misaligned, the misalignment is carried through with the recovery. I'm not sure if the blank partition must be aligned or not before recovery, as I always just start with it aligned.