xref: /netbsd/sbin/newfs_lfs/newfs_lfs.8 (revision c8459eb5)
1*c8459eb5Sdholland.\"	$NetBSD: newfs_lfs.8,v 1.24 2015/10/15 06:24:33 dholland Exp $
20a849c91Sperseant.\"
30a849c91Sperseant.\" Copyright (c) 1993
40a849c91Sperseant.\"	The Regents of the University of California.  All rights reserved.
50a849c91Sperseant.\"
60a849c91Sperseant.\" Redistribution and use in source and binary forms, with or without
70a849c91Sperseant.\" modification, are permitted provided that the following conditions
80a849c91Sperseant.\" are met:
90a849c91Sperseant.\" 1. Redistributions of source code must retain the above copyright
100a849c91Sperseant.\"    notice, this list of conditions and the following disclaimer.
110a849c91Sperseant.\" 2. Redistributions in binary form must reproduce the above copyright
120a849c91Sperseant.\"    notice, this list of conditions and the following disclaimer in the
130a849c91Sperseant.\"    documentation and/or other materials provided with the distribution.
14276d62f6Sagc.\" 3. Neither the name of the University nor the names of its contributors
150a849c91Sperseant.\"    may be used to endorse or promote products derived from this software
160a849c91Sperseant.\"    without specific prior written permission.
170a849c91Sperseant.\"
180a849c91Sperseant.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
190a849c91Sperseant.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
200a849c91Sperseant.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
210a849c91Sperseant.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
220a849c91Sperseant.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
230a849c91Sperseant.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
240a849c91Sperseant.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
250a849c91Sperseant.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
260a849c91Sperseant.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
270a849c91Sperseant.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
280a849c91Sperseant.\" SUCH DAMAGE.
290a849c91Sperseant.\"
300a849c91Sperseant.\"     @(#)newlfs.8	8.1 (Berkeley) 6/19/93
310a849c91Sperseant.\"
32*c8459eb5Sdholland.Dd October 13, 2015
337fa66164Sperseant.Dt NEWFS_LFS 8
3473f545bbSwiz.Os
350a849c91Sperseant.Sh NAME
360a849c91Sperseant.Nm newfs_lfs
370a849c91Sperseant.Nd construct a new LFS file system
380a849c91Sperseant.Sh SYNOPSIS
390a849c91Sperseant.Nm
400a849c91Sperseant.Op Ar newfs_lfs-options
410a849c91Sperseant.Ar special
420a849c91Sperseant.Sh DESCRIPTION
430a849c91Sperseant.Nm
440a849c91Sperseantbuilds a log-structured file system on the specified special
450a849c91Sperseantdevice basing its defaults on the information in the disk label.
4643a7fde6SperseantBefore running
470a849c91Sperseant.Nm
480a849c91Sperseantthe disk must be labeled using
4954713442Shubertf.Xr disklabel 8 ,
502fb4b1dbSwizthe proper fstype is 4.4LFS.
512fb4b1dbSwizReasonable values for the
5243a7fde6Sperseant.Li fsize ,
5343a7fde6Sperseant.Li bsize ,
5443a7fde6Sperseantand
558a3e9fdfSperseant.Li sgs
568a3e9fdfSperseantfields are 1024, 8192, and 7 respectively.
570a849c91Sperseant.Pp
580a849c91SperseantThe following options define the general layout policies.
590a849c91Sperseant.Bl -tag -width Fl
608a3e9fdfSperseant.It Fl A
618a3e9fdfSperseantAttempt to compute the appropriate segment size using the formula
6265c4d369Swiz.Em 4 * bandwidth * access time .
6365c4d369SwizThe disk is tested for twenty seconds
648a3e9fdfSperseantto discover its bandwidth and seek time.
653fb18954Senami.It Fl B Ar logical-segment-size
662fb4b1dbSwizThe logical segment size of the file system in bytes.
672fb4b1dbSwizIf not specified, the segment size is computed by left-shifting
682fb4b1dbSwizthe partition label's block size by the amount indicated in the
692fb4b1dbSwizpartition table's segshift.
702fb4b1dbSwizIf the disklabel indicates a zero block size or segment shift,
712fb4b1dbSwiza compile-time default segment size of 1M is used.
720a849c91Sperseant.It Fl b Ar block-size
732fb4b1dbSwizThe block size of the file system in bytes.
742fb4b1dbSwizIf not specified, the block size is taken from the partition label,
752fb4b1dbSwizor if the partition label indicates 0,
762fb4b1dbSwiza compile-time default of 8K is used.
7742bce177Sperseant.It Fl F
7842bce177SperseantForce creation of an LFS even on a partition labeled as another type.
7942bce177Sperseant.Nm
8042bce177Sperseantwill use compile-time default values for block and fragment size, and segment
8142bce177Sperseantshift, unless these are overridden by command-line flags.
827fa66164Sperseant.It Fl f Ar fragment-size
832fb4b1dbSwizThe fragment size of the file system in bytes.
842fb4b1dbSwizIf not specified, the fragment size is taken from the partition label,
852fb4b1dbSwizor if the partition label indicates 0,
862fb4b1dbSwiza compile-time default of 1K is used.
874e3fced9Sperseant.It Fl I Ar interleave
882fb4b1dbSwizSpecify the interleave between segments.
892fb4b1dbSwizThe default is zero.
904e3fced9Sperseant.It Fl i
912fb4b1dbSwizThe size of an inode block, in bytes.
922fb4b1dbSwizThe default is to use the same size as a fragment,
932fb4b1dbSwizor in a v1 filesystem, the same size as a data block.
940a849c91Sperseant.It Fl L
952fb4b1dbSwizCreate a log-structured file system (LFS).
962fb4b1dbSwizThis is the default, and this
977fa66164Sperseantoption is provided for compatibility only.
9848d7c317Sperseant.It Fl M Ar nsegs
99efc48a3bSperseantSpecify
100efc48a3bSperseant.Em lfs_minfreeseg ,
101efc48a3bSperseantthe number of segments left out of the amount allocated to user data.
102efc48a3bSperseantA higher number increases cleaner performance, while a lower number
103efc48a3bSperseantgives more usable space.
104efc48a3bSperseantThe default is based on the size of the filesystem, either 5% of the
105efc48a3bSperseanttotal number of segments or 20 segments, whichever is larger.
1064e3fced9Sperseant.It Fl m Ar free space \&%
1074e3fced9SperseantThe percentage of space reserved from normal users; the minimum
1082fb4b1dbSwizfree space threshold.
1092fb4b1dbSwizThe default value used is 10%.
1107fa66164Sperseant.It Fl N
1117fa66164SperseantDo not actually create the filesystem.
1124e3fced9Sperseant.It Fl O Ar offset
1134e3fced9SperseantStart the first segment this many sectors from the beginning of the
1142fb4b1dbSwizpartition.
1152fb4b1dbSwizThe default is zero.
116efc48a3bSperseant.It Fl R Ar nsegs
117efc48a3bSperseantSpecify
118efc48a3bSperseant.Em lfs_resvseg ,
119efc48a3bSperseantthe number of segments set aside for the exclusive use of the cleaner.
120efc48a3bSperseantA larger figure reduces the likelihood of running out of clean segments,
121efc48a3bSperseantbut if
12232a51b5dSjoerg.Em lfs_resvseg
123efc48a3bSperseantis too close to
124efc48a3bSperseant.Em lfs_minfreeseg ,
125efc48a3bSperseantthe cleaner will run without ceasing when the filesystem becomes close to
12670aff99bSwizfull.
12770aff99bSwizThe default is the larger of 15 or the quantity
128efc48a3bSperseant.Em lfs_minfreeseg
129efc48a3bSperseant/ 2 + 1 .
1304e3fced9Sperseant.It Fl r Ar ident
1314e3fced9SperseantFor a v2 filesystem, specify the roll-forward identifier for the
1322fb4b1dbSwizfilesystem.
1332fb4b1dbSwizThis identifier, a 32-bit numeric quantity,
1344e3fced9Sperseantshould be different from that of any LFS that may previously
1352fb4b1dbSwizhave existed on the same disk.
1362fb4b1dbSwizBy default the identifier is chosen at random.
1370a849c91Sperseant.It Fl s Ar size
1380a849c91SperseantThe size of the file system in sectors.
1394e3fced9Sperseant.It Fl v Ar version
1402fb4b1dbSwizMake a filesystem with the specified disk layout version.
1412fb4b1dbSwizValid options are 1 or 2 (the default).
1420cfa2c53Sperseant.Em Note ,
143*c8459eb5Sdhollandhowever, that LFS version 1 is deprecated, and 64-bit volumes may not
144*c8459eb5Sdhollandbe version 1.
145*c8459eb5Sdholland.It Fl w Ar bitwidth
146*c8459eb5SdhollandCreate a filesystem using the specified bit width: 32 or 64.
147*c8459eb5Sdholland32-bit LFS volumes are limited to 2TB in size; 64-bit LFS volumes are
148*c8459eb5Sdhollandnot, but incur additional overhead from having larger metadata
149*c8459eb5Sdhollandstructures.
150*c8459eb5SdhollandThe default is 32-bit for volumes less than 1 TB, and 64-bit for
151*c8459eb5Sdhollandlarger volumes.
1520a849c91Sperseant.El
1530a849c91Sperseant.Sh SEE ALSO
1540a849c91Sperseant.Xr disktab 5 ,
1557fa66164Sperseant.\" .Xr fs 5 ,
1560a849c91Sperseant.Xr disklabel 8 ,
15739304f2bSwiz.Xr diskpart 8 ,
15839304f2bSwiz.Xr dumplfs 8
1597fa66164Sperseant.\" .Xr tunefs 8
1600a849c91Sperseant.Rs
1617fa66164Sperseant.%A M. Seltzer
1627fa66164Sperseant.%A K. Bostic
1630a849c91Sperseant.%A M. McKusick
1647fa66164Sperseant.%A C. Staelin
1657fa66164Sperseant.%T "An Implementation of a Log-Structured File System for UNIX"
1667fa66164Sperseant.%J "Proceedings of the Winter 1993 USENIX Conference"
1677fa66164Sperseant.%D January 25-29, 1993
1687fa66164Sperseant.%P pp. 315-331
1690a849c91Sperseant.Re
1708a3e9fdfSperseant.Rs
1718a3e9fdfSperseant.%A J. Matthews
1728a3e9fdfSperseant.%A D. Roselli
1738a3e9fdfSperseant.%A A. Costello
1748a3e9fdfSperseant.%A R. Wang
1758a3e9fdfSperseant.%A T. Anderson
1768a3e9fdfSperseant.%T "Improving the Performance of Log-Structured File Systems with Adaptive Methods"
1778a3e9fdfSperseant.%J "Proceedings of the Sixteenth ACM SOSP"
1788a3e9fdfSperseant.%D October 1997
1798a3e9fdfSperseant.Re
1800a849c91Sperseant.Sh HISTORY
18139304f2bSwizA
18239304f2bSwiz.Ic newlfs
1830a849c91Sperseantcommand appeared in
1847fa66164Sperseant.Bx 4.4 ,
1857fa66164Sperseantand was renamed to
1867fa66164Sperseant.Nm
1877fa66164Sperseantfor
1887fa66164Sperseant.Nx 1.4 .
189