From owner-freebsd-questions@FreeBSD.ORG Mon May 18 14:18:51 2015 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BEB3F295 for ; Mon, 18 May 2015 14:18:51 +0000 (UTC) Received: from smtp1.bway.net (smtp1.bway.net [216.220.96.27]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 97B4A1E5D for ; Mon, 18 May 2015 14:18:51 +0000 (UTC) Received: from gecko4 (host-216-220-115-37.dsl.bway.net [216.220.115.37]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: m1316v@bway.net) by smtp1.bway.net (Postfix) with ESMTPSA id 1C28295854; Mon, 18 May 2015 10:18:42 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bway.net; s=mail; t=1431958722; bh=cENLeASUQGLCvkw0b4t3EyIugUPxlHIWqCUgMXOn63U=; h=Date:From:To:Cc:Subject:In-Reply-To:References:Reply-To; b=XirbeDp7QoKZW6qBgD6EGLhyu4xBa4LtV66TD3vJDFzpoMBKl7IpVRCiH54qtrVO0 9MEEnl/GIuP2YbkqVFQmkUEnKwu7+ux3M8Tc7dbla09ugcsbO4nqUY6cPz+EbLSdBM gjzx0bgHSsjYnwGVmW9QkbtyjHdredbxpQRBFeP0= Date: Mon, 18 May 2015 10:18:41 -0400 From: mfv To: Arthur Chance Cc: Warren Block , freebsd-questions@freebsd.org Subject: Re: Setting Trim _AFTER_ a New Install Message-ID: <20150518101841.6fcd9a12@gecko4> In-Reply-To: <55277D4D.4010802@qeng-ho.org> References: <20150409152321.65de5fd0@gecko4> <55277D4D.4010802@qeng-ho.org> Reply-To: mfv@bway.net MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2015 14:18:51 -0000 On Fri, 10 Apr 2015 08:35:41 +0100 Arthur Chance wrote: > On 09/04/2015 22:27, Warren Block wrote: > > On Thu, 9 Apr 2015, mfv wrote: > > > >> Hello, > >> > >> I've recently installed FreeBSD r10.1 using bsdinstall and then > >> loaded a large number of programs and data. After spending > >> considerable time on the installation I discovered that my SSD has > >> TRIM which appears to be quite useful. After some investigation I > >> understand that it is a simple flag that can be set after booting > >> into single user mode. > >> > >> I hope my questions are simple: > >> > >> If TRIM is enabled will it mess up the disk so that everything has > >> to be reinstalled? > > > > No, it will not harm the data. That said, before running tunefs to > > enable it, make a backup. Always make a backup. > > > >> If not, is there anything else I should be aware of? > > > > If you used ZFS-on-root, tunefs(8) and TRIM do not apply. ZFS uses > > TRIM natively now, but I'm not sure if that was in 10.1 or only now > > in 10-STABLE. > > I'm on 10.1-REL, it's got TRIM in zfs > > root@arthur# sysctl vfs.zfs | grep trim > vfs.zfs.vdev.trim_on_init: 1 > vfs.zfs.vdev.trim_min_active: 1 > vfs.zfs.vdev.trim_max_active: 64 > vfs.zfs.vdev.trim_max_bytes: 2147483648 > vfs.zfs.vdev.trim_max_pending: 64 > vfs.zfs.trim.enabled: 1 > vfs.zfs.trim.txg_delay: 32 > vfs.zfs.trim.timeout: 30 > vfs.zfs.trim.max_interval: 1 > > Just wanted to send a long overdue thanks for your help. I followed Warren's admonition of doing a backup before changing the flag and was glad I did. Early in the morning, without being sufficiently caffeinated, I typed newfs rather than tunefs. That, of course, wiped out the disk. During re-installation the TRIM flag was set and the old data reloaded. The SSD performance is wonderful. Let this message be another object lesson of doing backups (and a plug for the caffeine industry). Cheers ... __o _ \<,_ Marek (+)/ (+) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~