6324 Add an `ndp' tool for manipulating the neighbors table
[illumos-gate.git] / usr / src / man / man1m / newfs.1m
bloba3d4cf4c244ebaf4c97f01480dc2496dce860be5
1 '\" te
2 .\"  Copyright (c) 1983 Regents of the University of California. All rights reserved. The Berkeley software License Agreement specifies the terms and conditions for redistribution. Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved
3 .TH NEWFS 1M "Mar 1, 2007"
4 .SH NAME
5 newfs \- construct a UFS file system
6 .SH SYNOPSIS
7 .LP
8 .nf
9 \fBnewfs\fR [\fB-NSBTv\fR] [\fImkfs-options\fR] \fIraw-device\fR
10 .fi
12 .SH DESCRIPTION
13 .sp
14 .LP
15 \fBnewfs\fR is a "friendly" front-end to the \fBmkfs\fR(1M) program for making
16 \fBUFS\fR file systems on disk partitions. \fBnewfs\fR calculates the
17 appropriate parameters to use and calls \fBmkfs\fR.
18 .sp
19 .LP
20 If run interactively (that is, standard input is a tty), \fBnewfs\fR prompts
21 for confirmation before making the file system.
22 .sp
23 .LP
24 If the \fB-N\fR option is not specified and the inodes of the device are not
25 randomized, \fBnewfs\fR calls \fBfsirand\fR(1M).
26 .sp
27 .LP
28 You must be super-user or have appropriate write privileges to use this
29 command, except when creating a \fBUFS\fR file system on a \fIdiskette\fR. See
30 \fBEXAMPLES\fR.
31 .SS "Creating a Multiterabyte UFS File System"
32 .sp
33 .LP
34 Keep the following limitations in mind when creating a multiterabyte UFS file
35 system:
36 .RS +4
37 .TP
38 .ie t \(bu
39 .el o
40 \fInbpi\fR is set to 1 Mbyte unless you specifically set it higher. You cannot
41 set \fInbpi\fR lower than 1 Mbyte on a multiterabyte UFS file system.
42 .RE
43 .RS +4
44 .TP
45 .ie t \(bu
46 .el o
47 \fIfragsize\fR is set equal to \fIbsize\fR.
48 .RE
49 .SH OPTIONS
50 .sp
51 .LP
52 The following options are supported:
53 .sp
54 .ne 2
55 .na
56 \fB\fB-N\fR\fR
57 .ad
58 .sp .6
59 .RS 4n
60 Print out the file system parameters that would be used to create the file
61 system without actually creating the file system. \fBfsirand\fR(1M) is not
62 called here.
63 .RE
65 .sp
66 .ne 2
67 .na
68 \fB\fB-S\fR\fR
69 .ad
70 .sp .6
71 .RS 4n
72 Sends to stdout a human-readable version of the superblock that would be used
73 to create a filesystem with the specified configuration parameters.
74 .RE
76 .sp
77 .ne 2
78 .na
79 \fB\fB-B\fR\fR
80 .ad
81 .sp .6
82 .RS 4n
83 Sends to stdout a binary (machine-readable) version of the superblock that
84 would be used to create a filesystem with the specified configuration
85 parameters.
86 .RE
88 .sp
89 .ne 2
90 .na
91 \fB\fB-T\fR\fR
92 .ad
93 .sp .6
94 .RS 4n
95 Set the parameters of the file system to allow eventual growth to over a
96 terabyte in total file system size. This option sets \fIfragsize\fR to be the
97 same as \fIbsize\fR, and sets \fInbpi\fR to 1 Mbyte, unless the \fB-i\fR option
98 is used to make it even larger. If you use the \fB-f\fR or \fB-i\fR options to
99 specify a \fIfragsize\fR or \fInbpi\fR that is incompatible with this option,
100 the user-supplied value of \fIfragsize\fR or \fInbpi\fR is ignored.
104 .ne 2
106 \fB\fB-v\fR\fR
108 .sp .6
109 .RS 4n
110 Verbose. \fBnewfs\fR prints out its actions, including the parameters passed to
111 \fBmkfs\fR.
115 .ne 2
117 \fB\fImkfs-options\fR\fR
119 .sp .6
120 .RS 4n
121 Options that override the default parameters are:
123 .ne 2
125 \fB\fB-a\fR \fIapc\fR\fR
127 .sp .6
128 .RS 4n
129 The number of alternate sectors per cylinder to reserve for bad block
130 replacement for SCSI devices only. The default is \fB0\fR.
132 This option is not applicable for disks with EFI labels and is ignored.
136 .ne 2
138 \fB\fB-b\fR \fIbsize\fR\fR
140 .sp .6
141 .RS 4n
142 The logical block size of the file system in bytes, either 4096 or 8192. The
143 default is \fB8192\fR. The sun4u architecture does not support the \fB4096\fR
144 block size.
148 .ne 2
150 \fB\fB-c\fR \fIcgsize\fR\fR
152 .sp .6
153 .RS 4n
154 The number of cylinders per cylinder group, ranging from \fB16\fR to \fB256\fR.
155 The default is calculated by dividing the number of sectors in the file system
156 by the number of sectors in a gigabyte. Then, the result is multiplied by
157 \fB32\fR. The default value is always between \fB16\fR and \fB256\fR.
159 \fBmkfs\fR can override this value. See \fBmkfs_ufs\fR(1M) for details.
161 This option is not applicable for disks with EFI labels and is ignored.
165 .ne 2
167 \fB\fB-C\fR \fImaxcontig\fR\fR
169 .sp .6
170 .RS 4n
171 The maximum number of logical blocks, belonging to one file, that are allocated
172 contiguously. The default is calculated as follows:
174 .in +2
176 \fBmaxcontig =\fR \fIdisk drive maximum transfer size / disk block size\fR
178 .in -2
181 If the disk drive's maximum transfer size cannot be determined, the default
182 value for \fBmaxcontig\fR is calculated from kernel parameters as follows:
184 If \fBmaxphys\fR is less than \fBufs_maxmaxphys\fR, which is typically 1 Mbyte,
185 then \fBmaxcontig\fR is set to \fBmaxphys\fR. Otherwise, \fBmaxcontig\fR is set
186 to \fBufs_maxmaxphys\fR.
188 You can set \fBmaxcontig\fR to any positive integer value.
190 The actual value will be the lesser of what has been specified and what the
191 hardware supports.
193 You can subsequently change this parameter by using \fBtunefs\fR(1M).
197 .ne 2
199 \fB\fB-d\fR \fIgap\fR\fR
201 .sp .6
202 .RS 4n
203 Rotational delay. This option is obsolete in the Solaris 10 release. The value
204 is always set to \fB0\fR, regardless of the input value.
208 .ne 2
210 \fB\fB-f\fR \fIfragsize\fR\fR
212 .sp .6
213 .RS 4n
214 The smallest amount of disk space in bytes that can be allocated to a file.
215 \fBfragsize\fR must be a power of 2 divisor of \fBbsize\fR, where:
217 \fBbsize\fR / \fBfragsize\fR is 1, 2, 4, or 8.
219 This means that if the logical block size is \fB4096\fR, legal values for
220 \fBfragsize\fR are \fB512\fR, \fB1024\fR, \fB2048\fR, and \fB4096\fR. When the
221 logical block size is \fB8192\fR, legal values are \fB1024\fR, \fB2048\fR,
222 \fB4096\fR, and \fB8192\fR. The default value is \fB1024\fR.
224 For file systems greater than 1 terabyte or for file systems created with the
225 \fB-T\fR option, \fBfragsize\fR is forced to match block size (\fBbsize\fR).
229 .ne 2
231 \fB\fB-i\fR \fInbpi\fR\fR
233 .sp .6
234 .RS 4n
235 The number of bytes per inode, which specifies the density of inodes in the
236 file system. The number is divided into the total size of the file system to
237 determine the number of inodes to create.
239 This value should reflect the expected average size of files in the file
240 system. If fewer inodes are desired, a larger number should be used. To create
241 more inodes, a smaller number should be given. The default for \fInbpi\fR is as
242 follows:
244 .in +2
246 Disk size                 Density
248 Less than 1GB             2048
249 Less than 2GB             4096
250 Less than 3GB             6144
251 3GB to 1 Tbyte            8192
252 Greater than 1 Tbyte
253    or created with -T     1048576
255 .in -2
258 The number of inodes can increase if the file system is expanded with the
259 \fBgrowfs\fR command.
263 .ne 2
265 \fB\fB-m\fR \fIfree\fR\fR
267 .sp .6
268 .RS 4n
269 The minimum percentage of free space to maintain in the file system, between 0%
270 and 99%, inclusively. This space is off-limits to users. Once the file system
271 is filled to this threshold, only the super-user can continue writing to the
272 file system.
274 The default is ((64 Mbytes/partition size) * 100), rounded down to the nearest
275 integer and limited between 1% and 10%, inclusively.
277 This parameter can be subsequently changed using the \fBtunefs\fR(1M) command.
281 .ne 2
283 \fB\fB-n\fR \fInrpos\fR\fR
285 .sp .6
286 .RS 4n
287 The number of different rotational positions in which to divide a cylinder
288 group. The default is \fB8\fR.
290 This option is not applicable for disks with EFI labels and is ignored.
294 .ne 2
296 \fB\fB-o\fR \fIspace\fR\||\|\fItime\fR\fR
298 .sp .6
299 .RS 4n
300 The file system can either be instructed to try to minimize the \fBtime\fR
301 spent allocating blocks, or to try to minimize the \fBspace\fR fragmentation on
302 the disk. The default is \fItime\fR.
304 This parameter can subsequently be changed with the \fBtunefs\fR(1M) command.
308 .ne 2
310 \fB\fB-r\fR \fIrpm\fR\fR
312 .sp .6
313 .RS 4n
314 The rotational speed of the disk in revolutions per minute. The default is
315 driver- or device-specific.
317 Note that you specify \fIrpm\fR for \fBnewfs\fR and \fIrps\fR for \fBmkfs\fR.
319 This option is not applicable for disks with EFI labels and is ignored.
323 .ne 2
325 \fB\fB-s\fR \fIsize\fR\fR
327 .sp .6
328 .RS 4n
329 The size of the file system in sectors. The default is to use the entire
330 partition.
334 .ne 2
336 \fB\fB-t\fR \fIntrack\fR\fR
338 .sp .6
339 .RS 4n
340 The number of tracks per cylinder on the disk. The default is taken from the
341 disk label.
343 This option is not applicable for disks with EFI labels and is ignored.
348 .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 USAGE
366 See \fBlargefile\fR(5) for the description of the behavior of \fBnewfs\fR when
367 encountering files greater than or equal to 2 Gbyte ( 2^31 bytes).
368 .SH EXAMPLES
370 \fBExample 1 \fRDisplaying the Parameters for the Raw Special Device
373 The following example verbosely displays the parameters for the raw special
374 device, \fBc0t0d0s6\fR. It does not actually create a new file system:
377 .in +2
379 example# newfs \fB-Nv\fR /dev/rdsk/c0t0d0s6
380 mkfs \fB-F\fR ufs \fB-o\fR N /dev/rdsk/c0t0d0s6 1112940 54 15 8192 1024 16 10 60
381 2048 t 0 \(mi1 8 /dev/rdsk/c0t0d0s6: 1112940 sectors in
382 1374 cylinders of 15 tracks, 54 sectors 569.8MB in 86 cyl
383 groups (16 c/g, 6.64MB/g, 3072 i/g) super-block backups
384 (for fsck \fB-b\fR #) at:
385 32, 13056, 26080, 39104, 52128, 65152, 78176, 91200, 104224, .\|.\|.
387 .in -2
391 \fBExample 2 \fRCreating a \fBUFS\fR File System
394 The following example creates a \fBUFS\fR file system on a diskette that is
395 managed by a volume manager that makes use of the mount point \fB/vol\fR.
398 .in +2
400 example% newfs /vol/dev/aliases/floppy0
401 newfs: construct a new file system /vol/dev/aliases/floppy0: (y/n)? y
402 /vol/dev/aliases/floppy0: 2880 sectors in 80 cylinders of 2 tracks,
403 18 sectors 1.4MB in 5 cyl groups (16 c/g, 0.28MB/g, 128 i/g)
404 super-block backups (for fsck \fB-F\fR ufs \fB-o\fR b=#) at:
405 32, 640, 1184, 1792, 2336, .\|.\|.
407 .in -2
411 \fBExample 3 \fRCreating a \fBUFS\fR File System That Will Eventually Be Grown
412 to a Multiterabyte UFS File System
415 The following example creates a \fBUFS\fR file system that will eventually be
416 grown to a multiterabyte UFS file system.
420 This command creates a 800-Gbyte file system on the volume,
421 \fB/dev/md/rdsk/d99\fR.
424 .in +2
426 # newfs -T /dev/md/rdsk/d99
427 newfs: construct a new file system /dev/md/rdsk/d99: (y/n)? y
428    /dev/md/rdsk/d99: 1677754368 sectors in 45512 cylinders of
429    144 tracks, 256 sectors
430    819216.0MB in 1821 cyl groups (25 c/g, 450.00MB/g, 448 i/g) .\|.\|.
432 .in -2
437 Then, if you increase the volume size for this file system, you can use the
438 \fBgrowfs\fR command to expand the file system. The file system is grown to 1.2
439 terabytes in this example:
442 .in +2
444 # growfs -v /dev/md/rdsk/d99
445 /usr/lib/fs/ufs/mkfs -G /dev/md/rdsk/d99 2516631552 /dev/md/rdsk/d99:
446    2516631552 sectors in 68268 cylinders of 144 tracks, 256  sectors
447    1228824.0MB in 2731 cyl groups (25 c/g, 450.00MB/g, 448 i/g).\|.\|.
449 .in -2
452 .SH EXIT STATUS
455 The following exit values are returned:
457 .ne 2
459 \fB\fB0\fR\fR
461 .sp .6
462 .RS 4n
463 The operation was successful.
467 .ne 2
469 \fB\fB1\fR, \fB10\fR\fR
471 .sp .6
472 .RS 4n
473 Usage error or internal error. A message is output to \fBSTDERR\fR explaining
474 the error.
479 Other exit values may be returned by \fBmkfs\fR(1M), which is called by
480 \fBnewfs\fR.
481 .SH SEE ALSO
484 \fBfsck\fR(1M), \fBfsck_ufs\fR(1M), \fBfsirand\fR(1M), \fBmkfs\fR(1M),
485 \fBmkfs_ufs\fR(1M), \fBtunefs\fR(1M), \fBattributes\fR(5), \fBlargefile\fR(5),
486 \fBufs\fR(7FS)
487 .SH DIAGNOSTICS
489 .ne 2
491 \fB\fBnewfs: No such file or directory\fR\fR
493 .sp .6
494 .RS 4n
495 The device specified does not exist, or a disk partition was not specified.
499 .ne 2
501 \fB\fIspecial\fR\fB: cannot open\fR\fR
503 .sp .6
504 .RS 4n
505 You must write access to the device to use this command.