GJOURNAL(8) | MidnightBSD System Manager's Manual | GJOURNAL(8) |
gjournal
— control
utility for journaled devices
gjournal |
label [-cfhv ]
[-s jsize]
dataprov [jprov] |
gjournal |
stop [-fv ]
name ... |
gjournal |
sync [-v ] |
gjournal |
clear [-v ]
prov ... |
gjournal |
dump prov ... |
gjournal |
list |
gjournal |
status |
gjournal |
load |
gjournal |
unload |
The gjournal
utility is used for journal
configuration on the given GEOM provider. The Journal and data may be stored
on the same provider or on two separate providers. This is block level
journaling, not file system level journaling, which means everything gets
logged, e.g. for file systems, it journals both data and metadata. The
gjournal
GEOM class can talk to file systems, which
allows the use of gjournal
for file system
journaling and to keep file systems in a consistent state. At this time,
only UFS file system is supported.
To configure journaling on the UFS file system using
gjournal
, one should first create a
gjournal
provider using the
gjournal
utility, then run
newfs(8) or
tunefs(8) on it with the
-J
flag which instructs UFS to cooperate with the
gjournal
provider below. There are important
differences in how journaled UFS works. The most important one is that
sync(2) and
fsync(2) system calls do
not work as expected anymore. To ensure that data is stored on the data
provider, the gjournal
sync
command should be used after calling
sync(2). For the best
performance possible, soft-updates should be disabled when
gjournal
is used. It is also safe and recommended to
use the async
mount(8) option.
When gjournal
is configured on top of
gmirror(8) or
graid3(8) providers, it
also keeps them in a consistent state, thus automatic synchronization on
power failure or system crash may be disabled on those providers.
The gjournal
utility uses on-disk
metadata, stored in the provider's last sector, to store all needed
information. This could be a problem when an existing file system is
converted to use gjournal
.
The first argument to gjournal
indicates
an action to be performed:
label
gjournal
on the given provider(s). If
only one provider is given, both data and journal are stored on the same
provider. If two providers are given, the first one will be used as data
provider and the second will be used as the journal provider.
Additional options include:
-c
-f
gjournal
, but only if the journal will be
configured on a separate provider and if the last sector in the data
provider is not used by the existing file system. If
gjournal
detects that the last sector is used,
it will refuse to overwrite it and return an error. This behavior may
be forced by using the -f
flag, which will
force gjournal
to overwrite the last
sector.-h
-s
jsizegjournal
for small file systems (e.g.:
only few gigabytes big).clear
stop
Additional options include:
-f
sync
dump
list
status
load
unload
Additional options include:
-v
Exit status is 0 on success, and 1 if the command fails.
Create a gjournal
based UFS file system
and mount it:
gjournal load gjournal label da0 newfs -J /dev/da0.journal mount -o async /dev/da0.journal /mnt
Configure journaling 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 da0s1d.journal && \ mount -o async /dev/da0s1d.journal /mnt || \ mount /dev/da0s1d /mnt
Gjournal adds the sysctl level kern.geom.journal. The string and integer information available is detailed below. The changeable column shows whether a process with appropriate privilege may change the value.
sysctl name | Type | Changeable |
debug | integer | yes |
switch_time | integer | yes |
force_switch | integer | yes |
parallel_flushes | integer | yes |
accept_immediately | integer | yes |
parallel_copies | integer | yes |
record_entries | integer | yes |
optimize | integer | yes |
debug
switch_time
force_switch
parallel_flushes
accept_immediately
parallel_copies
record_entries
optimize
The string and integer information available for the cache level is detailed below. The changeable column shows whether a process with appropriate privilege may change the value.
sysctl name | Type | Changeable |
used | integer | no |
limit | integer | yes |
divisor | integer | no |
switch | integer | yes |
misses | integer | yes |
alloc_failures | integer | yes |
used
limit
divisor
switch
misses
alloc_failures
The string and integer information available for the statistics level is detailed below. The changeable column shows whether a process with appropriate privilege may change the value.
sysctl name | Type | Changeable |
skipped_bytes | integer | yes |
combined_ios | integer | yes |
switches | integer | yes |
wait_for_copy | integer | yes |
journal_full | integer | yes |
low_mem | integer | yes |
skipped_bytes
combined_ios
switches
wait_for_copy
journal_full
low_mem
The gjournal
utility appeared in
FreeBSD 7.0.
Pawel Jakub Dawidek <pjd@FreeBSD.org>
February 17, 2009 | midnightbsd-3.1 |