LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 08-03-2010, 09:29 PM   #1
DanceMan
Member
 
Registered: Mar 2009
Location: Vancouver BC
Distribution: MX Linux
Posts: 159

Rep: Reputation: 22
Aligning sectors for an SSD?


I have an Acer tiny desktop using laptop components and I want to replace its small laptop hdd running Vista with a Kingston SSDNow V Series Boot Drive 30GB and install Ubuntu, since it will support TRIM. I am aware of the current issues on some new hard drives with 512 vs. 4k sector sizes and the necessity to align sectors for those drives. And I know I've seen some posts or discussion of aligning sectors for SSD's.

I'll be doing more searching for info on this, but my previous searches on the 4K sector alignment issue for the new WD hdd's on linux were confusing. Does anyone have definitive information on the necessity of aligning 4k sectors on current Linux kernels, or on whether aligning sectors is necessary for SSD's?
 
Old 08-04-2010, 07:42 AM   #2
RockDoctor
Senior Member
 
Registered: Nov 2003
Location: Minnesota, US
Distribution: Fedora, Ubuntu, Manjaro
Posts: 1,791

Rep: Reputation: 427Reputation: 427Reputation: 427Reputation: 427Reputation: 427
Can't answer for SSDs, but in formatting my 1GB USB stick to receive recent (yesterday's and earlier) live versions of Fedora Rawhide, I see messages referring to non-optimal sector alignment. Haven't noticed any sector alignment-related problems.
 
Old 08-04-2010, 01:59 PM   #3
DanceMan
Member
 
Registered: Mar 2009
Location: Vancouver BC
Distribution: MX Linux
Posts: 159

Original Poster
Rep: Reputation: 22
Non-optimal sector alignment would lead to slower data transfer from the drive. That's what I want to avoid.
 
Old 08-04-2010, 03:13 PM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,974

Rep: Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623
Not sure the ssd's have that issue. I know the newer green type larger hard drives have that problem. I'd think you may wish to look at nilfs file system to speed it up if you can install on it.
 
Old 08-04-2010, 04:08 PM   #5
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,070

Rep: Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897
Quote:
Originally Posted by DanceMan View Post
I...I want to replace its small laptop hdd running Vista with a Kingston SSDNow V Series Boot Drive 30GB ...

I'll be doing more searching for info on this, but my previous searches on the 4K sector alignment issue for the new WD hdd's on linux were confusing.
Yes, I am confused too. Why do you want to know more about the issue with WD Green 4k sector drives, if you intend to install a Kingston SSD? I'm not sure that helps.

If the SSD that you have chosen has (emulates) 4k sectors, and I can't see why such a small device would benefit from 4k sectors appreciably, worry about 4k sectors. If it doesn't, don't.

Quote:
Originally Posted by DanceMan View Post
...and install Ubuntu, since it will support TRIM.
It is unclear whether this is true in any useful way. Obviously, it depends on which version of Ubuntu you mean, but the last I heard, the kernel supported trim, but the filesystems that you are most likely to use didn't. More detail, please, on the version and the filesystems.

@RockDoctor
Quote:
...but in formatting my 1GB USB...
Almost entirely irrelevant. The technology of the memory is different, and, more important, they don't have the disk controllers that SSDs have. It would be impossible for a USB stick controller to support trim, because there isn't a controller.

@jefro
Quote:
...at nilfs file system...
Hmm, theoretically, NILFS ought to be a good idea for SSDs, but it is a bit immature, and that would be a concern. In addition, measured performance could be described as a bit up and down - some excellent results, mostly a bit slow and some appalling. How that balances out in your usage pattern is difficult to guess. Maybe things will improve as NILFS matures.
 
Old 08-04-2010, 05:08 PM   #6
DanceMan
Member
 
Registered: Mar 2009
Location: Vancouver BC
Distribution: MX Linux
Posts: 159

Original Poster
Rep: Reputation: 22
Quote:
Yes, I am confused too. Why do you want to know more about the issue with WD Green 4k sector drives, if you intend to install a Kingston SSD? I'm not sure that helps.
I was cheating a bit. I also have one of the 4K WD hdd's and while the topic of sector alignment on linux was broached I hoped to get info applicable to that if this post attracted any experts.

Quote:
If the SSD that you have chosen has (emulates) 4k sectors, and I can't see why such a small device would benefit from 4k sectors appreciably, worry about 4k sectors. If it doesn't, don't.
There is no info in Kingston's specs indicating sector size. Nor has my initial question to their support returned a useful answer. The issue with the new 4k standard, now implemented on some WD hdd's, has alerted me to the issue of proper sector alignment on drives and since we are now in the transition period I'm trying to find out where SSD's fit into that question.

Quote:
More detail, please, on the version and the filesystems.
It would most likely be Ubuntu 10.04. Filesystem I'm less sure of, but probably EXT4.
 
Old 08-05-2010, 03:21 PM   #7
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,070

Rep: Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897
Ok, from here (March 2009)

