From owner-freebsd-questions@FreeBSD.ORG Fri Nov 16 19:10:42 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 10AE93CF for ; Fri, 16 Nov 2012 19:10:42 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (wonkity.com [67.158.26.137]) by mx1.freebsd.org (Postfix) with ESMTP id 9F6178FC0C for ; Fri, 16 Nov 2012 19:10:41 +0000 (UTC) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.14.5/8.14.5) with ESMTP id qAGJAdSM077311; Fri, 16 Nov 2012 12:10:39 -0700 (MST) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.14.5/8.14.5/Submit) with ESMTP id qAGJAcO5077308; Fri, 16 Nov 2012 12:10:39 -0700 (MST) (envelope-from wblock@wonkity.com) Date: Fri, 16 Nov 2012 12:10:38 -0700 (MST) From: Warren Block To: Gary Aitken Subject: Re: 9.0 crash, ssd or filesystem problem? In-Reply-To: <50A66659.5040406@dreamchaser.org> Message-ID: References: <50A53FF1.7050806@dreamchaser.org> <50A602AB.2060307@dreamchaser.org> <50A66659.5040406@dreamchaser.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (wonkity.com [127.0.0.1]); Fri, 16 Nov 2012 12:10:39 -0700 (MST) Cc: FreeBSD Mailing List X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2012 19:10:42 -0000 On Fri, 16 Nov 2012, Gary Aitken wrote: > >>>>> ~$ gpart show ada0 >>>>> => 34 250069613 ada0 GPT (119G) >>>>> 34 128 1 freebsd-boot (64k) >>>>> 162 41943040 2 freebsd-ufs (20G) / >>>>> 41943202 1048576 3 freebsd-swap (512M) swap >>>>> 42991778 8388608 4 freebsd-ufs (4.0G) /var >>>>> 51380386 4194304 5 freebsd-ufs (2.0G) /tmp >>>>> 55574690 192216088 6 freebsd-ufs (91G) /usr >>>>> 247790778 2278869 - free - (1.1G) >>>> >>>> It would not cause this problem, but those partitions are not aligned. >>>> That would only affect speed, not reliability. >>> >>> geezes, it's not even on a 4K boundary from the get-go; >>> not sure how that happened. >>> let-alone the 1M boundary I just learned about. >> >> That's a normal install. It's fine for 512-byte devices. >> I have other suggestions too, but let's save that until the problem is fixed. > > aaahhh. Vague recollections of getting this to boot up first time around. > > How about suggestions anyway, as I'm going to build an sata disk and move > things to that as part of the process to see what's wrong. May as well get > it right-ish the first time; then repartition the SSD. Okay. The disk setup article shows alignment and using GPT labels, so I'll skip those. Additional SSD suggestions: when creating partitions, leave out the swap partition. If you have lots of memory, leave out the /tmp partition. Add that extra space to the /usr partition. Format the UFS filesystems with -Ut, for soft updates and TRIM support. (Make sure your SSD supports TRIM, almost all do.) (I don't use soft updates journaling.) Use dd(1) to make a zero-filled file on /usr somewhere, say /usr/swap. Make it the size you want swap to be, and do not make it a sparse file. Tell the system to use the swapfile in /etc/rc.conf: swapfile="/usr/swap" Use tmpfs for /tmp in /etc/fstab: tmpfs /tmp tmpfs rw,mode=01777 0 0 It's possible to limit the size, but not necessary. This /tmp will be cleared on reboot. Now: why? Using a swapfile through the filesystem gives three advantages: 1. Disk space is not tied up in an unused swap partition. 2. Swap can be resized without repartitioning. 3. Swap goes through the filesystem, using TRIM, helping the SSD maintain performance. /tmp as tmpfs is auto-sizing, efficient, and self-clearing on reboot. It doesn't tie up disk space in a mostly-unused partition. I use tmpfs for /usr/obj also. It doesn't improve speed, but reduces writes to SSD and is also self-clearing.