From owner-freebsd-stable@FreeBSD.ORG Wed Jun 8 17:05:55 2011 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1474C106564A for ; Wed, 8 Jun 2011 17:05:55 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from qmta07.westchester.pa.mail.comcast.net (qmta07.westchester.pa.mail.comcast.net [76.96.62.64]) by mx1.freebsd.org (Postfix) with ESMTP id B35FA8FC0C for ; Wed, 8 Jun 2011 17:05:54 +0000 (UTC) Received: from omta02.westchester.pa.mail.comcast.net ([76.96.62.19]) by qmta07.westchester.pa.mail.comcast.net with comcast id tUZS1g0030QuhwU57V5vfm; Wed, 08 Jun 2011 17:05:55 +0000 Received: from koitsu.dyndns.org ([67.180.84.87]) by omta02.westchester.pa.mail.comcast.net with comcast id tV5q1g01E1t3BNj3NV5tlU; Wed, 08 Jun 2011 17:05:54 +0000 Received: by icarus.home.lan (Postfix, from userid 1000) id 00959102C19; Wed, 8 Jun 2011 10:05:48 -0700 (PDT) Date: Wed, 8 Jun 2011 10:05:48 -0700 From: Jeremy Chadwick To: Andriy Gapon Message-ID: <20110608170548.GA2031@icarus.home.lan> References: <4DEF7322.8030907@gmx.de> <4DEF8103.9030401@gmx.de> <20110608162626.GA94883@icarus.home.lan> <4DEFA5E3.8080806@FreeBSD.org> <20110608165515.GA95345@icarus.home.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110608165515.GA95345@icarus.home.lan> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-stable@FreeBSD.org Subject: Re: [SOLVED] Re: labelling root file system (RELENG_8) X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2011 17:05:55 -0000 On Wed, Jun 08, 2011 at 09:55:15AM -0700, Jeremy Chadwick wrote: > On Wed, Jun 08, 2011 at 07:40:03PM +0300, Andriy Gapon wrote: > > on 08/06/2011 19:26 Jeremy Chadwick said the following: > > > I have the exact same question except not with regards to labels but > > > toggling TRIM capability on the root filesystem. > > > > > > - Start system > > > - At loader, boot single-user (option 4) > > > - At prompt choose /bin/sh > > > - mount -a > > > > I think that this is a culprit. > > I'll try removing this step. > > > > - tunefs -t enable /dev/ada0s1a --- fails > > > > Shouldn't you have / mounted r/o here? > > BTW, AFAIR, *re*-mounting root read-only won't help; it needs to have never been > > mounted r/w. > > I'm a little confused by this sentence, so my apologise in advance. / > is mounted read-only in single-user by default. Did you mean I should > make it r/w by doing "mount -u -o rw /" ? I may have omitted this step. > > I will re-verify the exact procedure and exact steps in a moment, and > reply here. > > > > - sysctl kern.geom.debugflags=16 > > > - tunefs -t enable /dev/ada0s1a --- works > > > - tunefs -p /dev/ada0s1a -- shows TRIM enabled > > > - reboot > > > > I think that at this step your superblock on disk gets re-written with its copy in > > memory which has never been updated. But not sure. > > Hmm, I sure hope that isn't the case. That would mean the only time a > person can use tunefs on a root filesystem is when they either do it > manually during the FreeBSD installation (adding "-t" to the list of > newfs flags in the filesystem creation UI), or if they boot off of some > other medium (USB flash drive, CD, PXE, etc.). Interestingly enough, the long procedure I originally described is probably what was causing the problem. Not sure how to phrase it. The exact procedure which worked was: - Start system - Boot into single-user - Hit enter at prompt (choose /bin/sh) - mount --- shows root filesystem mounted read-only (normal) - tunefs -t enable /dev/ada0s1a --- says it enabled TRIM support - tunefs -p /dev/ada0s1a --- shows TRIM support enabled - reboot - After system starts, as root: tunefs -p /dev/ada0s1a --- shows TRIM enabled So the extra rigmarole I was doing somehow caused the problem. -- | Jeremy Chadwick jdc@parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, US | | Making life hard for others since 1977. PGP 4BD6C0CB |