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"
9 mkfs_ufs \- construct a UFS file system
13 \fBmkfs\fR \fB-F\fR ufs [\fIgeneric_options\fR] [\fB-o\fR \fIFSType_specific_options\fR] \fIraw_device_file\fR
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)).
24 The UFS-specific \fBmkfs\fR is rarely run directly. Use the \fBnewfs\fR(1M)
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.
37 \fIgeneric_options\fR are supported by the generic \fBmkfs\fR command. See
38 \fBmkfs\fR(1M) for a description of these options.
42 The following generic options are supported:
49 Print the command line that was used to create the existing file system.
58 Print the current \fBmkfs\fR command line.
64 The following UFS-specific options are supported:
71 Use one or more of the following values separated by commas (with no
72 intervening spaces) to specify UFS-specific options:
76 \fB\fBapc=\fR\fIn\fR\fR
79 The number of alternate sectors per cylinder to reserve for bad block
80 replacement for SCSI devices only. The default is \fB0\fR.
82 This option is not applicable for disks with EFI labels and is ignored.
88 \fB\fBbsize=\fR\fIn\fR\fR
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.
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
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.
120 \fB\fBcgsize=\fR\fIn\fR\fR
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.
136 \fB\fBfragsize=\fR\fIn\fR\fR
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).
156 \fB\fBfree=\fR\fIn\fR\fR
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
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.
173 \fB\fBgap=\fR\fIn\fR\fR
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.
183 \fB\fBmaxcontig=\fR\fIn\fR\fR
186 The maximum number of logical blocks, belonging to one file, that are allocated
187 contiguously. The default is calculated as follows:
191 \fBmaxcontig =\fR \fIdisk drive maximum transfer size / disk block size\fR
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
208 You can subsequently change this parameter by using \fBtunefs\fR(1M).
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.
231 Print out the file system parameters that would be used to create the file
232 system without actually creating the file system.
238 \fB\fBnbpi=\fR\fIn\fR\fR
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.
256 \fB\fBnrpos=\fR\fIn\fR\fR
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.
268 \fB\fBnsect=\fR\fIn\fR\fR
271 The number of sectors per track on the disk. The default is \fB32\fR.
277 \fB\fBntrack=\fR\fIn\fR\fR
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.
288 \fB\fBopt=\fR\fIs\fR\||\|\fIt\fR\fR
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.
301 \fB\fBrps=\fR\fIn\fR\fR
304 The rotational speed of the disk, in revolutions per second. The default is
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.
321 The following operands are supported:
325 \fB\fIraw_device_file\fR\fR
328 The disk partition on which to write.
334 \fBfsck\fR(1M), \fBmkfs\fR(1M), \fBnewfs\fR(1M), \fBtunefs\fR(1M),
335 \fBdir_ufs\fR(4), \fBattributes\fR(5), \fBufs\fR(7FS)
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.
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.)
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.
362 Warning: inode blocks/cyl group (\fIgrp\fR) >= data blocks (\fInum\fR) in last cylinder
369 If there is only one cylinder group and if the above condition holds true,
370 \fBmkfs\fR fails with the following error:
374 File system creation failed. There is only one cylinder group and that is
375 not even big enough to hold the inodes.
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
391 Warning: \fInum\fR sector(s) in last cylinder group unallocated
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.