From owner-freebsd-current@FreeBSD.ORG Mon Dec 19 23:20:12 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B44A106568D for ; Mon, 19 Dec 2011 23:20:12 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from qmta13.emeryville.ca.mail.comcast.net (qmta13.emeryville.ca.mail.comcast.net [76.96.27.243]) by mx1.freebsd.org (Postfix) with ESMTP id 3C4B98FC12 for ; Mon, 19 Dec 2011 23:20:12 +0000 (UTC) Received: from omta18.emeryville.ca.mail.comcast.net ([76.96.30.74]) by qmta13.emeryville.ca.mail.comcast.net with comcast id BBJf1i0061bwxycADBL5UW; Mon, 19 Dec 2011 23:20:05 +0000 Received: from koitsu.dyndns.org ([67.180.84.87]) by omta18.emeryville.ca.mail.comcast.net with comcast id BBtN1i0121t3BNj8eBtNg6; Mon, 19 Dec 2011 23:53:23 +0000 Received: by icarus.home.lan (Postfix, from userid 1000) id B3562102C19; Mon, 19 Dec 2011 15:20:10 -0800 (PST) Date: Mon, 19 Dec 2011 15:20:10 -0800 From: Jeremy Chadwick To: Alexander Best Message-ID: <20111219232010.GA31612@icarus.home.lan> References: <20111219224700.GA75581@freebsd.org> <32197.1324334968@critter.freebsd.dk> <20111219225633.GA77147@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20111219225633.GA77147@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Mailman-Approved-At: Mon, 19 Dec 2011 23:46:53 +0000 Cc: freebsd-fs@freebsd.org, Poul-Henning Kamp , freebsd-current@freebsd.org Subject: Re: can a wrong alignment cause a decrease in a hdd's life expectancy? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Dec 2011 23:20:12 -0000 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@freebsd.org>, Alexander Best writes: > > >On Mon Dec 19 11, Poul-Henning Kamp wrote: > > >> In message <20111219221617.GA70383@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 |