1mkfs_ufs(1M) System Administration Commands mkfs_ufs(1M)
2
3
4
6 mkfs_ufs - construct a UFS file system
7
9 mkfs -F ufs [generic_options] [-o FSType_specific_options] raw_device_file
10 [size]
11
12
14 The UFS-specific module of mkfs builds a UFS file system with a root
15 directory and a lost+found directory (see fsck(1M)).
16
17
18 The UFS-specific mkfs is rarely run directly. Use the newfs(1M) command
19 instead.
20
21
22 raw_device_file indicates the disk partition on which to create the new
23 file system. If the -o N, -V, or -m options are specified, the
24 raw_device_file is not actually modified. size specifies the number of
25 disk sectors in the file system, where a disk sector is usually 512
26 bytes. This argument must follow the raw_device_file argument and is
27 required (even with -o N), unless the -V or -m generic options are
28 specified.
29
30
31 generic_options are supported by the generic mkfs command. See mkfs(1M)
32 for a description of these options.
33
35 The following generic options are supported:
36
37 -m Print the command line that was used to create the existing file
38 system.
39
40
41 -V Print the current mkfs command line.
42
43
45 The following UFS-specific options are supported:
46
47 -o Use one or more of the following values separated by commas (with
48 no intervening spaces) to specify UFS-specific options:
49
50 apc=n The number of alternate sectors per cylinder to
51 reserve for bad block replacement for SCSI devices
52 only. The default is 0.
53
54 This option is not applicable for disks with EFI
55 labels and is ignored.
56
57
58 bsize=n The logical block size of the file system in
59 bytes, either 4096 or 8192. The default is 8192.
60 The sun4u architecture does not support the 4096
61 block size.
62
63
64 calcbinsb Sends to stdout a binary (machine-readable) ver‐
65 sion of the superblock that would be used to cre‐
66 ate a file system with the specified configuration
67 parameters.
68
69
70 calcsb Sends to stdout a human-readable version of the
71 superblock that would be used to create a file
72 system with the specified configuration parame‐
73 ters.
74
75
76 cgsize=n The number of cylinders per cylinder group, rang‐
77 ing from 16 to 256. The default is calculated by
78 dividing the number of sectors in the file system
79 by the number of sectors in a gigabyte. Then, the
80 result is multiplied by 32. The default value is
81 always between 16 and 256.
82
83 The per-cylinder-group meta data must fit in a
84 space no larger than what is available in one log‐
85 ical file system block. If too large a cgsize is
86 requested, it is changed by the minimum amount
87 necessary.
88
89
90 fragsize=n The smallest amount of disk space in bytes that
91 can be allocated to a file. fragsize must be a
92 power of 2 divisor of bsize, where:
93
94 bsize / fragsize is 1, 2, 4, or 8.
95
96 This means that if the logical block size is 4096,
97 legal values for fragsize are 512, 1024, 2048, and
98 4096. When the logical block size is 8192, legal
99 values are 1024, 2048, 4096, and 8192. The default
100 value is 1024.
101
102 For file systems greater than 1 terabyte or for
103 file systems created with the mtb=y option, frag‐
104 size is forced to match block size (bsize).
105
106
107 free=n The minimum percentage of free space to maintain
108 in the file system between 0% and 99%, inclu‐
109 sively. This space is off-limits to users. Once
110 the file system is filled to this threshold, only
111 the superuser can continue writing to the file
112 system.
113
114 The default is ((64 Mbytes/partition size) * 100),
115 rounded down to the nearest integer and limited
116 between 1% and 10%, inclusively.
117
118 This parameter can be subsequently changed using
119 the tunefs(1M) command.
120
121
122 gap=n Rotational delay. This option is obsolete in the
123 Solaris 10 release. The value is always set to 0,
124 regardless of the input value.
125
126
127 maxcontig=n The maximum number of logical blocks, belonging to
128 one file, that are allocated contiguously. The
129 default is calculated as follows:
130
131 maxcontig = disk drive maximum transfer size / disk block size
132
133
134 If the disk drive's maximum transfer size cannot
135 be determined, the default value for maxcontig is
136 calculated from kernel parameters as follows:
137
138 If maxphys is less than ufs_maxmaxphys, which is
139 typically 1 Mbyte, then maxcontig is set to max‐
140 phys. Otherwise, maxcontig is set to ufs_maxmax‐
141 phys.
142
143 You can set maxcontig to any positive integer
144 value.
145
146 The actual value will be the lesser of what has
147 been specified and what the hardware supports.
148
149 You can subsequently change this parameter by
150 using tunefs(1M).
151
152
153 mtb=y Set the parameters of the file system to allow
154 eventual growth to over a terabyte in total file
155 system size. This option sets fragsize to be the
156 same as bsize, and sets nbpi to 1 Mbyte, unless
157 the -i option is used to make it even larger. If
158 you explicitly set the fragsize or nbpi parameters
159 to values that are incompatible with this option,
160 the user-supplied value of fragsize or nbpi is
161 ignored.
162
163
164 N Print out the file system parameters that would be
165 used to create the file system without actually
166 creating the file system.
167
168
169 nbpi=n The number of bytes per inode, which specifies the
170 density of inodes in the file system. The number
171 is divided into the total size of the file system
172 to determine the number of inodes to create.
173
174 This value should reflect the expected average
175 size of files in the file system. If fewer inodes
176 are desired, a larger number should be used. To
177 create more inodes, a smaller number should be
178 given. The default is 2048.
179
180 The number of inodes can increase if the file sys‐
181 tem is expanded with the growfs command.
182
183
184 nrpos=n The number of different rotational positions in
185 which to divide a cylinder group. The default is
186 8.
187
188 This option is not applicable for disks with EFI
189 labels and is ignored.
190
191
192 nsect=n The number of sectors per track on the disk. The
193 default is 32.
194
195
196 ntrack=n The number of tracks per cylinder on the disk. The
197 default is 16.
198
199 This option is not applicable for disks with EFI
200 labels and is ignored.
201
202
203 opt=s|t The file system can either be instructed to try to
204 minimize the time spent allocating blocks, or to
205 try to minimize the space fragmentation on the
206 disk. The default is time.
207
208 This parameter can be subsequently changed with
209 the tunefs(1M) command.
210
211
212 rps=n The rotational speed of the disk, in revolutions
213 per second. The default is 60.
214
215 Note that you specify rps for mkfs and rpm for
216 newfs.
217
218 This option is not applicable for disks with EFI
219 labels and is ignored.
220
221 Alternatively, parameters can be entered as a list of space-sepa‐
222 rated values (without keywords) whose meaning is positional. In
223 this case, the -o option is omitted and the list follows the size
224 operand. This is the way newfs passes the parameters to mkfs.
225
226
228 The following operands are supported:
229
230 raw_device_file The disk partition on which to write.
231
232
234 See attributes(5) for descriptions of the following attributes:
235
236
237
238
239 ┌─────────────────────────────┬─────────────────────────────┐
240 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
241 ├─────────────────────────────┼─────────────────────────────┤
242 │Availability │SUNWcsu │
243 └─────────────────────────────┴─────────────────────────────┘
244
246 fsck(1M), mkfs(1M), newfs(1M), tunefs(1M), dir_ufs(4), attributes(5),
247 ufs(7FS)
248
250 The following error message typically occurs with very high density
251 disks. On such disks, the file system structure cannot encode the
252 proper disk layout information. However, such disks have enough onboard
253 intelligence to make up for any layout deficiencies, so there is no
254 actual impact on performance. The warning that performance might be
255 impaired can be safely ignored.
256
257 Warning: insufficient space in super block for
258 rotational layout tables with nsect sblock.fs_nsect
259 and ntrak sblock.fs_ntrak. (File system performance may be impaired.)
260
261
262
263
264 The following error message occurs when the disk geometry results in a
265 situation where the last truncated cylinder group cannot contain the
266 correct number of data blocks. Some disk space is wasted.
267
268 Warning: inode blocks/cyl group (grp) >= data blocks (num) in last cylinder
269
270
271
272
273 If there is only one cylinder group and if the above condition holds
274 true, mkfs fails with the following error:
275
276 File system creation failed. There is only one cylinder group and that is
277 not even big enough to hold the inodes.
278
279
280
281
282 The following error message occurs when the best calculated file system
283 layout is unable to include the last few sectors in the last cylinder
284 group. This is due to the interaction between how much space is used
285 for various pieces of meta data and the total blocks available in a
286 cylinder group. Modifying nbpi and cpg might reduce this number, but it
287 is rarely worth the effort.
288
289 Warning: num sector(s) in last cylinder group unallocated
290
291
292
294 You can use lofiadm to create a file that appears to the mkfs command
295 (for example, mkfs_pcfs or mkfs_ufs) as a raw device. You can then use
296 the mkfs command to create a file system on that device. See lofi‐
297 adm(1M) for examples of creating a UFS and a PC (FAT) file system on a
298 device created by lofiadm.
299
300
301 Both the block and character devices, such as devices in /dev/dsk and
302 /dev/rdsk, must be available prior to running the mkfs command.
303
304
305
306SunOS 5.11 8 Mar 2006 mkfs_ufs(1M)