[parted-devel] [rfc] SSD partition alignment
Daniel J Blueman
daniel.blueman at gmail.com
Sun Feb 22 13:07:31 UTC 2009
On Sun, Feb 22, 2009 at 9:33 AM, Colin Watson <cjwatson at ubuntu.com> wrote:
> On Sun, Feb 22, 2009 at 01:40:16AM +0100, Jim Meyering wrote:
>> Daniel J Blueman wrote:
>> > I've checked into this, and since libparted sees the SATA block device
>> > as SCSI, it doesn't perform the expected ATA 'identify' command to
>> > fill out the 512 bytes of device info, of which (short) word 217 is
>> > device RPM, defined to be 1 on newer compliant SSDs. The kernel uses
>> > this word to detect if a device is an SSD or not, so I suggest we use
>> > the same.
>> > Anyone think of objections to calling the ATA identify ioctl to fill
>> > out the structure, then storing this flat for later use in constraint
>> > checking? If the SCSI device supports it also, fine, else nothing
>> > lost.
>> > For now, a 1MB starting offset for an SSD seems safest, and is what MS
>> > Windows 7 and Server 2008 use, thus a number of vendors will also be
>> > testing/optimising with this case too.
>> Does this really need to be SSD-specific?
>> I hear that this (alignment) is high priority also for many
>> of the big new disks, since they have 4k-byte sectors.
>> Without better alignment, their performance will suffer, too.
> Well, one step at a time. We can detect SSD; can we detect those big new
> disks (or, in general, the desired sector size)?
Just to add to both points: quite a number of SSDs aren't compliant
with the ATA-8 ACS , page 121 (see word 217). My OCZ Core SSD
doesn't set word 217 to be 1 (it's reports 0 RPM, ie unset), thus
2.6.29-rc5 doesn't detect it as an SSD and thus set
/sys/block/sda/queue/rotational to be 0. Here, perhaps it's just
better to always align filesystems, which will help for RAID also.
> Or are you saying that we should increase the alignment to 4KB in
> general? It seems that SSDs actually really want 128KB, which starts to
> feel like a bit much to apply to all disks:
Alignment is suggested to increase the SSD's life too, so is a tiny
space cost for other devices, so maybe it makes sense to do?
Daniel J Blueman
More information about the parted-devel