Re: Problems with gjournal or something else.

From: Pawel Jakub Dawidek <pjd_at_FreeBSD.org>
Date: Wed, 31 Oct 2007 19:38:38 +0100
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.
> 
> 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!

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.
> 
> 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.

> 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?

That's mistake. It should be 'tunefs -J enable -n disable /dev/da0s1d.journal'.

> 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.

-- 
Pawel Jakub Dawidek                       http://www.wheel.pl
pjd_at_FreeBSD.org                           http://www.FreeBSD.org
FreeBSD committer                         Am I Evil? Yes, I Am!

Received on Wed Oct 31 2007 - 18:11:36 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:20 UTC