Quote:
"Ext4 has support for the ATA TRIM command, which allows filesystems to inform SSD’s that blocks have been deleted and do not need to be taken into account by the SSD’s garbage collection and wear-leveling algorithms. Unfortunately the ATA TRIM command hasn’t been finalized yet, and so (as of today) there are no drives, including Intel’s SSD’s that actually support the ATA TRIM command; and for this reason Linux’s block device layer does not currently issue the ATA TRIM command, since there haven’t been any devices to test the command. So at the moment, ext4 informs the block layer that blocks that belong to deleted files can be discard, so once TRIM-capable SSD’s become available, and the Linux block layer actually sends the TRIM command to the hard drives, everything will be all set to go.

However, even without TRIM support, the X25-M SSD works very well on ext4 today. I have one installed in my laptop, and it works just fine. Unfortunately, older SSD’s do not work so well on ext2/3/4. It will be interesting to see how well the next generation of SSD’s work on ext4. For example, I expect SanDisk and OCZ to both release new SSD’s fairly soon. Both of these SSD manufacturers haven’t stated how their new SSD’s will compare to Intel’s SSD offerings, but hopefully they will have comparable features. If so, it may not be worth it to try to optimize ext4 for “legacy” SSD’s. Time will tell…."
I've obviously mangled the description of the problem with trim, but clearly, at that point there was a problem, in that
  • Intel SSDs are about the best supported, and they don't do trim. After issues with earlier generations of SSds, Intel gave some of the kernel guys (Linus himself, Ted, and possibly a few others) their SSDs and the development work was therefore done with Intel devices.
  • That the Intel SSDs didn't implement trim really rather slowed testing and, as far as I am aware, for those 'legacy' Intel devices, there is no commitment to put out 'with Trim' firmware. this is a shame as, in other repects, the Intel devices are still competiotive on performance. maybe, intel will surprise us all...
  • ...and, obviously, you need all of the bits (kernel, filesystem, block layer, device firmware) available, or it doesn't work. Until and upgrade...
There is more detail in the blog posts that Ted mentions.

There is a thread here which goes into detail with Ubuntu releases, which I would presume is correct. OTOH, most of the 'think of an SSD like this' detail isn't strictly accurate, or at best, deceptively written, but it does refer back to more blog stuff from Ted, which is bound to be correct .
 
Old 08-05-2010, 05:12 PM   #8
DanceMan
Member
 
Registered: Mar 2009
Location: Vancouver BC
Distribution: MX Linux
Posts: 159

Original Poster
Rep: Reputation: 22
Thanks for everyone's help. This has prodded me into doing my homework; here's the result.

First, in a rapidly changing situation like this, TRIM support and the 512 to 4k sector change, information from over a year ago, March 2009, should really be considered out of date and suspect.

This link is to an IBM page with a beautifully written summary of the 4k sector issue.

This page will show you just how much misalignment will slow down your drive.

More information on aligning for 4k sectors.

Aligning an SSD on linux. This emphasizes the critical info you need to align an SSD: the size of the erase blocks on your particular SSD. Mine, according to Kingston support (thanks for the prompt answer!) is 1Mb; for Intel it's either 128 or 512 and for some OCZ 512. But don't run with these figures. Research your exact brand and model, because SSD's are in a state of rapid flux.

More info on aligning partitions on linux.

An OCZ Forum thread on linux TRIM, currently at 19 pages.

I hope this thread will be useful to others seeking info on these issues. While I was searching for these links, this post was coming up halfway up the top page on Google.
 
Old 08-05-2010, 09:49 PM   #9
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,974

Rep: Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623
I don't disagree with aligning on a mechanical hard drive. It has been well documented. From what I have read about ssd's they don't need it since they have a complex wear leveling scheme that in effect moves even the format around. If you could provide some top rated tests or other data on the ssd's needing it that would sway my opinion.
 
Old 08-06-2010, 02:20 AM   #10
DanceMan
Member
 
Registered: Mar 2009
Location: Vancouver BC
Distribution: MX Linux
Posts: 159

Original Poster
Rep: Reputation: 22
See the link on aligning an SSD on linux. I think the same basic premise would apply: if you're writing info into two sectors, blocks, whatever, instead of one because of misalignment, it will be slower. You have a good point, though. Test results would be definitive. I was able to find them for mechanical hdd's (second link above) but info on SSD's was much harder to find.
 
  


Reply

Tags
sectors, ssd



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Aligning two different pieces of text on opposite sides of the screen resetreset Programming 7 03-22-2009 09:29 PM
Aligning columns by a character shmuck Programming 6 11-17-2006 10:59 AM
Aligning output in C++ R00ts Programming 13 02-14-2006 12:51 PM
Trouble aligning heads on HP 3820 inkjet chowsapal Linux - Hardware 1 01-05-2006 08:59 AM
aligning torsmo kurrupt Linux - Software 1 06-28-2005 02:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 08:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration