Commit | Line | Data |
---|---|---|
70567b1c | 1 | .\" Copyright (c) 1983, 1987, 1991 The Regents of the University of California. |
48609c27 | 2 | .\" All rights reserved. |
4d8369df | 3 | .\" |
f7c99d97 | 4 | .\" %sccs.include.redist.man% |
48609c27 | 5 | .\" |
5a30b417 | 6 | .\" @(#)newfs.8 6.11 (Berkeley) %G% |
4d8369df | 7 | .\" |
70567b1c CL |
8 | .Dd |
9 | .Dt NEWFS 8 | |
10 | .Os BSD 4.2 | |
11 | .Sh NAME | |
12 | .Nm newfs , | |
13 | .Nm mfs | |
14 | .Nd construct a new file system | |
15 | .Sh SYNOPSIS | |
16 | .Nm newfs | |
17 | .Op Fl N | |
18 | .Op Ar newfs-options | |
19 | .Ar special | |
5a30b417 | 20 | .Nm mount_mfs |
70567b1c CL |
21 | .Op Fl F Ar mount_flags |
22 | .Op Ar newfs-options | |
23 | .Ar special node | |
24 | .Sh DESCRIPTION | |
25 | .Nm Newfs | |
d024f4bd | 26 | replaces the more obtuse |
70567b1c | 27 | .Xr mkfs 8 |
4d8369df | 28 | program. |
d024f4bd | 29 | Before running |
70567b1c | 30 | .Nm newfs |
c01742b3 | 31 | or |
5a30b417 | 32 | .Nm mount_mfs , |
d024f4bd | 33 | the disk must be labeled using |
70567b1c CL |
34 | .Xr disklabel 8 . |
35 | .Nm Newfs | |
d024f4bd KM |
36 | builds a file system on the specified special device |
37 | basing its defaults on the information in the disk label. | |
38 | Typically the defaults are reasonable, however | |
70567b1c | 39 | .Nm newfs |
d024f4bd | 40 | has numerous options to allow the defaults to be selectively overridden. |
70567b1c | 41 | .Pp |
5a30b417 | 42 | .Nm Mount_mfs |
c01742b3 KM |
43 | is used to build a file system in virtual memory and then mount it |
44 | on a specified node. | |
5a30b417 | 45 | .Nm Mount_mfs |
c01742b3 KM |
46 | exits and the contents of the file system are lost |
47 | when the file system is unmounted. | |
48 | If | |
5a30b417 | 49 | .Nm mount_mfs |
c01742b3 KM |
50 | is sent a signal while running, |
51 | for example during system shutdown, | |
52 | it will attempt to unmount its | |
53 | corresponding file system. | |
54 | The parameters to | |
5a30b417 | 55 | .Nm mount_mfs |
c01742b3 | 56 | are the same as those to |
70567b1c | 57 | .Nm newfs . |
c01742b3 KM |
58 | The special file is only used to read the disk label which provides |
59 | a set of configuration parameters for the memory based file system. | |
60 | The special file is typically that of the primary swap area, | |
61 | since that is where the file system will be backed up when | |
62 | free memory gets low and the memory supporting | |
63 | the file system has to be paged. | |
70567b1c | 64 | .Pp |
d024f4bd | 65 | The following options define the general layout policies. |
70567b1c CL |
66 | .Bl -tag -width Fl |
67 | .It Fl N | |
68 | Causes the file system parameters to be printed out | |
69 | without really creating the file system. | |
70 | .It Fl b Ar block-size | |
4d8369df | 71 | The block size of the file system in bytes. |
70567b1c | 72 | .It Fl f Ar frag-size |
4d8369df | 73 | The fragment size of the file system in bytes. |
70567b1c | 74 | .It Fl m Ar free space \&% |
4d8369df | 75 | The percentage of space reserved from normal users; the minimum |
d069d05b | 76 | free space threshold. The default value used is 10%. |
39970f0e | 77 | See |
70567b1c | 78 | .Xr tunefs 8 |
39970f0e | 79 | for more details on how to set this option. |
70567b1c CL |
80 | .It Fl o Ar optimization\ preference |
81 | .Pq ``space'' or ``time'' | |
96099622 KM |
82 | The file system can either be instructed to try to minimize the time spent |
83 | allocating blocks, or to try to minimize the space fragmentation on the disk. | |
84 | If the value of minfree (see above) is less than 10%, | |
85 | the default is to optimize for space; | |
86 | if the value of minfree greater than or equal to 10%, | |
87 | the default is to optimize for time. | |
39970f0e | 88 | See |
70567b1c | 89 | .Xr tunefs 8 |
39970f0e | 90 | for more details on how to set this option. |
70567b1c | 91 | .It Fl a Ar maxcontig |
39970f0e | 92 | This specifies the maximum number of contiguous blocks that will |
70567b1c CL |
93 | be laid out before forcing a rotational delay (see |
94 | .Fl d | |
95 | below). | |
39970f0e KM |
96 | The default value is one. |
97 | See | |
70567b1c | 98 | .Xr tunefs 8 |
39970f0e | 99 | for more details on how to set this option. |
70567b1c | 100 | .It Fl d Ar rotdelay |
39970f0e KM |
101 | This specifies the expected time (in milliseconds) |
102 | to service a transfer completion | |
103 | interrupt and initiate a new transfer on the same disk. | |
104 | The default is 4 milliseconds. | |
105 | See | |
70567b1c | 106 | .Xr tunefs 8 |
39970f0e | 107 | for more details on how to set this option. |
70567b1c | 108 | .It Fl e Ar maxbpg |
39970f0e KM |
109 | This indicates the maximum number of blocks any single file can |
110 | allocate out of a cylinder group before it is forced to begin | |
111 | allocating blocks from another cylinder group. | |
112 | The default is about one quarter of the total blocks in a cylinder group. | |
113 | See | |
70567b1c | 114 | .Xr tunefs 8 |
39970f0e | 115 | for more details on how to set this option. |
70567b1c | 116 | .It Fl i Ar number of bytes per inode |
4d8369df KM |
117 | This specifies the density of inodes in the file system. |
118 | The default is to create an inode for each 2048 bytes of data space. | |
119 | If fewer inodes are desired, a larger number should be used; | |
120 | to create more inodes a smaller number should be given. | |
70567b1c | 121 | .It Fl c Ar #cylinders/group |
d024f4bd KM |
122 | The number of cylinders per cylinder group in a file system. |
123 | The default value used is 16. | |
70567b1c | 124 | .It Fl s Ar size |
d024f4bd | 125 | The size of the file system in sectors. |
70567b1c | 126 | .Pp |
d024f4bd KM |
127 | The following options override the standard sizes for the disk geometry. |
128 | Their default values are taken from the disk label. | |
129 | Changing these defaults is useful only when using | |
70567b1c | 130 | .Nm newfs |
d024f4bd KM |
131 | to build a file system whose raw image will eventually be used |
132 | on a different type of disk than the one on which it is initially | |
133 | created (for example on a write-once disk). | |
d069d05b KM |
134 | Note that changing any of these values from their |
135 | defaults will make it impossible for | |
70567b1c | 136 | .Xr fsck |
d069d05b | 137 | to find the alternate superblocks if the standard super block is lost. |
70567b1c | 138 | .It Fl r Ar revolutions/minute |
d024f4bd | 139 | The speed of the disk in revolutions per minute. |
70567b1c | 140 | .It Fl S Ar sector-size |
d024f4bd | 141 | The size of a sector in bytes (almost never anything but 512). |
70567b1c CL |
142 | .It Fl u Ar sectors/track |
143 | The number of sectors per track available for data | |
144 | allocation by the file system. This does not | |
145 | include sectors reserved at the end of each track | |
146 | for bad block replacement (see | |
147 | .Fl p | |
148 | below). | |
149 | .It Fl t Ar #tracks/cylinder | |
d024f4bd KM |
150 | The number of tracks/cylinder available for data |
151 | allocation by the file system. | |
70567b1c | 152 | .It Fl p Ar spare sectors per track |
d024f4bd KM |
153 | Spare sectors (bad sector replacements) are physical sectors |
154 | that occupy space at the end of each track. | |
70567b1c CL |
155 | They are not counted as part of the sectors/track |
156 | .Pq Fl u | |
d024f4bd | 157 | since they are not available to the file system for data allocation. |
70567b1c | 158 | .It Fl x Ar spare sectors per cylinder |
d024f4bd KM |
159 | Spare sectors (bad sector replacements) are physical sectors |
160 | that occupy space at the end of the last track in the cylinder. | |
70567b1c CL |
161 | They are deducted from the sectors/track |
162 | .Pq Fl u | |
d024f4bd KM |
163 | of the last track of each cylinder |
164 | since they are not available to the file system for data allocation. | |
70567b1c | 165 | .It Fl l Ar hardware sector interleave |
d024f4bd KM |
166 | Used to describe perturbations in the media format to |
167 | compensate for a slow controller. | |
168 | Interleave is physical sector interleave on each track, | |
169 | specified as the denominator of the ratio: | |
70567b1c | 170 | .Dl sectors read/sectors passed over |
d024f4bd KM |
171 | Thus an interleave of 1/1 implies contiguous layout, while 1/2 |
172 | implies logical sector 0 is separated by one sector from logical | |
173 | sector 1. | |
70567b1c | 174 | .It Fl k Ar sector \&0 skew , per track |
d024f4bd KM |
175 | Used to describe perturbations in the media format to |
176 | compensate for a slow controller. | |
177 | Track skew is the offset of sector 0 on track N | |
178 | relative to sector 0 on track N-1 on the same cylinder. | |
70567b1c CL |
179 | .Pp |
180 | .El | |
c01742b3 | 181 | The following option applies only to |
5a30b417 | 182 | .Nm mount_mfs . |
70567b1c CL |
183 | .Bl -tag -width Fl |
184 | .It Fl F Ar mount flags | |
c01742b3 KM |
185 | Used to pass in a decimal numeric value to be passed |
186 | as mount flags when running as a memory based file system. | |
187 | This option is primarily intended for use when | |
5a30b417 | 188 | .Nm mount_mfs |
c01742b3 | 189 | is started by the |
70567b1c | 190 | .Xr mount 8 |
c01742b3 | 191 | command. |
70567b1c CL |
192 | .El |
193 | .Sh SEE ALSO | |
194 | .Xr disktab 5 , | |
195 | .Xr fs 5 , | |
196 | .Xr disklabel 8 , | |
197 | .Xr diskpart 8 , | |
198 | .Xr fsck 8 , | |
199 | .Xr format 8 , | |
200 | .Xr tunefs 8 | |
201 | .Rs | |
202 | .%A M. McKusick | |
203 | .%A W. Joy | |
204 | .%A S. Leffler | |
205 | .%A R. Fabry | |
206 | .%T A Fast File System for UNIX , | |
207 | .%J ACM Transactions on Computer Systems 2 | |
208 | .%V 3 | |
209 | .%P pp 181-197 | |
210 | .%D August 1984 | |
211 | .%O (reprinted in the BSD System Manager's Manual) | |
212 | .Re | |
213 | .Sh HISTORY | |
214 | The | |
215 | .Nm | |
216 | command appeared in | |
217 | .Bx 4.2 . |