Contribute
Register

Warning on SSD alignment...

Status
Not open for further replies.

RehabMan

Moderator
Joined
May 2, 2012
Messages
181,016
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
First of all, this is my first post here and I want to say thanks for this forum and all the hard work of the participants. I purchased an HP 4530s XU015UT (Core i3, Atheros WiFi, 8GB, etc.) and used the guides to install Mac OS X 10.7.3 and without the guides and information here I couldn't have accomplished that (before this, I have zero experience with Mac). My desire is to play around with iOS development, so I needed something to run XCODE. I got my laptop online (tigerdirect) as a refurb for $404. It was supposed to come with 4GB RAM, but somehow mine came with 8GB by mistake... Bonus!

Of course, this laptop comes with a 500GB hard drive, but I didn't even turn it on using the hard drive, instead swapping the hard drive out immediately for a Crucial M4 256GB SSD. It works great and I have a dual-boot setup between OSX and Win7.

Now here is the word of warning, as I'm sure there are several others running similar systems on SSD. Mac OS X "Disk Utility" does NOT align partitions on SSDs correctly. Each partition should be aligned on a 4K (8 sector) boundary. Having partitions not aligned causes unnecessary erase cycles to be done on the flash modules, impacting performance and lifetime of the SSD.

I would suggest that everyone using SSD take a look at their partition alignment. In Win7, you use the 'msinfo32' utility (look at Components -> Storage -> Disks, and check starting offset of each partition... the starting offset should be divisible by 4096... I prefer mine divisible by 1MB, or 1024x1024). I was able to get all partitions aligned except the 200MB EFI partition (I think this is OK, as there isn't likely to be very many writes to that partition, considering it is used only during boot). You can also check (and fix) partition alignment using an Ubuntu Live CD, as Gparted is included.

Please note that even if you are not using multi-boot, your Lion partition is likely not aligned correctly...

If I had this to do all over again, I would follow this procedure:

1) Before installing anything, create initial partitions in Disk Utility. Create all partitions as "OSX" so you can resize them after the initial creation (for some reason, Disk Utility refuses to resize FAT32 partitions...)
2) Apply your partition setup in Disk Utility, then make each partition as small as possible. Now you have lots of free space between each partition and relatively small partitions. Apply those changes.
3) Now restart and boot from Ubuntu Live CD (or, as I did, USB key). Then run gparted.
4) In gparted, "gently nudge" (move) each partition, by modifying the "free space before." Make sure Align By "MiB" is selected. Because we made the partitions as small as possible in "Disk Utility" gparted has less data to move compared to what it otherwise would. This gives you partitions aligned on a MB boundary which is great for SSD.

Please note: Do not move the EFI partition... just leave it where it is. It will be starting at sector 40, and in my experience the system will not boot (or Lion won't install) if you move it. There might be a way to fix this, but everything I tried failed. There is not going to be a lot of activity on this partition any way, so it is just fine to leave as is.

Note: the reason I thought it necessary to create the partition scheme in Disk Utility first was because I was unclear on gparted's ability to create an MBR that is synced to the GPT partition table. Also I was unclear if I could create the proper EFI partition if not created by Disk Utility. If any one knows that gparted does the right thing here, please chime in. If in fact, gparted sets up a correct hybrid GPT/MBR partition scheme, we could probably create all partitions in gparted from the beginning and avoid some of the churn on the SSD.

5) Now go back into "Disk Utility" by booting off your Lion install USB. In Disk Utility, proceed to resize the partitions as you desire (ie. make them larger) then use the "Erase" function (aka Format) to setup the correct file system on those partitions (ie. FAT32 for the eventual Win7 partition, etc).

6) Probably best to quit here and proceed to install Win7 first. Assuming you want dual boot.

7) After installing Win7, Install Lion...

Note: Doing the Win7 install followed by Lion means you don't have to boot off Lion USB to fix up the Chimera boot loader after Win7 overwrites it.

Hope that helps... Now I've got a few other questions to ask, but will post those as separate topics...
 
Just thought I'd mention that if you do only one partition, you are aligned to 4k, but not to 512k (Windows does 512k as many SSDs use an erase-block size of 512k)...

And for some reason, as in my case (I did 3 partitions) things didn't even end up aligned at 4k. Perhaps it is something funky that Disk Utility does with more than 1 partition, but at any rate it is something to check before you go installing the system(s) on an SSD.
 
Status
Not open for further replies.
Back
Top