[BACK]Return to wapbl.4 CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / share / man / man4

File: [cvs.NetBSD.org] / src / share / man / man4 / wapbl.4 (download)

Revision 1.16, Wed May 29 14:55:24 2013 UTC (10 years, 10 months ago) by wiz
Branch: MAIN
CVS Tags: yamt-pagecache-base9, tls-maxphys-base, tls-earlyentropy-base, tls-earlyentropy, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, phil-wifi-base, phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, phil-wifi-20191119, phil-wifi-20190609, phil-wifi, pgoyette-localcount-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, pgoyette-localcount, pgoyette-compat-merge-20190127, pgoyette-compat-base, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315, pgoyette-compat, perseant-stdc-iso10646-base, perseant-stdc-iso10646, netbsd-9-base, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9, netbsd-8-base, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, netbsd-8, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-base, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0, netbsd-7, netbsd-10-base, netbsd-10-0-RELEASE, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10, matt-nb8-mediatek-base, matt-nb8-mediatek, localcount-20160914, is-mlppp-base, is-mlppp, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan, HEAD
Changes since 1.15: +3 -3 lines

Improve wording.

From Bug Hunting.

.\"     $NetBSD: wapbl.4,v 1.16 2013/05/29 14:55:24 wiz Exp $
.\"
.\" Copyright (c) 2008, 2009, 2012 The NetBSD Foundation, Inc.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd December 3, 2012
.Dt WAPBL 4
.Os
.Sh NAME
.Nm WAPBL
.Nd Write Ahead Physical Block Logging file system journaling
.Sh SYNOPSIS
.Cd options WAPBL
.Cd options WAPBL_DEBUG
.Sh DESCRIPTION
The
.Nm
driver provides meta-data journaling for file systems.
In particular, it is used with the fast file system (FFS) to provide
rapid file system consistency checking after a system outage.
It also provides better general-use performance over regular FFS.
.Pp
WAPBL currently maintains its journal in one of two locations:
.Bl -tag -width indent
.It - After the file system
The journal is placed in the same partition as the file system, but
between the file system and the end of the partition.
.It - Within the file system
The journal is allocated as a special contiguous file within the
file system.
The journal file is not visible via normal file system access.
.El
.Pp
A new journal is created automatically when a file system is mounted
via
.Xr mount 8
with the
.Fl o Ar log
option.
If no journal size has been specified with
.Xr tunefs 8 ,
then the size of the journal
will be based on 1MB of journal per 1GB of file system, to a maximum
journal size of 64MB.
.Pp
If there is adequate space between the end of the file system and
the end of the partition, then unless the journal size has been
specified with
.Xr tunefs 8
then the journal will be created after the file system.
To obtain space between the file system and the end of the partition
the size of the partition can be adjusted using
.Xr disklabel 8 .
Care must be taken not to damage existing data on existing partitions,
but this method will work well if, for example, a swap partition can
be shrunk in order to accommodate the journal after the file system on
a partition before the swap partition.
.Pp
For a new file system,
.Bd -literal -offset indent
newfs -s -64m wd0a
.Ed
.Pp
can be used to leave space for a 64MB journal at the end of
.Pa /dev/wd0a .
.Pp
To specify the size of the journal within the file system
.Xr tunefs 8
can be used as follows:
.Bd -literal -offset indent
tunefs -l 64m wd0a
.Ed
.Pp
to indicate that a journal of size 64MB on the file system on
.Pa /dev/wd0a
should be created the next time that file system is mounted.
This must be done before the file system is mounted with the
.Dq -o log
option.
For existing file systems and general use, however, simply using
.Bd -literal -offset indent
mount -o log /dev/wd0a /mnt
.Ed
.Pp
will be sufficient to create an appropriate journal within the file
system.
Running
.Bd -literal -offset indent
tunefs -l 0 wd0a
.Ed
.Pp
will schedule the log for removal on the next read-write mount, and
running
.Bd -literal -offset indent
tunefs -l 0 wd0a
.Ed
.Pp
followed by
.Bd -literal -offset indent
mount -o log /dev/wd0a /mnt
.Ed
.Pp
will remove the log and then re-create it with the default size.
This method can also be used to grow or shrink the size of the journal
by first scheduling the log for removal, then mounting read-write, but
with logging disabled (so no new log will be created), then unmounting
again, setting the desired log size and finally re-mounting with logging
enabled.
.Pp
With the journal,
.Xr fsck 8
is no longer required at system boot.
If the system has been shutdown in an unclean fashion then the journal
will be replayed when the file system is mounted.
.Xr fsck 8
can still be used to force a consistency check of the file system
should that be desired.
.Pp
For kernel developers, the compile time option
.Dv WAPBL_DEBUG
turns on debugging.
.Sh SEE ALSO
.Xr config 1 ,
.Xr fsck 8 ,
.Xr mount 8 ,
.Xr newfs 8 ,
.Xr umount 8
.Sh HISTORY
.An -nosplit
.Nm
was originally written by
.An Darrin B. Jewell
while at Wasabi Systems Inc.
Wasabi Systems contributed the code to
.Nx ,
and it was integrated by
.An Simon Burge ,
.An Antti Kantee ,
.An Andy Doran ,
and
.An Greg Oster .
.Pp
.Nm
first appeared in
.Nx 5.0 .
.Sh CAVEATS
Older releases of the system, and other systems that support the
.Dv UFS
format should only access
.Nm
file systems in read-only mode.
Additionally, the
.Xr fsck 8
command from such systems should not be run against
.Nm
file systems.
Failure to observe these guidelines may damage the file system.
.Pp
.Nm
requires the super block to be in the UFS2 format.
The super block format can be checked using the
.Fl s
option with
.Xr dumpfs 8 ,
and older FFSv1 file systems will need to be updated to the newer
super block layout with the
.Fl c
option to
.Xr fsck_ffs 8 .
.Pp
.Xr fsync 2
causes all outstanding metadata transactions to be committed to disk,
introducing additional latency.
This can have an impact on database software and other software
that calls
.Xr fsync 2
often.
.Pp
In-file system log allocation should be done on a relatively quiet
file system.
The error path for log allocation failures could result in a
.Dq dangling inode
issue, requiring an
.Xr fsck 8
to fix.