1.\" $NetBSD: newfs_lfs.8,v 1.18 2002/10/01 13:40:46 wiz 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. All advertising materials mentioning features or use of this software 15.\" must display the following acknowledgement: 16.\" This product includes software developed by the University of 17.\" California, Berkeley and its contributors. 18.\" 4. Neither the name of the University nor the names of its contributors 19.\" may be used to endorse or promote products derived from this software 20.\" without specific prior written permission. 21.\" 22.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 23.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 26.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32.\" SUCH DAMAGE. 33.\" 34.\" @(#)newlfs.8 8.1 (Berkeley) 6/19/93 35.\" 36.Dd July 12, 2001 37.Dt NEWFS_LFS 8 38.Os 39.Sh NAME 40.Nm newfs_lfs 41.Nd construct a new LFS file system 42.Sh SYNOPSIS 43.Nm 44.Op Ar newfs_lfs-options 45.Ar special 46.Sh DESCRIPTION 47.Nm 48builds a log-structured file system on the specified special 49device basing its defaults on the information in the disk label. 50Before running 51.Nm 52the disk must be labeled using 53.Xr disklabel 8 , 54the proper fstype is 4.4LFS. 55Reasonable values for the 56.Li fsize , 57.Li bsize , 58and 59.Li sgs 60fields are 1024, 8192, and 7 respectively. 61.Pp 62The following options define the general layout policies. 63.Bl -tag -width Fl 64.It Fl A 65Attempt to compute the appropriate segment size using the formula 66.Em 4 * bandwidth * access time . 67The disk is tested for twenty seconds 68to discover its bandwidth and seek time. 69.It Fl B Ar logical-segment-size 70The logical segment size of the file system in bytes. 71If not specified, the segment size is computed by left-shifting 72the partition label's block size by the amount indicated in the 73partition table's segshift. 74If the disklabel indicates a zero block size or segment shift, 75a compile-time default segment size of 1M is used. 76.It Fl b Ar block-size 77The block size of the file system in bytes. 78If not specified, the block size is taken from the partition label, 79or if the partition label indicates 0, 80a compile-time default of 8K is used. 81.It Fl F 82Force creation of an LFS even on a partition labeled as another type. 83.Nm 84will use compile-time default values for block and fragment size, and segment 85shift, unless these are overridden by command-line flags. 86.It Fl f Ar fragment-size 87The fragment size of the file system in bytes. 88If not specified, the fragment size is taken from the partition label, 89or if the partition label indicates 0, 90a compile-time default of 1K is used. 91.It Fl I Ar interleave 92Specify the interleave between segments. 93The default is zero. 94.It Fl i 95The size of an inode block, in bytes. 96The default is to use the same size as a fragment, 97or in a v1 filesystem, the same size as a data block. 98.It Fl L 99Create a log-structured file system (LFS). 100This is the default, and this 101option is provided for compatibility only. 102.It Fl M Ar nsegs 103Reserve this many segments for use exclusively by the cleaner, instead 104of letting 105.Nm 106do the computation. 107Do not use this option. 108.It Fl m Ar free space \&% 109The percentage of space reserved from normal users; the minimum 110free space threshold. 111The default value used is 10%. 112.It Fl N 113Do not actually create the filesystem. 114.It Fl O Ar offset 115Start the first segment this many sectors from the beginning of the 116partition. 117The default is zero. 118.It Fl r Ar ident 119For a v2 filesystem, specify the roll-forward identifier for the 120filesystem. 121This identifier, a 32-bit numeric quantity, 122should be different from that of any LFS that may previously 123have existed on the same disk. 124By default the identifier is chosen at random. 125.It Fl s Ar size 126The size of the file system in sectors. 127.It Fl v Ar version 128Make a filesystem with the specified disk layout version. 129Valid options are 1 or 2 (the default). 130.El 131.Sh SEE ALSO 132.Xr disktab 5 , 133.\" .Xr fs 5 , 134.Xr disklabel 8 , 135.Xr diskpart 8 , 136.Xr dumplfs 8 137.\" .Xr tunefs 8 138.Rs 139.%A M. Seltzer 140.%A K. Bostic 141.%A M. McKusick 142.%A C. Staelin 143.%T "An Implementation of a Log-Structured File System for UNIX" 144.%J "Proceedings of the Winter 1993 USENIX Conference" 145.%D January 25-29, 1993 146.%P pp. 315-331 147.Re 148.Rs 149.%A J. Matthews 150.%A D. Roselli 151.%A A. Costello 152.%A R. Wang 153.%A T. Anderson 154.%T "Improving the Performance of Log-Structured File Systems with Adaptive Methods" 155.%J "Proceedings of the Sixteenth ACM SOSP" 156.%D October 1997 157.Re 158.Sh HISTORY 159A 160.Ic newlfs 161command appeared in 162.Bx 4.4 , 163and was renamed to 164.Nm 165for 166.Nx 1.4 . 167