Re: can a wrong alignment cause a decrease in a hdd's life expectancy?

From: Jeremy Chadwick <freebsd_at_jdc.parodius.com>
Date: Mon, 19 Dec 2011 15:20:10 -0800
On Mon, Dec 19, 2011 at 10:56:33PM +0000, Alexander Best wrote:
> On Mon Dec 19 11, Poul-Henning Kamp wrote:
> > In message <20111219224700.GA75581_at_freebsd.org>, Alexander Best writes:
> > >On Mon Dec 19 11, Poul-Henning Kamp wrote:
> > >> In message <20111219221617.GA70383_at_freebsd.org>, Alexander Best writes:
> > >> 
> > >> >ps: the hdd only gets mounted read-only!
> > >> 
> > >> There is no known wear-effects in flash storage as long as you
> > >> only read.
> > >> 
> > >> You may need to do refresh-writes every 5-10 years to avoid
> > >> tunnel-leakage bit errors, but most flash controllers use semi-long
> > >> ECC syndromes and will do so on first bit that gives an read error.
> > >
> > >this is a regular hdd i believe -- no ssd. at least when i plug it into my
> > >usb drive i hear the hdd spinning up and causing vibrations. i don't think
> > >that would be the case with an ssd.
> > 
> > Ahh, sorry, I don't know why I thought it was flash.
> 
> no problem. so will the improper alignment also not cause a life expectancy
> shortage in case of a hdd (non-flash-based)?

The improper alignment will result in sub-par write performance, and a
slight decrease in read performance writes -- but will not impact life
expectancy or "harm" the drive in any way.

I recommend strongly that you rectify the situation before you get too
carried away with software installations, etc..

And yes I am aware what you have is a mechanical HDD not an SSD (I say
in this advance of what I'm about to write).

If you need a ""safe"" alignment value, most software on Windows
(including Windows 7) pick a value of 2MBytes as the alignment offset,
which I believe is LBA 4095, since everything software-wise uses
512-byte sectors.  That's calculated via: 2097152 / 512.

This number is also evenly divisible by 4096 bytes (which is what you're
trying to ensure for performance).

Readers, as well as you, may wonder where the "magical" 2MByte value
comes from, and can you pick something smaller.  Yes you can pick
something smaller, but the value itself stems from the added complexity
of SSDs and NAND erase page size vs. NAND page size.  A value of 2MBytes
works well on all brands of SSDs on the market (as of this writing).

Which reminds me -- I need to go back and redo most of our systems that
use Intel SSDs, since at the time I picked the default offset in
sysinstall (LBA 63, thus 64 * 512 = 32KBytes), which though divisible by
4096, is not optimal for NAND erase page size.

I would love to advocate FreeBSD change sysinstall/bsdinstall to use a
default offset of 2MBytes, but I imagine that would upset a lot of
people who install FreeBSD on "limited space" devices (CF, etc.).
Honestly though, with the size of media these days........

> and one other question: the hdd also supports usb 3. will the improper
> alignment have any effect (speed wise) when connected via usb 3, or is even
> usb 3 too slow to notice the performance drop due to the improper alignment?

USB 3.0 vs. 2.0 vs. eSATA vs. native SATA has no bearing on the
situation.  Those are transport protocols that define "maximum
bandwidth".

By the way, the hard disk itself does not "support USB 3.0" -- your
drive is in an enclosure that contains a SATA<->USB3.0 conversion
chipset inside.  If you open the enclosure, you will find the hard disk
is SATA, and probably supports SATA600.

-- 
| Jeremy Chadwick                                jdc at parodius.com |
| Parodius Networking                       http://www.parodius.com/ |
| UNIX Systems Administrator                   Mountain View, CA, US |
| Making life hard for others since 1977.               PGP 4BD6C0CB |
Received on Mon Dec 19 2011 - 22:20:12 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:22 UTC