From owner-freebsd-stable Tue Oct 23 14:44:49 2001 Delivered-To: freebsd-stable@freebsd.org Received: from netau1.alcanet.com.au (ntp.alcanet.com.au [203.62.196.27]) by hub.freebsd.org (Postfix) with ESMTP id 7A23137B401 for ; Tue, 23 Oct 2001 14:44:44 -0700 (PDT) Received: from mfg1.cim.alcatel.com.au (mfg1.cim.alcatel.com.au [139.188.23.1]) by netau1.alcanet.com.au (8.9.3 (PHNE_22672)/8.9.3) with ESMTP id HAA15018 for ; Wed, 24 Oct 2001 07:44:39 +1000 (EST) Received: from gsmx07.alcatel.com.au by cim.alcatel.com.au (PMDF V5.2-32 #37641) with ESMTP id <01K9VE1AC080VFIKI7@cim.alcatel.com.au> for stable@FreeBSD.ORG; Wed, 24 Oct 2001 07:44:16 +1000 Received: (from jeremyp@localhost) by gsmx07.alcatel.com.au (8.11.1/8.11.1) id f9NLia336868 for stable@FreeBSD.ORG; Wed, 24 Oct 2001 07:44:36 +1000 (EST envelope-from jeremyp) Content-return: prohibited Date: Wed, 24 Oct 2001 07:44:36 +1000 From: Peter Jeremy Subject: Re: dirpref gives massive performance boost In-reply-to: <20010928142611.A15946@xor.obsecurity.org>; from kris@obsecurity.org on Fri, Sep 28, 2001 at 02:26:11PM -0700 To: stable@FreeBSD.ORG Mail-Followup-To: stable@FreeBSD.ORG Message-id: <20011024074436.A36730@gsmx07.alcatel.com.au> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-disposition: inline User-Agent: Mutt/1.2.5i References: <20010928141246.A15515@xor.obsecurity.org> <20010928232009.A29187@libero.sunshine.ale> <20010928142611.A15946@xor.obsecurity.org> 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 On 2001-Sep-28 14:26:11 -0700, Kris Kennaway wrote: >On Fri, Sep 28, 2001 at 11:20:09PM +0200, Alessandro de Manzano wrote: >> On Fri, Sep 28, 2001 at 02:12:46PM -0700, Kris Kennaway wrote: >> >> > Just a note to those who have updated to 4.4-STABLE that it's well >> > worth doing a backup + newfs + restore on all your UFS volumes. The >> >> does the "newfs" step is necessary or just recommended for optimum >> performance gain ? > >Well, you need to wipe the disk so that when you restore it can lay >things out optimally from the start. Note that it _is_ possible to do this on your root partition without needing an additional boot disk, assuming your swap partition is bigger that your root partition. The sequence is roughly (all in single-user before enabling swap starting with read-only root): fsck -p dd if=/dev/ad0s1a of=/dev/ad0s1b bs=64k mount /dev/ad0s1b /mnt mount -u / ed /mnt/etc/fstab :: comment out swap and change root to /dev/ad0s1b reboot :: at the boot0 twiddle press space to get the prompt and boot 0,ad(0,b)/boot/loader at the loader prompt, "boot -s" The system should now come up with root on ad0s1b. fsck -p :: arrange a writable /tmp, either "mount -u /" or "mount /tmp" if it's not :: swap-backed newfs /dev/ad0s1a mount /dev/ad0s1a /mnt cd /mnt dump 0f - / | restore rf - rm restoresymtable ed etc/fstab :: re-enable swap and change root back to /dev/ad0s1a cd / reboot The system should now come up normally with root back on ad0s1a. If you're using SCSI disks, replace "ad" with "da". Usual caveats apply: YMMV. Use at own risk. Make sure you have readable backups and a fixit disk in case things break. Peter To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message