From owner-freebsd-current@FreeBSD.ORG Wed Oct 31 18:53:56 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 7920316A41B for ; Wed, 31 Oct 2007 18:53:56 +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 CC4C813C4B3 for ; Wed, 31 Oct 2007 18:53:55 +0000 (UTC) (envelope-from matrix@itlegion.ru) Received: (qmail 3216 invoked from network); 31 Oct 2007 21:53:35 +0300 Received: from unknown (HELO Artem) (192.168.0.12) by 84.21.226.211 with SMTP; 31 Oct 2007 21:53:35 +0300 X-AntiVirus: Checked by Dr.Web [version: 4.44, engine: 4.44.0.09170, virus records: 253097, updated: 31.10.2007] Message-ID: <001b01c81bef$54805790$0c00a8c0@Artem> From: "Artem Kuchin" To: "Pawel Jakub Dawidek" References: <00f101c819f7$833d5370$0c00a8c0@Artem> <20071031095213.GG8068@garage.freebsd.pl> <02af01c81bb9$7f7828a0$0c00a8c0@Artem> <20071031183838.GB13180@garage.freebsd.pl> Date: Wed, 31 Oct 2007 21:53:07 +0300 Organization: IT Legion MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="ISO-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit 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: 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 18:53:56 -0000 First of all, thank you for replying. It is always very nice and informative for hear from the actual developer of something. Thank you. >> 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! > >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. My point here is that since it is and example of configuring a gjournaling onf existing system then this 'gjournal label da0s1d da0s1e' will always fail. Of course it says the warning, but basically, condidering that it overwrites last sector+1 GB of data on existing FS there is actual configuring on existing FS. It is simply destroying it. So, i wonder if man page should give such a big hope thar one can configure gjournal on existing fs. Even if another device is used for journal the last sector is overwritten and, as i understand, filesystem still thinks that that sector is free and any attemp to write/read at that sector will result in error=5 In any case, w/o newfs on .journal special the filesystem does not know that it is now shorter than before and IO will be attempted out of the boundaries of that filestem (in the area of journal and last sector) which will result in error 5. To fix it one must newfs spec.journal wich will result in loss of data. SO, there is no proper way to maje existing fs journaled. This is totally fine and not a big problem actually, but it should be mentioned specifically in the man page. >> 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 > >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. >> 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. I'm sorry. I mean what || means here? I probaly just lack enough shell knowledge. >> A couple more questions: >> 1) What size of journal to pick? >2GB is fine. For any fs size and disk operations intensity? Mine is about 260GB moderatelly used. -- Artem