Properly align partitions on SSD - How?

Solaris, RedHat, FreeBSD and the like
Post Reply
Message
Author
warnec
Posts: 1
Joined: Sat Jun 12, 2010 7:56 am
Location: Opole, Poland

Properly align partitions on SSD - How?

#1 Post by warnec » Sat Jun 12, 2010 3:03 pm

Hi. I'm planning to buy a Thinkpad T410s laptop with 128GB SSD drive - higher average r/w speeds, no noise, lower temperature, more silent compared to ordinary HDDs available in most laptops.

What got me pondering, though, is the knowledge that SSDs need to be properly taken care of and maintaned in order to reach best possible results.
It looks like SSD fragmentation can have dramatic impact on write speeds over a period of time:

http://www.pcper.com/article.php?aid=669

some solutions suggested in the article:

Code: Select all

Workaround #1: Change your usage pattern

Until Intel tweaks their write combining algorithms and revises their released firmware, there are ways to minimize your chances of falling into the fragmentation black hole.  Here are some things to avoid:

    * Disk partitions not properly aligned with flash block boundaries (to be covered in another article). //that's what I want to make sure I avoid!
    * Heavy temporary file activity (think temporary internet files). // I can avoid that using ram as tmpfs (with 4GB of RAM)
    * Heavy page / swap activity. //as above
    * Applications that write random small chunks, even within a larger file (i.e. BitTorrent / Steam). // no plans to use such software
    * Running *any* disk defragment utility (DON’T DO IT!). // not needed for Linux

So, as you can see, only the first aligning issue is harder to deal with. That's where I need Your help. I've read this article:

http://ldn.linuxfoundation.org/blog-ent ... block-size

Which is quite an interesting read, but I do not fully know how to do it. I want to install Ubuntu 10.04.

The way I see it, it would be best to wipe the entire drive with HDDErase (as seen here: http://www.pcper.com/article.php?aid=66 ... pert&pid=6) so that I have no Windows 7 leftovers, and then boot from Ubuntu Live CD. Move into the text mode (Ctrl+Alt+F1, AFAIR) and execute these commands:

Code: Select all

# fdisk -H 224 -S 56 /dev/sdb
(now create a 1GB /boot partition as seen in the article, no idea how to do this)
# pvcreate –metadatasize 250k /dev/sda2
# pvs /dev/sda2 -o+pe_start

*) Would this be correct?
*) Why is the article's author using sdb instead of sda? Is this important?
*) What is the command to create a proper 1GB sda1 partition for /boot?
*) Will pvcreate and pvs work? and if they do and I log back into the GUI installer, what do I do next when I am taken into the partition chooser GUI?

Please read the whole article in order to fully understand what I am trying to do (I know about a bunch of "noatime" and similar fixes, but they are a completely different thing)

Thanks in advance!

PS.: Or maybe you know how to do it without LVM involved? Please share!

tonyric
Posts: 12
Joined: Wed Jan 30, 2008 8:51 pm
Location: Leominster, MA

Re: Properly align partitions on SSD - How?

#2 Post by tonyric » Wed Jul 28, 2010 11:41 am

You don't need to worry about properly aligning the blocks with newer Linux releases. This will be taken care of automatically by parted.
T61 15.4" 2.4GHz 4GB RAM 2x250GB HDD Vista64, Ubuntu 7.10 x64

T61 14.1" 2.2GHz 2GB RAM 1x160GB HDD XP Pro

ThinkRob
Senior ThinkPadder
Senior ThinkPadder
Posts: 2364
Joined: Wed May 20, 2009 9:54 am
Location: near RTP, NC

Re: Properly align partitions on SSD - How?

#3 Post by ThinkRob » Sun Aug 29, 2010 6:47 pm

warnec wrote: Please read the whole article in order to fully understand what I am trying to do (I know about a bunch of "noatime" and similar fixes, but they are a completely different thing)
1) You don't really need to worry about alignment with Intel's drives. They don't suffer from the same problems as many do if you run unaligned.

2) noatime, etc. are only really useful for when you're desperate to minimize writes (such as with crummy JMicron-based drives). With a decent SSD, there's no real reason to sacrifice functionality like that.

BTW, parted should automatically align partitions for you if you have a recent kernel + userland.
Need help with Linux or FreeBSD? Catch me on IRC: I'm ThinkRob on FreeNode and EFnet.

Code: Select all

Current laptop: X1 Carbon 3
Current workstation: none

uux
Freshman Member
Posts: 71
Joined: Thu Sep 06, 2007 2:24 pm
Location: Niagara Falls, NY

Re: Properly align partitions on SSD - How?

#4 Post by uux » Wed Sep 01, 2010 3:21 pm

ThinkRob wrote: 1) You don't really need to worry about alignment with Intel's drives. They don't suffer from the same problems as many do if you run unaligned.
Samsung based drives also do not suffer from the alignment problem. If I'm not mistaken, the 128GB SSD Lenovo offers is a Samsung.

Edit:
Actually, I see people reporting a 128GB Toshiba SSD shipped with the T400s. I have no idea if alignment is an issue for that drive.

ThinkRob
Senior ThinkPadder
Senior ThinkPadder
Posts: 2364
Joined: Wed May 20, 2009 9:54 am
Location: near RTP, NC

Re: Properly align partitions on SSD - How?

#5 Post by ThinkRob » Wed Sep 01, 2010 8:47 pm

uux wrote: Samsung based drives also do not suffer from the alignment problem. If I'm not mistaken, the 128GB SSD Lenovo offers is a Samsung.

Edit:
Actually, I see people reporting a 128GB Toshiba SSD shipped with the T400s. I have no idea if alignment is an issue for that drive.
Ok, well technically no non-JMicron drives "suffer" from alignment problems. At best you're looking at a relatively minor performance boost on the current generation of drives -- for most desktop use I'd go as far as to say it's not worth the hassle.

Where alignment starts to actually matter is when you get to drives made c. 2008 and earlier. With the notable exception of the X25-M G1, most of these drives will actually exhibit a fairly decent performance boost from alignment. I have no idea what generation of Samsung drives Lenovo ships in their machines nowadays. I would hope they're shipping something newer than the PB22-J (which most decidedly did suffer from alignment issues), but who knows...
Need help with Linux or FreeBSD? Catch me on IRC: I'm ThinkRob on FreeNode and EFnet.

Code: Select all

Current laptop: X1 Carbon 3
Current workstation: none

Post Reply
  • Similar Topics
    Replies
    Views
    Last post

Return to “Linux Questions”

Who is online

Users browsing this forum: No registered users and 3 guests