gjournal questions and observations
Ross Gohlke
ross at grinz.com
Sun Nov 8 05:14:36 UTC 2009
KUDOS
Congratulations to all GEOM contributors. While I am new to GEOM, so far
I am very impressed with the way it is designed and the capabilities
(both realized and anticipated) the design offers.
QUESTIONS
1. What is the best way to journal whole disks whose slices (without
partitions) are used by gconcat and gmirror? Does the same apply for gvinum?
The ultimate scenario seems to be journaling another GEOM class such as
gmirror because gjournal handles the synchronization of all mirror
consumers. You can turn off autosync on the mirror, thus saving CPU
cycles and improving disk access. (Am I right?)
2. How should gjournal and gmirror be configured when the journal is
outside, instead of inside, the mirror?
The above scenario only seems possible if a) you are willing to journal
slices, which is not best practice [1] [2] or b) you use whole disks in
your mirrors, which is not very realistic.
Further I am on PowerPC and don't even have bsdlabel, so journaling
slices and mirroring partitions is not an option anyway.
My thought was to journal each disk separately, outside the mirror, and
keep autosynchronization on for the mirror.
[1]
http://lists.freebsd.org/pipermail/freebsd-questions/2008-April/173501.html
[2]
http://unix.derkeiler.com/Mailing-Lists/FreeBSD/questions/2008-11/msg00247.html
3. What is the best way to completely remove a whole disk journal such
that re-issuing
% gjournal label /dev/ad0
does not require -f?
I have tried gpart destroy/create and newfs -E. I have not tried
blanking the whole disk with dd, nor have I tried newfs -E on the whole
disk.
4. Does it matter whether gjournal is loaded when gjournal label is issued?
Originally I was journaling slices, and I was unable to properly stop a
particular slice.
% gjournal stop ad0s6.journal
% gjournal list
Showed the slice still loaded, but under a different name:
ie, ufsid/48x6x1bxc39394x7
I don't know if it was related to the originally issued gjournal label
command or that gjournal was loaded before the slice was labeled.
I believe what fixed it was:
% dd if=/dev/zero of=/dev/ad0s6
OBSERVATIONS
GJOURNAL
These may seem obvious to you but were hard won by me.
1. Never try to store a whole disk's journal on a slice of the same disk.
2. When journaling a whole disk and keeping the journal on the same
disk, not only must the very last sector of the disk be reserved, but
also the last gig (or whatever the size of your journal). Just leave it
as free space when you create slices with gpart.
While gjournal man page states journaling an existing file system
REQUIRES a separate device for storing the journal, it appears to work
without specifying a second device. At least
% gjournal label -f /dev/ad0
seems to work, using the end of /dev/ad0 to store the journal whether a
slice occupies those sectors or not. (Consequently, trying to gmirror
the last slice when it occupies journal sectors will fail.)
Regards,
Ross Gohlke
More information about the freebsd-geom
mailing list