8980 BIOS clock is sometimes one hour fast
[unleashed.git] / usr / src / man / man1m / mkfs_ufs.1m
blob9c10e6bcb5719625e841c3936e32c4d8d3c67753
1 '\" te
2 .\" Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved
3 .\" Copyright 1989 AT&T
4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
5 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
6 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
7 .TH MKFS_UFS 1M "Mar 8, 2006"
8 .SH NAME
9 mkfs_ufs \- construct a UFS file system
10 .SH SYNOPSIS
11 .LP
12 .nf
13 \fBmkfs\fR \fB-F\fR ufs [\fIgeneric_options\fR] [\fB-o\fR \fIFSType_specific_options\fR] \fIraw_device_file\fR
14      [\fIsize\fR]
15 .fi
17 .SH DESCRIPTION
18 .sp
19 .LP
20 The UFS-specific module of \fBmkfs\fR builds a UFS file system with a root
21 directory and a \fBlost+found\fR directory (see \fBfsck\fR(1M)).
22 .sp
23 .LP
24 The UFS-specific \fBmkfs\fR is rarely run directly. Use the \fBnewfs\fR(1M)
25 command instead.
26 .sp
27 .LP
28 \fIraw_device_file\fR indicates the disk partition on which to create the new
29 file system. If the \fB-o\fR \fBN\fR, \fB-V\fR, or \fB-m\fR options are
30 specified, the \fIraw_device_file\fR is not actually modified. \fIsize\fR
31 specifies the number of disk sectors in the file system, where a disk sector is
32 usually 512 bytes. This argument must follow the \fIraw_device_file\fR argument
33 and is required (even with \fB\fR\fB-o\fR\fB N\fR), unless the \fB-V\fR or
34 \fB-m\fR generic options are specified.
35 .sp
36 .LP
37 \fIgeneric_options\fR are supported by the generic \fBmkfs\fR command. See
38 \fBmkfs\fR(1M) for a description of these options.
39 .SH OPTIONS
40 .sp
41 .LP
42 The following generic options are supported:
43 .sp
44 .ne 2
45 .na
46 \fB\fB-m\fR\fR
47 .ad
48 .RS 6n
49 Print the command line that was used to create the existing file system.
50 .RE
52 .sp
53 .ne 2
54 .na
55 \fB\fB-V\fR\fR
56 .ad
57 .RS 6n
58 Print the current \fBmkfs\fR command line.
59 .RE
61 .SH OPTIONS
62 .sp
63 .LP
64 The following UFS-specific options are supported:
65 .sp
66 .ne 2
67 .na
68 \fB\fB-o\fR\fR
69 .ad
70 .RS 6n
71 Use one or more of the following values separated by commas (with no
72 intervening spaces) to specify UFS-specific options:
73 .sp
74 .ne 2
75 .na
76 \fB\fBapc=\fR\fIn\fR\fR
77 .ad
78 .RS 15n
79 The number of alternate sectors per cylinder to reserve for bad block
80 replacement for SCSI devices only. The default is \fB0\fR.
81 .sp
82 This option is not applicable for disks with EFI labels and is ignored.
83 .RE
85 .sp
86 .ne 2
87 .na
88 \fB\fBbsize=\fR\fIn\fR\fR
89 .ad
90 .RS 15n
91 The logical block size of the file system in bytes, either \fB4096\fR or
92 \fB8192\fR. The default is \fB8192\fR. The sun4u architecture does not support
93 the \fB4096\fR block size.
94 .RE
96 .sp
97 .ne 2
98 .na
99 \fB\fBcalcbinsb\fR\fR
101 .RS 15n
102 Sends to stdout a binary (machine-readable) version of the superblock that
103 would be used to create a file system with the specified configuration
104 parameters.
108 .ne 2
110 \fB\fBcalcsb\fR\fR
112 .RS 15n
113 Sends to stdout a human-readable version of the superblock that would be used
114 to create a file system with the specified configuration parameters.
118 .ne 2
120 \fB\fBcgsize=\fR\fIn\fR\fR
122 .RS 15n
123 The number of cylinders per cylinder group, ranging from \fB16\fR to \fB256\fR.
124 The default is calculated by dividing the number of sectors in the file system
125 by the number of sectors in a gigabyte. Then, the result is multiplied by
126 \fB32\fR. The default value is always between \fB16\fR and \fB256\fR.
128 The per-cylinder-group meta data must fit in a space no larger than what is
129 available in one logical file system block. If too large a \fBcgsize\fR is
130 requested, it is changed by the minimum amount necessary.
134 .ne 2
136 \fB\fBfragsize=\fR\fIn\fR\fR
138 .RS 15n
139 The smallest amount of disk space in bytes that can be allocated to a file.
140 \fBfragsize\fR must be a power of 2 divisor of \fBbsize\fR, where:
142 \fBbsize\fR / \fBfragsize\fR is 1, 2, 4, or 8.
144 This means that if the logical block size is \fB4096\fR, legal values for
145 \fBfragsize\fR are \fB512\fR, \fB1024\fR, \fB2048\fR, and \fB4096\fR. When the
146 logical block size is \fB8192\fR, legal values are \fB1024\fR, \fB2048\fR,
147 \fB4096\fR, and \fB8192\fR. The default value is \fB1024\fR.
149 For file systems greater than 1 terabyte or for file systems created with the
150 \fBmtb=y\fR option, \fBfragsize\fR is forced to match block size (\fBbsize\fR).
154 .ne 2
156 \fB\fBfree=\fR\fIn\fR\fR
158 .RS 15n
159 The minimum percentage of free space to maintain in the file system between 0%
160 and 99%, inclusively. This space is off-limits to users. Once the file system
161 is filled to this threshold, only the superuser can continue writing to the
162 file system.
164 The default is ((64 Mbytes/partition size) * 100), rounded down to the nearest
165 integer and limited between 1% and 10%, inclusively.
167 This parameter can be subsequently changed using the \fBtunefs\fR(1M) command.
171 .ne 2
173 \fB\fBgap=\fR\fIn\fR\fR
175 .RS 15n
176 Rotational delay. This option is obsolete in the Solaris 10 release. The value
177 is always set to \fB0\fR, regardless of the input value.
181 .ne 2
183 \fB\fBmaxcontig=\fR\fIn\fR\fR
185 .RS 15n
186 The maximum number of logical blocks, belonging to one file, that are allocated
187 contiguously. The default is calculated as follows:
189 .in +2
191 \fBmaxcontig =\fR \fIdisk drive maximum transfer size / disk block size\fR
193 .in -2
196 If the disk drive's maximum transfer size cannot be determined, the default
197 value for \fBmaxcontig\fR is calculated from kernel parameters as follows:
199 If \fBmaxphys\fR is less than \fBufs_maxmaxphys\fR, which is typically 1 Mbyte,
200 then \fBmaxcontig\fR is set to \fBmaxphys\fR. Otherwise, \fBmaxcontig\fR is set
201 to \fBufs_maxmaxphys\fR.
203 You can set \fBmaxcontig\fR to any positive integer value.
205 The actual value will be the lesser of what has been specified and what the
206 hardware supports.
208 You can subsequently change this parameter by using \fBtunefs\fR(1M).
212 .ne 2
214 \fB\fBmtb=y\fR\fR
216 .RS 15n
217 Set the parameters of the file system to allow eventual growth to over a
218 terabyte in total file system size. This option sets \fIfragsize\fR to be the
219 same as \fIbsize\fR, and sets \fInbpi\fR to 1 Mbyte, unless the \fB-i\fR option
220 is used to make it even larger. If you explicitly set the \fIfragsize\fR or
221 \fInbpi\fR parameters to values that are incompatible with this option, the
222 user-supplied value of \fIfragsize\fR or \fInbpi\fR is ignored.
226 .ne 2
228 \fB\fBN\fR\fR
230 .RS 15n
231 Print out the file system parameters that would be used to create the file
232 system without actually creating the file system.
236 .ne 2
238 \fB\fBnbpi=\fR\fIn\fR\fR
240 .RS 15n
241 The number of bytes per inode, which specifies the density of inodes in the
242 file system. The number is divided into the total size of the file system to
243 determine the number of inodes to create.
245 This value should reflect the expected average size of files in the file
246 system. If fewer inodes are desired, a larger number should be used. To create
247 more inodes, a smaller number should be given. The default is \fB2048\fR.
249 The number of inodes can increase if the file system is expanded with the
250 \fBgrowfs\fR command.
254 .ne 2
256 \fB\fBnrpos=\fR\fIn\fR\fR
258 .RS 15n
259 The number of different rotational positions in which to divide a cylinder
260 group. The default is \fB8\fR.
262 This option is not applicable for disks with EFI labels and is ignored.
266 .ne 2
268 \fB\fBnsect=\fR\fIn\fR\fR
270 .RS 15n
271 The number of sectors per track on the disk. The default is \fB32\fR.
275 .ne 2
277 \fB\fBntrack=\fR\fIn\fR\fR
279 .RS 15n
280 The number of tracks per cylinder on the disk. The default is \fB16\fR.
282 This option is not applicable for disks with EFI labels and is ignored.
286 .ne 2
288 \fB\fBopt=\fR\fIs\fR\||\|\fIt\fR\fR
290 .RS 15n
291 The file system can either be instructed to try to minimize the \fBtime\fR
292 spent allocating blocks, or to try to minimize the \fBspace\fR fragmentation on
293 the disk. The default is \fItime\fR.
295 This parameter can be subsequently changed with the \fBtunefs\fR(1M) command.
299 .ne 2
301 \fB\fBrps=\fR\fIn\fR\fR
303 .RS 15n
304 The rotational speed of the disk, in revolutions per second. The default is
305 \fB60\fR.
307 Note that you specify \fIrps\fR for \fBmkfs\fR and \fIrpm\fR for \fBnewfs\fR.
309 This option is not applicable for disks with EFI labels and is ignored.
312 Alternatively, parameters can be entered as a list of space-separated values
313 (without keywords) whose meaning is positional. In this case, the \fB-o\fR
314 option is omitted and the list follows the size operand. This is the way
315 \fBnewfs\fR passes the parameters to \fBmkfs\fR.
318 .SH OPERANDS
321 The following operands are supported:
323 .ne 2
325 \fB\fIraw_device_file\fR\fR
327 .RS 19n
328 The disk partition on which to write.
331 .SH SEE ALSO
334 \fBfsck\fR(1M), \fBmkfs\fR(1M), \fBnewfs\fR(1M), \fBtunefs\fR(1M),
335 \fBdir_ufs\fR(4), \fBattributes\fR(5), \fBufs\fR(7FS)
336 .SH DIAGNOSTICS
339 The following error message typically occurs with very high density disks. On
340 such disks, the file system structure cannot encode the proper disk layout
341 information. However, such disks have enough onboard intelligence to make up
342 for any layout deficiencies, so there is no actual impact on performance. The
343 warning that performance might be impaired can be safely ignored.
345 .in +2
347 Warning: insufficient space in super block for
348 rotational layout tables with nsect \fIsblock.fs_nsect\fR
349 and ntrak \fIsblock.fs_ntrak\fR. (File system performance may be impaired.)
351 .in -2
356 The following error message occurs when the disk geometry results in a
357 situation where the last truncated cylinder group cannot contain the correct
358 number of data blocks. Some disk space is wasted.
360 .in +2
362 Warning: inode blocks/cyl group (\fIgrp\fR) >= data blocks (\fInum\fR) in last cylinder
364 .in -2
369 If there is only one cylinder group and if the above condition holds true,
370 \fBmkfs\fR fails with the following error:
372 .in +2
374 File system creation failed. There is only one cylinder group and that is
375 not even big enough to hold the inodes.
377 .in -2
382 The following error message occurs when the best calculated file system layout
383 is unable to include the last few sectors in the last cylinder group. This is
384 due to the interaction between how much space is used for various pieces of
385 meta data and the total blocks available in a cylinder group. Modifying
386 \fBnbpi\fR and \fBcpg\fR might reduce this number, but it is rarely worth the
387 effort.
389 .in +2
391 Warning: \fInum\fR sector(s) in last cylinder group unallocated
393 .in -2
396 .SH NOTES
399 You can use \fBlofiadm\fR to create a file that appears to the \fBmkfs\fR
400 command (for example, \fBmkfs_pcfs\fR or \fBmkfs_ufs\fR) as a raw device. You
401 can then use the \fBmkfs\fR command to create a file system on that device. See
402 \fBlofiadm\fR(1M) for examples of creating a \fBUFS\fR and a \fBPC\fR
403 (\fBFAT\fR) file system on a device created by \fBlofiadm\fR.
406 Both the block and character devices, such as devices in \fB/dev/dsk\fR and
407 \fB/dev/rdsk\fR, must be available prior to running the \fBmkfs\fR command.