teach manpages about largefile's demise
[unleashed.git] / share / man / man8 / newfs.8
blob6de77d9ed0a0a3cf03959350d006ee25795a13d1
1 .\"
2 .\" The Berkeley software License Agreement specifies the terms and conditions
3 .\" for redistribution.
4 .\"
5 .\"
6 .\" Copyright (c) 1983 Regents of the University of California.
7 .\" All rights reserved.
8 .\" Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved
9 .\"
10 .TH NEWFS 8 "Oct 8, 2016"
11 .SH NAME
12 newfs \- construct a UFS file system
13 .SH SYNOPSIS
14 .LP
15 .nf
16 \fBnewfs\fR [\fB-NSBTv\fR] [\fImkfs-options\fR] \fIraw-device\fR
17 .fi
19 .SH DESCRIPTION
20 .LP
21 \fBnewfs\fR is a "friendly" front-end to the \fBmkfs\fR(8) program for making
22 \fBUFS\fR file systems on disk partitions. \fBnewfs\fR calculates the
23 appropriate parameters to use and calls \fBmkfs\fR.
24 .sp
25 .LP
26 If run interactively (that is, standard input is a tty), \fBnewfs\fR prompts
27 for confirmation before making the file system.
28 .sp
29 .LP
30 If the \fB-N\fR option is not specified and the inodes of the device are not
31 randomized, \fBnewfs\fR calls \fBfsirand\fR(8).
32 .sp
33 .LP
34 You must be super-user or have appropriate write privileges to use this
35 command, except when creating a \fBUFS\fR file system on a \fIdiskette\fR. See
36 \fBEXAMPLES\fR.
37 .SS "Creating a Multiterabyte UFS File System"
38 .LP
39 Keep the following limitations in mind when creating a multiterabyte UFS file
40 system:
41 .RS +4
42 .TP
43 .ie t \(bu
44 .el o
45 \fInbpi\fR is set to 1 Mbyte unless you specifically set it higher. You cannot
46 set \fInbpi\fR lower than 1 Mbyte on a multiterabyte UFS file system.
47 .RE
48 .RS +4
49 .TP
50 .ie t \(bu
51 .el o
52 \fIfragsize\fR is set equal to \fIbsize\fR.
53 .RE
54 .SH OPTIONS
55 .LP
56 The following options are supported:
57 .sp
58 .ne 2
59 .na
60 \fB\fB-N\fR\fR
61 .ad
62 .sp .6
63 .RS 4n
64 Print out the file system parameters that would be used to create the file
65 system without actually creating the file system. \fBfsirand\fR(8) is not
66 called here.
67 .RE
69 .sp
70 .ne 2
71 .na
72 \fB\fB-S\fR\fR
73 .ad
74 .sp .6
75 .RS 4n
76 Sends to stdout a human-readable version of the superblock that would be used
77 to create a filesystem with the specified configuration parameters.
78 .RE
80 .sp
81 .ne 2
82 .na
83 \fB\fB-B\fR\fR
84 .ad
85 .sp .6
86 .RS 4n
87 Sends to stdout a binary (machine-readable) version of the superblock that
88 would be used to create a filesystem with the specified configuration
89 parameters.
90 .RE
92 .sp
93 .ne 2
94 .na
95 \fB\fB-T\fR\fR
96 .ad
97 .sp .6
98 .RS 4n
99 Set the parameters of the file system to allow eventual growth to over a
100 terabyte in total file system size. This option sets \fIfragsize\fR to be the
101 same as \fIbsize\fR, and sets \fInbpi\fR to 1 Mbyte, unless the \fB-i\fR option
102 is used to make it even larger. If you use the \fB-f\fR or \fB-i\fR options to
103 specify a \fIfragsize\fR or \fInbpi\fR that is incompatible with this option,
104 the user-supplied value of \fIfragsize\fR or \fInbpi\fR is ignored.
108 .ne 2
110 \fB\fB-v\fR\fR
112 .sp .6
113 .RS 4n
114 Verbose. \fBnewfs\fR prints out its actions, including the parameters passed to
115 \fBmkfs\fR.
119 .ne 2
121 \fB\fImkfs-options\fR\fR
123 .sp .6
124 .RS 4n
125 Options that override the default parameters are:
127 .ne 2
129 \fB\fB-a\fR \fIapc\fR\fR
131 .sp .6
132 .RS 4n
133 The number of alternate sectors per cylinder to reserve for bad block
134 replacement for SCSI devices only. The default is \fB0\fR.
136 This option is not applicable for disks with EFI labels and is ignored.
140 .ne 2
142 \fB\fB-b\fR \fIbsize\fR\fR
144 .sp .6
145 .RS 4n
146 The logical block size of the file system in bytes, either 4096 or 8192. The
147 default is \fB8192\fR. The sun4u architecture does not support the \fB4096\fR
148 block size.
152 .ne 2
154 \fB\fB-c\fR \fIcgsize\fR\fR
156 .sp .6
157 .RS 4n
158 The number of cylinders per cylinder group, ranging from \fB16\fR to \fB256\fR.
159 The default is calculated by dividing the number of sectors in the file system
160 by the number of sectors in a gigabyte. Then, the result is multiplied by
161 \fB32\fR. The default value is always between \fB16\fR and \fB256\fR.
163 \fBmkfs\fR can override this value. See \fBmkfs_ufs\fR(8) for details.
165 This option is not applicable for disks with EFI labels and is ignored.
169 .ne 2
171 \fB\fB-C\fR \fImaxcontig\fR\fR
173 .sp .6
174 .RS 4n
175 The maximum number of logical blocks, belonging to one file, that are allocated
176 contiguously. The default is calculated as follows:
178 .in +2
180 \fBmaxcontig =\fR \fIdisk drive maximum transfer size / disk block size\fR
182 .in -2
185 If the disk drive's maximum transfer size cannot be determined, the default
186 value for \fBmaxcontig\fR is calculated from kernel parameters as follows:
188 If \fBmaxphys\fR is less than \fBufs_maxmaxphys\fR, which is typically 1 Mbyte,
189 then \fBmaxcontig\fR is set to \fBmaxphys\fR. Otherwise, \fBmaxcontig\fR is set
190 to \fBufs_maxmaxphys\fR.
192 You can set \fBmaxcontig\fR to any positive integer value.
194 The actual value will be the lesser of what has been specified and what the
195 hardware supports.
197 You can subsequently change this parameter by using \fBtunefs\fR(8).
201 .ne 2
203 \fB\fB-d\fR \fIgap\fR\fR
205 .sp .6
206 .RS 4n
207 Rotational delay. This option is obsolete in the Solaris 10 release. The value
208 is always set to \fB0\fR, regardless of the input value.
212 .ne 2
214 \fB\fB-f\fR \fIfragsize\fR\fR
216 .sp .6
217 .RS 4n
218 The smallest amount of disk space in bytes that can be allocated to a file.
219 \fBfragsize\fR must be a power of 2 divisor of \fBbsize\fR, where:
221 \fBbsize\fR / \fBfragsize\fR is 1, 2, 4, or 8.
223 This means that if the logical block size is \fB4096\fR, legal values for
224 \fBfragsize\fR are \fB512\fR, \fB1024\fR, \fB2048\fR, and \fB4096\fR. When the
225 logical block size is \fB8192\fR, legal values are \fB1024\fR, \fB2048\fR,
226 \fB4096\fR, and \fB8192\fR. The default value is \fB1024\fR.
228 For file systems greater than 1 terabyte or for file systems created with the
229 \fB-T\fR option, \fBfragsize\fR is forced to match block size (\fBbsize\fR).
233 .ne 2
235 \fB\fB-i\fR \fInbpi\fR\fR
237 .sp .6
238 .RS 4n
239 The number of bytes per inode, which specifies the density of inodes in the
240 file system. The number is divided into the total size of the file system to
241 determine the number of inodes to create.
243 This value should reflect the expected average size of files in the file
244 system. If fewer inodes are desired, a larger number should be used. To create
245 more inodes, a smaller number should be given. The default for \fInbpi\fR is as
246 follows:
248 .in +2
250 Disk size                 Density
252 Less than 1GB             2048
253 Less than 2GB             4096
254 Less than 3GB             6144
255 3GB to 1 Tbyte            8192
256 Greater than 1 Tbyte
257    or created with -T     1048576
259 .in -2
264 .ne 2
266 \fB\fB-m\fR \fIfree\fR\fR
268 .sp .6
269 .RS 4n
270 The minimum percentage of free space to maintain in the file system, between 0%
271 and 99%, inclusively. This space is off-limits to users. Once the file system
272 is filled to this threshold, only the super-user can continue writing to the
273 file system.
275 The default is ((64 Mbytes/partition size) * 100), rounded down to the nearest
276 integer and limited between 1% and 10%, inclusively.
278 This parameter can be subsequently changed using the \fBtunefs\fR(8) command.
282 .ne 2
284 \fB\fB-n\fR \fInrpos\fR\fR
286 .sp .6
287 .RS 4n
288 The number of different rotational positions in which to divide a cylinder
289 group. The default is \fB8\fR.
291 This option is not applicable for disks with EFI labels and is ignored.
295 .ne 2
297 \fB\fB-o\fR \fIspace\fR\||\|\fItime\fR\fR
299 .sp .6
300 .RS 4n
301 The file system can either be instructed to try to minimize the \fBtime\fR
302 spent allocating blocks, or to try to minimize the \fBspace\fR fragmentation on
303 the disk. The default is \fItime\fR.
305 This parameter can subsequently be changed with the \fBtunefs\fR(8) command.
309 .ne 2
311 \fB\fB-r\fR \fIrpm\fR\fR
313 .sp .6
314 .RS 4n
315 The rotational speed of the disk in revolutions per minute. The default is
316 driver- or device-specific.
318 Note that you specify \fIrpm\fR for \fBnewfs\fR and \fIrps\fR for \fBmkfs\fR.
320 This option is not applicable for disks with EFI labels and is ignored.
324 .ne 2
326 \fB\fB-s\fR \fIsize\fR\fR
328 .sp .6
329 .RS 4n
330 The size of the file system in sectors. The default is to use the entire
331 partition.
335 .ne 2
337 \fB\fB-t\fR \fIntrack\fR\fR
339 .sp .6
340 .RS 4n
341 The number of tracks per cylinder on the disk. The default is taken from the
342 disk label.
344 This option is not applicable for disks with EFI labels and is ignored.
349 .SH OPERANDS
351 The following operands are supported:
353 .ne 2
355 \fB\fIraw-device\fR\fR
357 .sp .6
358 .RS 4n
359 The name of a raw special device residing in the \fB/dev\fR directory (for
360 example, \fB/dev/rdsk/c0t0d0s6\fR) on which to create the file system.
363 .SH EXAMPLES
365 \fBExample 1 \fRDisplaying the Parameters for the Raw Special Device
368 The following example verbosely displays the parameters for the raw special
369 device, \fBc0t0d0s6\fR. It does not actually create a new file system:
372 .in +2
374 example# newfs \fB-Nv\fR /dev/rdsk/c0t0d0s6
375 mkfs \fB-F\fR ufs \fB-o\fR N /dev/rdsk/c0t0d0s6 1112940 54 15 8192 1024 16 10 60
376 2048 t 0 \(mi1 8 /dev/rdsk/c0t0d0s6: 1112940 sectors in
377 1374 cylinders of 15 tracks, 54 sectors 569.8MB in 86 cyl
378 groups (16 c/g, 6.64MB/g, 3072 i/g) super-block backups
379 (for fsck \fB-b\fR #) at:
380 32, 13056, 26080, 39104, 52128, 65152, 78176, 91200, 104224, .\|.\|.
382 .in -2
386 \fBExample 2 \fRCreating a \fBUFS\fR File System
389 The following example creates a \fBUFS\fR file system on a diskette that is
390 managed by a volume manager that makes use of the mount point \fB/vol\fR.
393 .in +2
395 example% newfs /vol/dev/aliases/floppy0
396 newfs: construct a new file system /vol/dev/aliases/floppy0: (y/n)? y
397 /vol/dev/aliases/floppy0: 2880 sectors in 80 cylinders of 2 tracks,
398 18 sectors 1.4MB in 5 cyl groups (16 c/g, 0.28MB/g, 128 i/g)
399 super-block backups (for fsck \fB-F\fR ufs \fB-o\fR b=#) at:
400 32, 640, 1184, 1792, 2336, .\|.\|.
402 .in -2
403 .SH EXIT STATUS
405 The following exit values are returned:
407 .ne 2
409 \fB\fB0\fR\fR
411 .sp .6
412 .RS 4n
413 The operation was successful.
417 .ne 2
419 \fB\fB1\fR, \fB10\fR\fR
421 .sp .6
422 .RS 4n
423 Usage error or internal error. A message is output to \fBSTDERR\fR explaining
424 the error.
429 Other exit values may be returned by \fBmkfs\fR(8), which is called by
430 \fBnewfs\fR.
431 .SH SEE ALSO
433 \fBfsck\fR(8), \fBfsck_ufs\fR(8), \fBfsirand\fR(8), \fBmkfs\fR(8),
434 \fBmkfs_ufs\fR(8), \fBtunefs\fR(8), \fBattributes\fR(5),
435 \fBufs\fR(7FS)
436 .SH DIAGNOSTICS
437 .ne 2
439 \fB\fBnewfs: No such file or directory\fR\fR
441 .sp .6
442 .RS 4n
443 The device specified does not exist, or a disk partition was not specified.
447 .ne 2
449 \fB\fIspecial\fR\fB: cannot open\fR\fR
451 .sp .6
452 .RS 4n
453 You must write access to the device to use this command.