From owner-freebsd-current@FreeBSD.ORG Thu Nov 1 00:26:14 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 CF2A916A469 for ; Thu, 1 Nov 2007 00:26:14 +0000 (UTC) (envelope-from matrix@itlegion.ru) Received: from corpmail.itlegion.ru (corpmail.itlegion.ru [84.21.226.211]) by mx1.freebsd.org (Postfix) with SMTP id 0F6EF13C4B0 for ; Thu, 1 Nov 2007 00:26:13 +0000 (UTC) (envelope-from matrix@itlegion.ru) Received: (qmail 3212 invoked from network); 31 Oct 2007 21:53:34 +0300 Received: from unknown (HELO Artem) (192.168.0.12) by 84.21.226.211 with SMTP; 31 Oct 2007 21:53:34 +0300 X-AntiVirus: Checked by Dr.Web [version: 4.44, engine: 4.44.0.09170, virus records: 253097, updated: 31.10.2007] Message-ID: <001901c81bef$542ce060$0c00a8c0@Artem> From: "Artem Kuchin" To: =?UTF-8?B?6Z+T5a625qiZIEJpbGwgSGFja2Vy?= , References: <00f101c819f7$833d5370$0c00a8c0@Artem> <20071031095213.GG8068@garage.freebsd.pl><02af01c81bb9$7f7828a0$0c00a8c0@Artem> <4728B114.80809@conducive.net> Date: Wed, 31 Oct 2007 21:33:37 +0300 Organization: IT Legion MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="UTF-8"; reply-type=response Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3138 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 Cc: 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: Thu, 01 Nov 2007 00:26:14 -0000 韓家標 Bill Hacker wrote: > 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. >> >> Here is what man says: >> >> 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): >> >> umount /dev/da0s1d >> gjournal label da0s1d da0s1e >> tunefs -J enable -n disable mount -o async /dev/da0s1d.journal /mnt >> mount /dev/da0s1d /mnt >> >> However, this simple does not work. >> gjournal label da0s1d da0s1e - WILL FAIL ON EXISTING FS! >> Need to use -f switch for this. >> >> So, those whole thing will look like this >> >> 1: newfs /dev/da0s1d here we have our EXISTING filesyetm >> 2: gjournal load >> 3: gjournal label -f /dev/da0s1d 4: tunefs -J enable -n disable >> /dev/da0s1d 5: mount -o async /dev/da0s1d.journal /mnt >> >> Now, when you start to fill /mnt you will get error=5 with offset >> out of range >> of the filesystem, beceause metadata for the filesystem is used from >> /dev/da0s1f (step1) but gjournal used 1GB for the journal. >> >> This error goes away if i add additional step between 4 and 5 >> 4.5: newfs /dev/da0s1d.journal >> >> question1: >> >> 4: tunefs -J enable -n disable /dev/da0s1d >> really must be for /dev/da0s1d or for /dev/da0s1d.journal >> >> question2: >> man says >> gjournal label da0s1d da0s1e && tunefs -J enable -n disable && mount >> -o async /dev/da0s1d.journal /mnt || mount /dev/da0s1d /mnt >> >> why there is no fs argument in tunefs? mistake? > > Ah .. does it not expect a raw block device / portion? With no > (other) fs type? osiris# tunefs -p usage: tunefs [-A] [-a enable | disable] [-e maxbpg] [-f avgfilesize] [-J enable | disable ] [-L volname] [-l enable | disable] [-m minfree] [-n enable | disable] [-o space | time] [-p] [-s avgfpdir] special | filesystem So either special or filesystem must be specified > Is this apparent conflict [ occuring | will occur] [because | > if/as/when ] the device has already been given a geom family 'label'. note here. The above example is related to ALRADY EXISTING filesystem. And my point is that IT NEVER WORKS W/O LOOSING DATA! The only was to create properly working journaled fs is to create from scratch. When i created partitions (lables) using sysinstall i had to do then cat /dev/zero > /dev/twed1s1f in otder to erase the label. The proper order seems to be: 1: do fdisk twed1 2: create labels (eg twed1s1f) 3: do cat /dev/zero > /dev/twed1sf into the partition which will be gjournaled 4: gjournal load 5: gjournal label -f /dev/twed1s1f 6: newfs -J /dev/twed1s1f.journal 7: tunefs -J enable -n disable /dev/twed1s1f.journal - I think this one is NOT NEEDED AT ALL! 8: : mount -o noatime /dev/twed1s1f.journal /NEW/suit After all these step journal fs works fine. I wonder how i can check journal usage and if it is really journaled at all :) -- Artem