Commit | Line | Data |
---|---|---|
5f726aec WJ |
1 | .\" Copyright (c) 1983, 1987, 1991 The Regents of the University of California. |
2 | .\" All rights reserved. | |
3 | .\" | |
4 | .\" Redistribution and use in source and binary forms, with or without | |
5 | .\" modification, are permitted provided that the following conditions | |
6 | .\" are met: | |
7 | .\" 1. Redistributions of source code must retain the above copyright | |
8 | .\" notice, this list of conditions and the following disclaimer. | |
9 | .\" 2. Redistributions in binary form must reproduce the above copyright | |
10 | .\" notice, this list of conditions and the following disclaimer in the | |
11 | .\" documentation and/or other materials provided with the distribution. | |
12 | .\" 3. All advertising materials mentioning features or use of this software | |
13 | .\" must display the following acknowledgement: | |
14 | .\" This product includes software developed by the University of | |
15 | .\" California, Berkeley and its contributors. | |
16 | .\" 4. Neither the name of the University nor the names of its contributors | |
17 | .\" may be used to endorse or promote products derived from this software | |
18 | .\" without specific prior written permission. | |
19 | .\" | |
20 | .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | |
21 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
22 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
23 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
24 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
25 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
26 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
27 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
28 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
30 | .\" SUCH DAMAGE. | |
31 | .\" | |
32 | .\" @(#)newfs.8 6.10 (Berkeley) 3/16/91 | |
33 | .\" | |
34 | .Dd March 16, 1991 | |
35 | .Dt NEWFS 8 | |
36 | .Os BSD 4.2 | |
37 | .Sh NAME | |
38 | .Nm newfs , | |
39 | .Nm mfs | |
40 | .Nd construct a new file system | |
41 | .Sh SYNOPSIS | |
42 | .Nm newfs | |
43 | .Op Fl N | |
44 | .Op Ar newfs-options | |
45 | .Ar special | |
46 | .Nm mfs | |
47 | .Op Fl F Ar mount_flags | |
48 | .Op Ar newfs-options | |
49 | .Ar special node | |
50 | .Sh DESCRIPTION | |
51 | .Nm Newfs | |
52 | replaces the more obtuse | |
53 | .Xr mkfs 8 | |
54 | program. | |
55 | Before running | |
56 | .Nm newfs | |
57 | or | |
58 | .Nm mfs , | |
59 | the disk must be labeled using | |
60 | .Xr disklabel 8 . | |
61 | .Nm Newfs | |
62 | builds a file system on the specified special device | |
63 | basing its defaults on the information in the disk label. | |
64 | Typically the defaults are reasonable, however | |
65 | .Nm newfs | |
66 | has numerous options to allow the defaults to be selectively overridden. | |
67 | .Pp | |
68 | .Nm Mfs | |
69 | is used to build a file system in virtual memory and then mount it | |
70 | on a specified node. | |
71 | .Nm Mfs | |
72 | exits and the contents of the file system are lost | |
73 | when the file system is unmounted. | |
74 | If | |
75 | .Nm mfs | |
76 | is sent a signal while running, | |
77 | for example during system shutdown, | |
78 | it will attempt to unmount its | |
79 | corresponding file system. | |
80 | The parameters to | |
81 | .Nm mfs | |
82 | are the same as those to | |
83 | .Nm newfs . | |
84 | The special file is only used to read the disk label which provides | |
85 | a set of configuration parameters for the memory based file system. | |
86 | The special file is typically that of the primary swap area, | |
87 | since that is where the file system will be backed up when | |
88 | free memory gets low and the memory supporting | |
89 | the file system has to be paged. | |
90 | .Pp | |
91 | The following options define the general layout policies. | |
92 | .Bl -tag -width Fl | |
93 | .It Fl N | |
94 | Causes the file system parameters to be printed out | |
95 | without really creating the file system. | |
96 | .It Fl b Ar block-size | |
97 | The block size of the file system in bytes. | |
98 | .It Fl f Ar frag-size | |
99 | The fragment size of the file system in bytes. | |
100 | .It Fl m Ar free space \&% | |
101 | The percentage of space reserved from normal users; the minimum | |
102 | free space threshold. The default value used is 10%. | |
103 | See | |
104 | .Xr tunefs 8 | |
105 | for more details on how to set this option. | |
106 | .It Fl o Ar optimization\ preference | |
107 | .Pq ``space'' or ``time'' | |
108 | The file system can either be instructed to try to minimize the time spent | |
109 | allocating blocks, or to try to minimize the space fragmentation on the disk. | |
110 | If the value of minfree (see above) is less than 10%, | |
111 | the default is to optimize for space; | |
112 | if the value of minfree greater than or equal to 10%, | |
113 | the default is to optimize for time. | |
114 | See | |
115 | .Xr tunefs 8 | |
116 | for more details on how to set this option. | |
117 | .It Fl a Ar maxcontig | |
118 | This specifies the maximum number of contiguous blocks that will | |
119 | be laid out before forcing a rotational delay (see | |
120 | .Fl d | |
121 | below). | |
122 | The default value is one. | |
123 | See | |
124 | .Xr tunefs 8 | |
125 | for more details on how to set this option. | |
126 | .It Fl d Ar rotdelay | |
127 | This specifies the expected time (in milliseconds) | |
128 | to service a transfer completion | |
129 | interrupt and initiate a new transfer on the same disk. | |
130 | The default is 4 milliseconds. | |
131 | See | |
132 | .Xr tunefs 8 | |
133 | for more details on how to set this option. | |
134 | .It Fl e Ar maxbpg | |
135 | This indicates the maximum number of blocks any single file can | |
136 | allocate out of a cylinder group before it is forced to begin | |
137 | allocating blocks from another cylinder group. | |
138 | The default is about one quarter of the total blocks in a cylinder group. | |
139 | See | |
140 | .Xr tunefs 8 | |
141 | for more details on how to set this option. | |
142 | .It Fl i Ar number of bytes per inode | |
143 | This specifies the density of inodes in the file system. | |
144 | The default is to create an inode for each 2048 bytes of data space. | |
145 | If fewer inodes are desired, a larger number should be used; | |
146 | to create more inodes a smaller number should be given. | |
147 | .It Fl c Ar #cylinders/group | |
148 | The number of cylinders per cylinder group in a file system. | |
149 | The default value used is 16. | |
150 | .It Fl s Ar size | |
151 | The size of the file system in sectors. | |
152 | .Pp | |
153 | The following options override the standard sizes for the disk geometry. | |
154 | Their default values are taken from the disk label. | |
155 | Changing these defaults is useful only when using | |
156 | .Nm newfs | |
157 | to build a file system whose raw image will eventually be used | |
158 | on a different type of disk than the one on which it is initially | |
159 | created (for example on a write-once disk). | |
160 | Note that changing any of these values from their | |
161 | defaults will make it impossible for | |
162 | .Xr fsck | |
163 | to find the alternate superblocks if the standard super block is lost. | |
164 | .It Fl r Ar revolutions/minute | |
165 | The speed of the disk in revolutions per minute. | |
166 | .It Fl S Ar sector-size | |
167 | The size of a sector in bytes (almost never anything but 512). | |
168 | .It Fl u Ar sectors/track | |
169 | The number of sectors per track available for data | |
170 | allocation by the file system. This does not | |
171 | include sectors reserved at the end of each track | |
172 | for bad block replacement (see | |
173 | .Fl p | |
174 | below). | |
175 | .It Fl t Ar #tracks/cylinder | |
176 | The number of tracks/cylinder available for data | |
177 | allocation by the file system. | |
178 | .It Fl p Ar spare sectors per track | |
179 | Spare sectors (bad sector replacements) are physical sectors | |
180 | that occupy space at the end of each track. | |
181 | They are not counted as part of the sectors/track | |
182 | .Pq Fl u | |
183 | since they are not available to the file system for data allocation. | |
184 | .It Fl x Ar spare sectors per cylinder | |
185 | Spare sectors (bad sector replacements) are physical sectors | |
186 | that occupy space at the end of the last track in the cylinder. | |
187 | They are deducted from the sectors/track | |
188 | .Pq Fl u | |
189 | of the last track of each cylinder | |
190 | since they are not available to the file system for data allocation. | |
191 | .It Fl l Ar hardware sector interleave | |
192 | Used to describe perturbations in the media format to | |
193 | compensate for a slow controller. | |
194 | Interleave is physical sector interleave on each track, | |
195 | specified as the denominator of the ratio: | |
196 | .Dl sectors read/sectors passed over | |
197 | Thus an interleave of 1/1 implies contiguous layout, while 1/2 | |
198 | implies logical sector 0 is separated by one sector from logical | |
199 | sector 1. | |
200 | .It Fl k Ar sector \&0 skew , per track | |
201 | Used to describe perturbations in the media format to | |
202 | compensate for a slow controller. | |
203 | Track skew is the offset of sector 0 on track N | |
204 | relative to sector 0 on track N-1 on the same cylinder. | |
205 | .Pp | |
206 | .El | |
207 | The following option applies only to | |
208 | .Nm mfs . | |
209 | .Bl -tag -width Fl | |
210 | .It Fl F Ar mount flags | |
211 | Used to pass in a decimal numeric value to be passed | |
212 | as mount flags when running as a memory based file system. | |
213 | This option is primarily intended for use when | |
214 | .Nm mfs | |
215 | is started by the | |
216 | .Xr mount 8 | |
217 | command. | |
218 | .El | |
219 | .Sh SEE ALSO | |
220 | .Xr disktab 5 , | |
221 | .Xr fs 5 , | |
222 | .Xr disklabel 8 , | |
223 | .Xr diskpart 8 , | |
224 | .Xr fsck 8 , | |
225 | .Xr format 8 , | |
226 | .Xr tunefs 8 | |
227 | .Rs | |
228 | .%A M. McKusick | |
229 | .%A W. Joy | |
230 | .%A S. Leffler | |
231 | .%A R. Fabry | |
232 | .%T A Fast File System for UNIX , | |
233 | .%J ACM Transactions on Computer Systems 2 | |
234 | .%V 3 | |
235 | .%P pp 181-197 | |
236 | .%D August 1984 | |
237 | .%O (reprinted in the BSD System Manager's Manual) | |
238 | .Re | |
239 | .Sh HISTORY | |
240 | The | |
241 | .Nm | |
242 | command appeared in | |
243 | .Bx 4.2 . |