1.\" $NetBSD: newfs_lfs.8,v 1.17 2002/01/21 18:24:06 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. Reasonable values for the 55.Li fsize , 56.Li bsize , 57and 58.Li sgs 59fields are 1024, 8192, and 7 respectively. 60.Pp 61The following options define the general layout policies. 62.Bl -tag -width Fl 63.It Fl A 64Attempt to compute the appropriate segment size using the formula 65.Em 4 * bandwidth * access time . 66The disk is tested for twenty seconds 67to discover its bandwidth and seek time. 68.It Fl B Ar logical-segment-size 69The logical segment size of the file system in bytes. If not specified, 70the segment size is computed by left-shifting the partition label's block 71size by the amount indicated in the partition table's segshift. If the 72disklabel indicates a zero block size or segment shift, a compile-time default 73segment size of 1M is used. 74.It Fl b Ar block-size 75The block size of the file system in bytes. If not specified, the block 76size is taken from the partition label, or if the partition label 77indicates 0, a compile-time default of 8K is used. 78.It Fl F 79Force creation of an LFS even on a partition labeled as another type. 80.Nm 81will use compile-time default values for block and fragment size, and segment 82shift, unless these are overridden by command-line flags. 83.It Fl f Ar fragment-size 84The fragment size of the file system in bytes. If not specified, 85the fragment size is taken from the partition label, or if the partition 86label indicates 0, a compile-time default of 1K is used. 87.It Fl I Ar interleave 88Specify the interleave between segments. The default is zero. 89.It Fl i 90The size of an inode block, in bytes. The default is to use the same 91size as a fragment, or in a v1 filesystem, the same size as a data block. 92.It Fl L 93Create a log-structured file system (LFS). This is the default, and this 94option is provided for compatibility only. 95.It Fl M Ar nsegs 96Reserve this many segments for use exclusively by the cleaner, instead 97of letting 98.Nm 99do the computation. Do not use this option. 100.It Fl m Ar free space \&% 101The percentage of space reserved from normal users; the minimum 102free space threshold. The default value used is 10%. 103.It Fl N 104Do not actually create the filesystem. 105.It Fl O Ar offset 106Start the first segment this many sectors from the beginning of the 107partition. The default is zero. 108.It Fl r Ar ident 109For a v2 filesystem, specify the roll-forward identifier for the 110filesystem. This identifier, a 32-bit numeric quantity, 111should be different from that of any LFS that may previously 112have existed on the same disk. By default the 113identifier is chosen at random. 114.It Fl s Ar size 115The size of the file system in sectors. 116.It Fl v Ar version 117Make a filesystem with the specified disk layout version. Valid options 118are 1 or 2 (the default). 119.El 120.Sh SEE ALSO 121.Xr disktab 5 , 122.\" .Xr fs 5 , 123.Xr disklabel 8 , 124.Xr diskpart 8 , 125.Xr dumplfs 8 126.\" .Xr tunefs 8 127.Rs 128.%A M. Seltzer 129.%A K. Bostic 130.%A M. McKusick 131.%A C. Staelin 132.%T "An Implementation of a Log-Structured File System for UNIX" 133.%J "Proceedings of the Winter 1993 USENIX Conference" 134.%D January 25-29, 1993 135.%P pp. 315-331 136.Re 137.Rs 138.%A J. Matthews 139.%A D. Roselli 140.%A A. Costello 141.%A R. Wang 142.%A T. Anderson 143.%T "Improving the Performance of Log-Structured File Systems with Adaptive Methods" 144.%J "Proceedings of the Sixteenth ACM SOSP" 145.%D October 1997 146.Re 147.Sh HISTORY 148A 149.Ic newlfs 150command appeared in 151.Bx 4.4 , 152and was renamed to 153.Nm 154for 155.Nx 1.4 . 156