From owner-freebsd-questions@FreeBSD.ORG Tue Dec 14 12:15:26 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 33C1116A4D1 for ; Tue, 14 Dec 2004 12:15:26 +0000 (GMT) Received: from catflap.slightlystrange.org (cpc2-cmbg1-3-0-cust94.cmbg.cable.ntl.com [213.107.104.94]) by mx1.FreeBSD.org (Postfix) with ESMTP id 871B743D4C for ; Tue, 14 Dec 2004 12:15:25 +0000 (GMT) (envelope-from danielby@slightlystrange.org) Received: from danielby by catflap.slightlystrange.org with local (Exim 4.43 (FreeBSD)) id 1CeBaM-000NjI-Bn for questions@freebsd.org; Tue, 14 Dec 2004 12:15:22 +0000 Date: Tue, 14 Dec 2004 12:15:22 +0000 From: Daniel Bye To: FreeBSD Questions Message-ID: <20041214121522.GA57285@catflap.slightlystrange.org> Mail-Followup-To: FreeBSD Questions References: <7cbadc870412140035443ba967@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="gKMricLos+KVdGMg" Content-Disposition: inline In-Reply-To: <7cbadc870412140035443ba967@mail.gmail.com> User-Agent: Mutt/1.4.2.1i Subject: Re: swapfile X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Daniel Bye List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Dec 2004 12:15:26 -0000 --gKMricLos+KVdGMg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Dec 14, 2004 at 10:35:49AM +0200, Nelis Lamprecht wrote: > Hi, >=20 > Checked the manual but couldn't find anything regarding this. If you > have created more than one swap file how do you specify them in your > rc.conf file ? Manually it works fine but obviously when the machine > boots I want them both to be used again. >=20 > swapfile=3D"/mailstore/swap1" > swapfile=3D"/mailstore/swap2" >=20 > The above doesn't work, only the first one is used. The rc script seems to be written to only allow for one additional swapfile. It should be trivial to rewrite to handle multiple files This diff should apply to /etc/rc.d/addswap to make your setup work. --- /etc/rc.d/addswap Tue Dec 14 12:08:41 2004 +++ addswap Tue Dec 14 12:06:42 2004 @@ -22,10 +22,13 @@ [Nn][Oo] | '') ;; *) - if [ -w "${swapfile}" -a -c /dev/mdctl ]; then - echo "Adding ${swapfile} as additional swap" - mdev=3D`mdconfig -a -t vnode -f ${swapfile}` && swa= pon /dev/${mdev} + for sfile in ${swapfile} ] + do + if [ -w "${sfile}" -a -c /dev/mdctl ]; then + echo "Adding ${sfile} as additional swap" + mdev=3D`mdconfig -a -t vnode -f ${sfile}` && swapon= /dev/${mdev} fi + done ;; esac } Keep a copy of the original addswap somewhere! You will need to specify both swapfiles in the same declaration: swapfile=3D"/mailstore/swap1 /mailstore/swap2" I have only done very basic testing, but it seems to work as you'd expect. However, I hereby disclaim any liability... ;-) HTH Dan --=20 Daniel Bye PGP Key: ftp://ftp.slightlystrange.org/pgpkey/dan.asc PGP Key fingerprint: 3B9D 8BBB EB03 BA83 5DB4 3B88 86FC F03A 90A1 BE8F _ ASCII ribbon campaign ( ) - against HTML, vCards and X - proprietary attachments in e-mail / \ --gKMricLos+KVdGMg Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (FreeBSD) iD8DBQFBvtlZhvzwOpChvo8RAvFQAJ4voqtbd8dIPgV0DSvLKDEzK7fPfgCguHHM xVHEoJKudy7TfnURglXtvF4= =xw+f -----END PGP SIGNATURE----- --gKMricLos+KVdGMg--