xref: /netbsd-src/sbin/newfs_lfs/newfs_lfs.8 (revision f3b496ec9be495acbb17756f05d342b6b7b495e9)
1.\"	$NetBSD: newfs_lfs.8,v 1.21 2006/05/04 04:39:15 perseant Exp $
2.\"
3.\" Copyright (c) 1993
4.\"	The Regents of the University of California.  All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
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.
17.\"
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
28.\" SUCH DAMAGE.
29.\"
30.\"     @(#)newlfs.8	8.1 (Berkeley) 6/19/93
31.\"
32.Dd July 12, 2001
33.Dt NEWFS_LFS 8
34.Os
35.Sh NAME
36.Nm newfs_lfs
37.Nd construct a new LFS file system
38.Sh SYNOPSIS
39.Nm
40.Op Ar newfs_lfs-options
41.Ar special
42.Sh DESCRIPTION
43.Nm
44builds a log-structured file system on the specified special
45device basing its defaults on the information in the disk label.
46Before running
47.Nm
48the disk must be labeled using
49.Xr disklabel 8 ,
50the proper fstype is 4.4LFS.
51Reasonable values for the
52.Li fsize ,
53.Li bsize ,
54and
55.Li sgs
56fields are 1024, 8192, and 7 respectively.
57.Pp
58The following options define the general layout policies.
59.Bl -tag -width Fl
60.It Fl A
61Attempt to compute the appropriate segment size using the formula
62.Em 4 * bandwidth * access time .
63The disk is tested for twenty seconds
64to discover its bandwidth and seek time.
65.It Fl B Ar logical-segment-size
66The logical segment size of the file system in bytes.
67If not specified, the segment size is computed by left-shifting
68the partition label's block size by the amount indicated in the
69partition table's segshift.
70If the disklabel indicates a zero block size or segment shift,
71a compile-time default segment size of 1M is used.
72.It Fl b Ar block-size
73The block size of the file system in bytes.
74If not specified, the block size is taken from the partition label,
75or if the partition label indicates 0,
76a compile-time default of 8K is used.
77.It Fl F
78Force creation of an LFS even on a partition labeled as another type.
79.Nm
80will use compile-time default values for block and fragment size, and segment
81shift, unless these are overridden by command-line flags.
82.It Fl f Ar fragment-size
83The fragment size of the file system in bytes.
84If not specified, the fragment size is taken from the partition label,
85or if the partition label indicates 0,
86a compile-time default of 1K is used.
87.It Fl I Ar interleave
88Specify the interleave between segments.
89The default is zero.
90.It Fl i
91The size of an inode block, in bytes.
92The default is to use the same size as a fragment,
93or in a v1 filesystem, the same size as a data block.
94.It Fl L
95Create a log-structured file system (LFS).
96This is the default, and this
97option is provided for compatibility only.
98.It Fl M Ar nsegs
99Specify
100.Em lfs_minfreeseg ,
101the number of segments left out of the amount allocated to user data.
102A higher number increases cleaner performance, while a lower number
103gives more usable space.
104The default is based on the size of the filesystem, either 5% of the
105total number of segments or 20 segments, whichever is larger.
106.It Fl m Ar free space \&%
107The percentage of space reserved from normal users; the minimum
108free space threshold.
109The default value used is 10%.
110.It Fl N
111Do not actually create the filesystem.
112.It Fl O Ar offset
113Start the first segment this many sectors from the beginning of the
114partition.
115The default is zero.
116.It Fl R Ar nsegs
117Specify
118.Em lfs_resvseg ,
119the number of segments set aside for the exclusive use of the cleaner.
120A larger figure reduces the likelihood of running out of clean segments,
121but if
122.EM lfs_resvseg
123is too close to
124.Em lfs_minfreeseg ,
125the cleaner will run without ceasing when the filesystem becomes close to
126full.  The default is the larger of 15 or the quantity
127.Em lfs_minfreeseg
128/ 2 + 1 .
129.It Fl r Ar ident
130For a v2 filesystem, specify the roll-forward identifier for the
131filesystem.
132This identifier, a 32-bit numeric quantity,
133should be different from that of any LFS that may previously
134have existed on the same disk.
135By default the identifier is chosen at random.
136.It Fl s Ar size
137The size of the file system in sectors.
138.It Fl v Ar version
139Make a filesystem with the specified disk layout version.
140Valid options are 1 or 2 (the default).
141.Em Note ,
142however, that LFS version 1 is deprecated.
143.El
144.Sh SEE ALSO
145.Xr disktab 5 ,
146.\" .Xr fs 5 ,
147.Xr disklabel 8 ,
148.Xr diskpart 8 ,
149.Xr dumplfs 8
150.\" .Xr tunefs 8
151.Rs
152.%A M. Seltzer
153.%A K. Bostic
154.%A M. McKusick
155.%A C. Staelin
156.%T "An Implementation of a Log-Structured File System for UNIX"
157.%J "Proceedings of the Winter 1993 USENIX Conference"
158.%D January 25-29, 1993
159.%P pp. 315-331
160.Re
161.Rs
162.%A J. Matthews
163.%A D. Roselli
164.%A A. Costello
165.%A R. Wang
166.%A T. Anderson
167.%T "Improving the Performance of Log-Structured File Systems with Adaptive Methods"
168.%J "Proceedings of the Sixteenth ACM SOSP"
169.%D October 1997
170.Re
171.Sh HISTORY
172A
173.Ic newlfs
174command appeared in
175.Bx 4.4 ,
176and was renamed to
177.Nm
178for
179.Nx 1.4 .
180