From owner-freebsd-current@FreeBSD.ORG Wed Oct 31 19:11:36 2007 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D197F16A419 for ; Wed, 31 Oct 2007 19:11:36 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (arm132.internetdsl.tpnet.pl [83.17.198.132]) by mx1.freebsd.org (Postfix) with ESMTP id 32DA213C480 for ; Wed, 31 Oct 2007 19:11:35 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 7FD9145E97; Wed, 31 Oct 2007 19:38:57 +0100 (CET) Received: from localhost (154.81.datacomsa.pl [195.34.81.154]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 264BF45E90; Wed, 31 Oct 2007 19:38:43 +0100 (CET) Date: Wed, 31 Oct 2007 19:38:38 +0100 From: Pawel Jakub Dawidek To: Artem Kuchin Message-ID: <20071031183838.GB13180@garage.freebsd.pl> References: <00f101c819f7$833d5370$0c00a8c0@Artem> <20071031095213.GG8068@garage.freebsd.pl> <02af01c81bb9$7f7828a0$0c00a8c0@Artem> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ZGiS0Q5IWpPtfppv" Content-Disposition: inline In-Reply-To: <02af01c81bb9$7f7828a0$0c00a8c0@Artem> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 7.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=-2.6 required=3.0 tests=BAYES_00 autolearn=ham version=3.0.4 Cc: freebsd-current@freebsd.org Subject: Re: Problems with gjournal or something else. X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2007 19:11:37 -0000 --ZGiS0Q5IWpPtfppv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 31, 2007 at 03:28:03PM +0300, Artem Kuchin wrote: > >>Then did: > >> > >>newfs -J -b 8192 -f 1024 -g 50000 -h 20 -i 40960 /dev/twed1s1f > >> > >>gjournal load > >>gjournal label -f /dev/twed1s1f > >>tunefs -J enable -n disable /dev/twed1s1f > >>mount -o noatime /dev/twed1s1f.journal /NEW/suit > > > >It's wrong order. See gjournal(8) manual page, EXAMPLES section. You > >cannot create file system and then put journal on the same partition. > >gjournal would warn you about that, but you used force (-f) option. >=20 > Here is what man says: >=20 > Configure gjournaling on an existing file system, but only if gjournal > allows this (i.e.: if the last sector is not already used by the file > system): >=20 > umount /dev/da0s1d > gjournal label da0s1d da0s1e > tunefs -J enable -n disable=20 > mount -o async /dev/da0s1d.journal /mnt > mount /dev/da0s1d /mnt >=20 > However, this simple does not work. > gjournal label da0s1d da0s1e - WILL FAIL ON EXISTING FS! Have you read what the warning says? It tells you that the last sector, where it tries to write metadata is used by existing file system. Using -f option will destroy the last sector. You not only decided to overwrite single sector, but 1GB of data, because you didn't give separate provider for journal. > Need to use -f switch for this. >=20 > So, those whole thing will look like this >=20 > 1: newfs /dev/da0s1d=20 > here we have our EXISTING filesyetm > 2: gjournal load > 3: gjournal label -f /dev/da0s1d=20 This command destroys 1GB at the end of your file system. How do you expect it to work properly after that? Do you think that giving '-f' will magically add 1GB to your disk capacity? It won't. It will destroy your data, because you asked for by giving *FORCE* option. > question2: > man says > gjournal label da0s1d da0s1e && tunefs -J enable -n disable && mount -o= =20 > async /dev/da0s1d.journal /mnt || mount /dev/da0s1d /mnt >=20 > why there is no fs argument in tunefs? mistake? That's mistake. It should be 'tunefs -J enable -n disable /dev/da0s1d.journ= al'. > what does > 'mount -o async /dev/da0s1d.journal /mnt || mount /dev/da0s1d /mnt; > mean? (note ||) There is more than that. It is given as one command on purpose. If any of the previous commands (gjournal, tunefs or mount) fail, for example because it is not possible to convert the file system to use gjournal, it will mount the file system back. > A couple more questions: > 1) What size of journal to pick? 2GB is fine. --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --ZGiS0Q5IWpPtfppv Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFHKMuuForvXbEpPzQRArjfAJ9oZhjZA14ZgnXTeIb/xyM2CbydOACdFyUZ 2IQ19ArUHmCPbVWiEuZAyoI= =5Ynd -----END PGP SIGNATURE----- --ZGiS0Q5IWpPtfppv--