From owner-freebsd-stable Tue May 14 11:20:52 2002 Delivered-To: freebsd-stable@freebsd.org Received: from postal1.es.net (postal1.es.net [198.128.3.205]) by hub.freebsd.org (Postfix) with ESMTP id C171437B403 for ; Tue, 14 May 2002 11:20:44 -0700 (PDT) Received: from ptavv.es.net ([198.128.4.29]) by postal1.es.net (Postal Node 1) with ESMTP id GQF37091; Tue, 14 May 2002 11:20:42 -0700 Received: from ptavv (localhost [127.0.0.1]) by ptavv.es.net (Postfix) with ESMTP id 874C75D06; Tue, 14 May 2002 11:20:42 -0700 (PDT) To: Nuno Teixeira Cc: freebsd-stable@freebsd.org Subject: Re: enable/disable softupdates in rc init idea In-reply-to: Your message of "Tue, 14 May 2002 18:36:52 BST." <20020514173651.GA284@gw.tex.bogus> Date: Tue, 14 May 2002 11:20:42 -0700 From: "Kevin Oberman" Message-Id: <20020514182042.874C75D06@ptavv.es.net> Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > Date: Tue, 14 May 2002 18:36:52 +0100 > From: Nuno Teixeira > Sender: owner-freebsd-stable@FreeBSD.ORG > > > Hello to all, > > I'm looking for a solution to enable/disable softupdates without: > > 1. using single user mode > 2. changing filesystem status, e.g.: > > mount -ufo ro > tunefs -n enable > mount -ufo rw > > 1. is problematic for those who don't have console access to > machine/server > > 2. can result in several errors in filesystems like /var > > > To enable softupdates in a filesystem, we need to have a filesystem > unmounted (or in reed-only mode) so I used rc script to enable it > before the system mounts all filesystems. > > I've changed rc (line 217 - 4.6-PRERELEASE) to: > > ### /etc/rc > > (...) > # If using diskless, run custom disk mounting function here > # > if [ -n "${diskless_mount}" -a -r "${diskless_mount}" ]; then > sh ${diskless_mount} > else > # otherwise mount everything except nfs filesystems. > > + #SOFTUPDATES ENABLE/DISABLE BEFORE MOUNTING ALL FILESYSTEMS - > + > + case ${softupdates_enable} in > + [Nn][Oo][Nn][Ee] | '') > + # do nothing > + ;; > + [Yy][Ee][Ss]) > + # enable softupdates in fs list > + for sufs in ${softupdates_fs}; do > + tunefs -n enable ${sufs} > + done > + ;; > + [No][Oo]) > + # disable softupdates in fs list > + for sufs in ${softupdates_fs}; do > + tunefs -n disable ${sufs} > + done > + ;; > + esac > > mount -a -t nonfs > fi > (...) > > and add 2 config lines to rc.conf: > > ### /etc/rc.conf > > + softupdates_enable="NONE" # YES - Enable; NO - Disable; NONE - Nothing > + softupdates_fs="/dev/ad0s1d /dev/ad0s1h" > > > It works ok but this method is stupid because we need to activate > softupdates only once and not every time that we reboot/start the machine. > > Does anyone knows a better way of doing this? OK. I'm a bit confused. Why do you need to be doing this? Turn on softupdates on the various file systems when you install the system. If it's already built, live with a single drop to single-user mode and turn softupdates on. The softupdates attribute is non-volatile. Turn it on and it stays on until it's turned off. R. Kevin Oberman, Network Engineer Energy Sciences Network (ESnet) Ernest O. Lawrence Berkeley National Laboratory (Berkeley Lab) E-mail: oberman@es.net Phone: +1 510 486-8634 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message