| 1 | .\" Copyright (c) 1983, 1987, 1991 The Regents of the University of California. |
| 2 | .\" All rights reserved. |
| 3 | .\" |
| 4 | .\" %sccs.include.redist.man% |
| 5 | .\" |
| 6 | .\" @(#)newfs.8 6.11 (Berkeley) %G% |
| 7 | .\" |
| 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 |
| 20 | .Nm mount_mfs |
| 21 | .Op Fl F Ar mount_flags |
| 22 | .Op Ar newfs-options |
| 23 | .Ar special node |
| 24 | .Sh DESCRIPTION |
| 25 | .Nm Newfs |
| 26 | replaces the more obtuse |
| 27 | .Xr mkfs 8 |
| 28 | program. |
| 29 | Before running |
| 30 | .Nm newfs |
| 31 | or |
| 32 | .Nm mount_mfs , |
| 33 | the disk must be labeled using |
| 34 | .Xr disklabel 8 . |
| 35 | .Nm Newfs |
| 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 |
| 39 | .Nm newfs |
| 40 | has numerous options to allow the defaults to be selectively overridden. |
| 41 | .Pp |
| 42 | .Nm Mount_mfs |
| 43 | is used to build a file system in virtual memory and then mount it |
| 44 | on a specified node. |
| 45 | .Nm Mount_mfs |
| 46 | exits and the contents of the file system are lost |
| 47 | when the file system is unmounted. |
| 48 | If |
| 49 | .Nm mount_mfs |
| 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 |
| 55 | .Nm mount_mfs |
| 56 | are the same as those to |
| 57 | .Nm newfs . |
| 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. |
| 64 | .Pp |
| 65 | The following options define the general layout policies. |
| 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 |
| 71 | The block size of the file system in bytes. |
| 72 | .It Fl f Ar frag-size |
| 73 | The fragment size of the file system in bytes. |
| 74 | .It Fl m Ar free space \&% |
| 75 | The percentage of space reserved from normal users; the minimum |
| 76 | free space threshold. The default value used is 10%. |
| 77 | See |
| 78 | .Xr tunefs 8 |
| 79 | for more details on how to set this option. |
| 80 | .It Fl o Ar optimization\ preference |
| 81 | .Pq ``space'' or ``time'' |
| 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. |
| 88 | See |
| 89 | .Xr tunefs 8 |
| 90 | for more details on how to set this option. |
| 91 | .It Fl a Ar maxcontig |
| 92 | This specifies the maximum number of contiguous blocks that will |
| 93 | be laid out before forcing a rotational delay (see |
| 94 | .Fl d |
| 95 | below). |
| 96 | The default value is one. |
| 97 | See |
| 98 | .Xr tunefs 8 |
| 99 | for more details on how to set this option. |
| 100 | .It Fl d Ar rotdelay |
| 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 |
| 106 | .Xr tunefs 8 |
| 107 | for more details on how to set this option. |
| 108 | .It Fl e Ar maxbpg |
| 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 |
| 114 | .Xr tunefs 8 |
| 115 | for more details on how to set this option. |
| 116 | .It Fl i Ar number of bytes per inode |
| 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. |
| 121 | .It Fl c Ar #cylinders/group |
| 122 | The number of cylinders per cylinder group in a file system. |
| 123 | The default value used is 16. |
| 124 | .It Fl s Ar size |
| 125 | The size of the file system in sectors. |
| 126 | .Pp |
| 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 |
| 130 | .Nm newfs |
| 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). |
| 134 | Note that changing any of these values from their |
| 135 | defaults will make it impossible for |
| 136 | .Xr fsck |
| 137 | to find the alternate superblocks if the standard super block is lost. |
| 138 | .It Fl r Ar revolutions/minute |
| 139 | The speed of the disk in revolutions per minute. |
| 140 | .It Fl S Ar sector-size |
| 141 | The size of a sector in bytes (almost never anything but 512). |
| 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 |
| 150 | The number of tracks/cylinder available for data |
| 151 | allocation by the file system. |
| 152 | .It Fl p Ar spare sectors per track |
| 153 | Spare sectors (bad sector replacements) are physical sectors |
| 154 | that occupy space at the end of each track. |
| 155 | They are not counted as part of the sectors/track |
| 156 | .Pq Fl u |
| 157 | since they are not available to the file system for data allocation. |
| 158 | .It Fl x Ar spare sectors per cylinder |
| 159 | Spare sectors (bad sector replacements) are physical sectors |
| 160 | that occupy space at the end of the last track in the cylinder. |
| 161 | They are deducted from the sectors/track |
| 162 | .Pq Fl u |
| 163 | of the last track of each cylinder |
| 164 | since they are not available to the file system for data allocation. |
| 165 | .It Fl l Ar hardware sector interleave |
| 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: |
| 170 | .Dl sectors read/sectors passed over |
| 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. |
| 174 | .It Fl k Ar sector \&0 skew , per track |
| 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. |
| 179 | .Pp |
| 180 | .El |
| 181 | The following option applies only to |
| 182 | .Nm mount_mfs . |
| 183 | .Bl -tag -width Fl |
| 184 | .It Fl F Ar mount flags |
| 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 |
| 188 | .Nm mount_mfs |
| 189 | is started by the |
| 190 | .Xr mount 8 |
| 191 | command. |
| 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 . |