1 .\" $NetBSD: lfs_cleanerd.8,v 1.17 2006/12/23 07:21:34 wiz Exp $
4 .\" The Regents of the University of California. 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.
14 .\" 3. Neither the name of the University nor the names of its contributors
15 .\" may be used to endorse or promote products derived from this software
16 .\" without specific prior written permission.
18 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" from: @(#)lfs_cleanerd.8 8.2 (Berkeley) 12/11/93
37 .Nd garbage collect a log-structured file system
41 .Op Fl i Ar segment-number
42 .Op Fl l Ar load-threshhold
43 .Op Fl n Ar number-of-segments
44 .Op Fl r Ar report-frequency
50 command starts a daemon process which garbage-collects
51 the log-structured file system residing at the point named by
53 in the global file system namespace.
54 This command is normally executed by
56 when the log-structured file system is mounted.
57 The daemon will exit within a few minutes
58 of when the file system it was cleaning is unmounted.
60 Garbage collection on a log-structured file system is done by scanning
61 the file system's segments for active, i.e. referenced, data and copying
63 When all of the active data in a given segment has been copied to a new
64 segment that segment can be marked as empty, thus reclaiming the space
65 taken by the inactive data which was in it.
67 The following options are available:
68 .Bl -tag -width indent
70 Use bytes written, rather than segments read, when determining how many
71 segments to clean at once.
74 For each live inode, check to see if it has too many
75 blocks that are not contiguous, and if it does, rewrite it.
76 After a single pass through the filesystem the cleaner will exit.
77 This option has been reported to corrupt file data; do not use it.
79 Stay in the foreground, do not become a daemon process.
80 Does not print additional debugging information (in contrast to
84 Do not become a daemon process, and print debugging information.
87 s give more detailed debugging information.
89 Use filesystem idle time as the criterion for aggressive cleaning,
90 instead of system load.
91 .It Fl i Ar segment-number
92 Invalidate the segment with segment number
94 This option is used by
96 and should not be specified on the command line.
97 .It Fl l Ar load-threshhold
98 Clean more aggressively when the system load is below the given threshhold.
99 The default threshhold is 0.2.
102 This option is present for historical compatibility.
103 .It Fl n Ar number-of-segments
104 Clean this number of segments at a time: that is, pass this many
105 segments' blocks through a single call to lfs_markv, or, if
107 was also given, pass this many segments' worth of blocks through a
108 single call to lfs_markv.
110 Quit after cleaning once.
111 .It Fl r Ar report-frequency
112 Give an efficiency report after every
114 times through the main loop.
116 When cleaning the file system,
117 send only a few blocks through lfs_markv at a time.
118 Don't use this option.
120 Poll the filesystem every
122 seconds, looking for opportunities to clean.
123 The default is 300, that is, five minutes.
126 will be automatically awakened when the filesystem is active,
127 so it is not usually necessary to set
139 utility first appeared in