From owner-freebsd-fs@FreeBSD.ORG Wed Jul 29 14:04:22 2009 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9456A106564A for ; Wed, 29 Jul 2009 14:04:22 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello087206049004.chello.pl [87.206.49.4]) by mx1.freebsd.org (Postfix) with ESMTP id AE78F8FC0C for ; Wed, 29 Jul 2009 14:04:21 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id BE73A45C8A; Wed, 29 Jul 2009 16:04:18 +0200 (CEST) Received: from localhost (pjd-w.wheel.pl [10.0.1.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 5613F45684; Wed, 29 Jul 2009 16:04:11 +0200 (CEST) Date: Wed, 29 Jul 2009 16:04:36 +0200 From: Pawel Jakub Dawidek To: Anthony Chavez Message-ID: <20090729140436.GG1586@garage.freebsd.pl> References: <4A62E0CE.1000508@hexadecagram.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Dzs2zDY0zgkG72+7" Content-Disposition: inline In-Reply-To: <4A62E0CE.1000508@hexadecagram.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 8.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-5.9 required=4.5 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.4 Cc: freebsd-fs@freebsd.org Subject: Re: Re-starting a gjournal provider X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jul 2009 14:04:22 -0000 --Dzs2zDY0zgkG72+7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jul 19, 2009 at 03:01:02AM -0600, Anthony Chavez wrote: > Hello freebsd-fs, >=20 > I'm trying to get gjournal working on a "removable" hard disk. I use > the term loosely, because I'm using a very simple eSATA enclosure: an > AMS Venus DS5 [1]. >=20 > If I swap out disks, atacontrol cap ad0 seems sufficient enough to > detect the new drive: the reported device model, serial number, firmware > revision, and CHS values change as one would expect. >=20 > My interpretation of [2] section 5.3 and gjournal(8) is that the > following sequence of commands should ensure me that all write buffers > have been flushed and bring the system to a point where it is safe to > remove a disk. >=20 > sync; sync; sync > gjournal sync > umount /dev/ad0s1.journal > gjournal stop ad0s1.journal You should first unmount and then call 'gjournal sync'. > However, once they are executed, /dev/ad0s1.journal disappears and when > I swap out the disk it doesn't come back. The only way I've found to > bring it back is atacontrol detach ata0; atacontrol attach ata0, which > doesn't seem like a wise thing to do if I have another device on the > same channel. It doesn't come back because something (ATA layer?) doesn't properly remove ad0 provider. When you remove the disk, /dev/ad0 should disappear and reappear once you insert it again. You can still do this trick after you insert the disk again so the GEOM can schedule retaste: # true > /dev/ad0 > My question is, do I need to issue gjournal stop before I swap disks? > And if so, is there any way that I can avoid the atacontrol > detach/attach cycle that would need to take place before any mount is > attempted so that /dev/ad0s1.journal appears (if in the drive inserted > at the time does in fact utilize gjournal; I may want to experiment with > having disks with either gjournal or soft updates)? >=20 > And while I'm on the subject, are the (gjournal) syncs commands > preceeding umount absolutely necessary in the case of removable media? 'gjournal sync' should follow unmount, not the other way around. And its better to do it, but 'gjournal stop' should do the same. --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --Dzs2zDY0zgkG72+7 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFKcFb0ForvXbEpPzQRAn3BAKDFQ4AkRfSa7Ll0IqIByPC48sSIiACgjH2o cEJJA+z+AhtRw2LpfPgAChw= =3vmZ -----END PGP SIGNATURE----- --Dzs2zDY0zgkG72+7--