1 .\" $NetBSD: wapbl.4,v 1.11 2009/11/22 18:40:26 mbalmer Exp $
3 .\" Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
4 .\" All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
15 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
16 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
17 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
18 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
19 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 .\" POSSIBILITY OF SUCH DAMAGE.
32 .Nd Write Ahead Physical Block Logging file system journaling
35 .Cd options WAPBL_DEBUG
39 driver provides meta-data journaling for file systems.
40 In particular, it is used with the fast file system (FFS) to provide
41 rapid file system consistency checking after a system outage.
42 It also provides better general-use performance over regular FFS.
44 WAPBL currently maintains its journal in one of two locations:
45 .Bl -tag -width indent
46 .It - After the file system
47 The journal is placed in the same partition as the file system, but
48 between the file system and the end of the partition.
49 .It - Within the file system
50 The journal is allocated as a special contiguous file within the
52 The journal file is not visible via normal file system access.
55 A new journal is created automatically when a file system is mounted
61 If no journal size has been specified with
63 then the size of the journal
64 will be based on 1MB of journal per 1GB of file system, to a maximum
67 If there is adequate space between the end of the file system and
68 the end of the partition, then unless the journal size has been
71 then the journal will be created after the file system.
72 To obtain space between the file system and the end of the partition
73 the size of the partition can be adjusted using
75 Care must be taken not to damage existing data on existing partitions,
76 but this method will work well if, for example, a swap partition can
77 be shrunk in order to accommodate the journal after the file system on
78 a partition before the swap partition.
80 For a new file system,
81 .Bd -literal -offset indent
85 can be used to leave space for a 64MB journal at the end of
88 To specify the size of the journal within the file system
90 can be used as follows:
91 .Bd -literal -offset indent
95 to indicate that a journal of size 64MB on the file system on
97 should be created the next time that file system is mounted.
98 This must be done before the file system is mounted with the
101 For existing file systems and general use, however, simply using
102 .Bd -literal -offset indent
103 mount -o log /dev/wd0a /mnt
106 will be sufficient to create an appropriate journal within the file
109 .Bd -literal -offset indent
113 will schedule the log for removal on the next read-write mount, and
115 .Bd -literal -offset indent
120 .Bd -literal -offset indent
121 mount -o log /dev/wd0a /mnt
124 will remove the log and then re-create it with the default size.
125 This method can also be used to grow or shrink the size of the journal.
129 is no longer required at system boot.
130 If the system has been shutdown in an unclean fashion then the journal
131 will be replayed when the file system is mounted.
133 can still be used to force a consistency check of the file system
134 should that be desired.
136 For kernel developers, the compile time option
148 was originally written by
150 while at Wasabi Systems Inc.
151 Wasabi Systems contributed the code to
153 and was integrated by
164 Older releases of the system, and other systems that support the
166 format should only access
168 file systems in read-only mode.
171 command from such systems should not be run against
174 Failure to observe these guidelines may damage the file system.
177 requires the super block to be in the UFS2 format.
178 The super block format can be checked using the
182 and older FFSv1 file systems will need to be updated to the newer
183 super block layout with the
189 causes all outstanding metadata transactions to be committed to disk,
190 introducing additional latency.
191 This can have an impact on database software and other software
196 File system snapshots
198 and quotas do not yet work with
201 In-file system log allocation should be done on a relatively quiet
203 The error path for log allocation failures could result in a