1newfs(1M)               System Administration Commands               newfs(1M)
2
3
4

NAME

6       newfs - construct a UFS file system
7

SYNOPSIS

9       newfs [-NSBTv] [mkfs-options] raw-device
10
11

DESCRIPTION

13       newfs  is a "friendly" front-end to the mkfs(1M) program for making UFS
14       file systems on  disk  partitions.  newfs  calculates  the  appropriate
15       parameters to use and calls mkfs.
16
17
18       If  run interactively (that is, standard input is a tty), newfs prompts
19       for confirmation before making the file system.
20
21
22       If the -N option is not specified and the inodes of the device are  not
23       randomized, newfs calls fsirand(1M).
24
25
26       You must be super-user or have appropriate write privileges to use this
27       command, except when creating a UFS file  system  on  a  diskette.  See
28       EXAMPLES.
29
30   Creating a Multiterabyte UFS File System
31       Keep  the  following  limitations in mind when creating a multiterabyte
32       UFS file system:
33
34           o      nbpi is set to  1  Mbyte  unless  you  specifically  set  it
35                  higher.  You cannot set nbpi lower than 1 Mbyte on a multit‐
36                  erabyte UFS file system.
37
38           o      fragsize is set equal to bsize.
39

OPTIONS

41       The following options are supported:
42
43       -N
44
45           Print out the file system parameters that would be used  to  create
46           the  file  system  without actually creating the file system. fsir‐
47           and(1M) is not called here.
48
49
50       -S
51
52           Sends to stdout a human-readable version  of  the  superblock  that
53           would  be used to create a filesystem with the specified configura‐
54           tion parameters.
55
56
57       -B
58
59           Sends  to  stdout  a  binary  (machine-readable)  version  of   the
60           superblock that would be used to create a filesystem with the spec‐
61           ified configuration parameters.
62
63
64       -T
65
66           Set the parameters of the file system to allow eventual  growth  to
67           over  a  terabyte in total file system size. This option sets frag‐
68           size to be the same as bsize, and sets nbpi to 1 Mbyte, unless  the
69           -i  option  is used to make it even larger. If you use the -f or -i
70           options to specify a fragsize or nbpi  that  is  incompatible  with
71           this  option,  the  user-supplied  value  of  fragsize  or  nbpi is
72           ignored.
73
74
75       -v
76
77           Verbose. newfs prints out its  actions,  including  the  parameters
78           passed to mkfs.
79
80
81       mkfs-options
82
83           Options that override the default parameters are:
84
85           -a apc
86
87               The number of alternate sectors per cylinder to reserve for bad
88               block replacement for SCSI devices only. The default is 0.
89
90               This option is not applicable for disks with EFI labels and  is
91               ignored.
92
93
94           -b bsize
95
96               The logical block size of the file system in bytes, either 4096
97               or 8192. The default is 8192. The sun4u architecture  does  not
98               support the 4096 block size.
99
100
101           -c cgsize
102
103               The  number of cylinders per cylinder group, ranging from 16 to
104               256. The default is calculated by dividing the number  of  sec‐
105               tors in the file system by the number of sectors in a gigabyte.
106               Then, the result is multiplied by  32.  The  default  value  is
107               always between 16 and 256.
108
109               mkfs can override this value. See mkfs_ufs(1M) for details.
110
111               This  option is not applicable for disks with EFI labels and is
112               ignored.
113
114
115           -C maxcontig
116
117               The maximum number of logical blocks, belonging  to  one  file,
118               that  are  allocated contiguously. The default is calculated as
119               follows:
120
121                 maxcontig = disk drive maximum transfer size / disk block size
122
123
124               If the disk drive's maximum transfer size cannot be determined,
125               the  default  value  for  maxcontig  is  calculated from kernel
126               parameters as follows:
127
128               If maxphys is less than ufs_maxmaxphys, which  is  typically  1
129               Mbyte,  then  maxcontig is set to maxphys. Otherwise, maxcontig
130               is set to ufs_maxmaxphys.
131
132               You can set maxcontig to any positive integer value.
133
134               The actual value will be the lesser of what has been  specified
135               and what the hardware supports.
136
137               You can subsequently change this parameter by using tunefs(1M).
138
139
140           -d gap
141
142               Rotational  delay.  This  option  is obsolete in the Solaris 10
143               release. The value is always set to 0, regardless of the  input
144               value.
145
146
147           -f fragsize
148
149               The  smallest  amount  of disk space in bytes that can be allo‐
150               cated to a file. fragsize must be  a  power  of  2  divisor  of
151               bsize, where:
152
153               bsize / fragsize is 1, 2, 4, or 8.
154
155               This means that if the logical block size is 4096, legal values
156               for fragsize are 512, 1024, 2048, and 4096.  When  the  logical
157               block  size  is  8192,  legal  values are 1024, 2048, 4096, and
158               8192. The default value is 1024.
159
160               For file systems greater than 1 terabyte or  for  file  systems
161               created  with  the -T option, fragsize is forced to match block
162               size (bsize).
163
164
165           -i nbpi
166
167               The number of bytes per inode, which specifies the  density  of
168               inodes in the file system. The number is divided into the total
169               size of the file system to determine the number  of  inodes  to
170               create.
171
172               This value should reflect the expected average size of files in
173               the file system. If fewer inodes are desired, a  larger  number
174               should  be used. To create more inodes, a smaller number should
175               be given. The default for nbpi is as follows:
176
177                 Disk size                 Density
178
179                 Less than 1GB             2048
180                 Less than 2GB             4096
181                 Less than 3GB             6144
182                 3GB to 1 Tbyte            8192
183                 Greater than 1 Tbyte
184                    or created with -T     1048576
185
186
187               The number of  inodes  can  increase  if  the  file  system  is
188               expanded with the growfs command.
189
190
191           -m free
192
193               The  minimum  percentage  of free space to maintain in the file
194               system, between 0% and 99%, inclusively. This space is off-lim‐
195               its to users. Once the file system is filled to this threshold,
196               only the super-user can continue writing to the file system.
197
198               The default is ((64 Mbytes/partition size) * 100), rounded down
199               to  the  nearest integer and limited between 1% and 10%, inclu‐
200               sively.
201
202               This parameter can be subsequently changed using the tunefs(1M)
203               command.
204
205
206           -n nrpos
207
208               The number of different rotational positions in which to divide
209               a cylinder group. The default is 8.
210
211               This option is not applicable for disks with EFI labels and  is
212               ignored.
213
214
215           -o space|time
216
217               The file system can either be instructed to try to minimize the
218               time spent allocating blocks, or to try to minimize  the  space
219               fragmentation on the disk. The default is time.
220
221               This  parameter can subsequently be changed with the tunefs(1M)
222               command.
223
224
225           -r rpm
226
227               The rotational speed of the disk in revolutions per minute. The
228               default is driver- or device-specific.
229
230               Note that you specify rpm for newfs and rps for mkfs.
231
232               This  option is not applicable for disks with EFI labels and is
233               ignored.
234
235
236           -s size
237
238               The size of the file system in sectors. The default is  to  use
239               the entire partition.
240
241
242           -t ntrack
243
244               The  number  of tracks per cylinder on the disk. The default is
245               taken from the disk label.
246
247               This option is not applicable for disks with EFI labels and  is
248               ignored.
249
250
251

OPERANDS

253       The following operands are supported:
254
255       raw-device
256
257           The  name  of  a  raw special device residing in the /dev directory
258           (for example, /dev/rdsk/c0t0d0s6) on which to create the file  sys‐
259           tem.
260
261

USAGE

263       See  largefile(5)  for  the  description  of the behavior of newfs when
264       encountering files greater than or equal to 2 Gbyte ( 2^31 bytes).
265

EXAMPLES

267       Example 1 Displaying the Parameters for the Raw Special Device
268
269
270       The following example verbosely displays the  parameters  for  the  raw
271       special  device,  c0t0d0s6. It does not actually create a new file sys‐
272       tem:
273
274
275         example# newfs -Nv /dev/rdsk/c0t0d0s6
276         mkfs -F ufs -o N /dev/rdsk/c0t0d0s6 1112940 54 15 8192 1024 16 10 60
277         2048 t 0 −1 8 /dev/rdsk/c0t0d0s6: 1112940 sectors in
278         1374 cylinders of 15 tracks, 54 sectors 569.8MB in 86 cyl
279         groups (16 c/g, 6.64MB/g, 3072 i/g) super-block backups
280         (for fsck -b #) at:
281         32, 13056, 26080, 39104, 52128, 65152, 78176, 91200, 104224, ...
282
283
284
285       Example 2 Creating a UFS File System
286
287
288       The following example creates a UFS file system on a diskette  that  is
289       managed by a volume manager that makes use of the mount point /vol.
290
291
292         example% newfs /vol/dev/aliases/floppy0
293         newfs: construct a new file system /vol/dev/aliases/floppy0: (y/n)? y
294         /vol/dev/aliases/floppy0: 2880 sectors in 80 cylinders of 2 tracks,
295         18 sectors 1.4MB in 5 cyl groups (16 c/g, 0.28MB/g, 128 i/g)
296         super-block backups (for fsck -F ufs -o b=#) at:
297         32, 640, 1184, 1792, 2336, ...
298
299
300
301       Example 3 Creating a UFS File System That Will Eventually Be Grown to a
302       Multiterabyte UFS File System
303
304
305       The following example creates a UFS file system that will eventually be
306       grown to a multiterabyte UFS file system.
307
308
309
310       This   command   creates   a  800-Gbyte  file  system  on  the  volume,
311       /dev/md/rdsk/d99.
312
313
314         # newfs -T /dev/md/rdsk/d99
315         newfs: construct a new file system /dev/md/rdsk/d99: (y/n)? y
316            /dev/md/rdsk/d99: 1677754368 sectors in 45512 cylinders of
317            144 tracks, 256 sectors
318            819216.0MB in 1821 cyl groups (25 c/g, 450.00MB/g, 448 i/g) ...
319
320
321
322
323       Then, if you increase the volume size for this file system, you can use
324       the  growfs command to expand the file system. The file system is grown
325       to 1.2 terabytes in this example:
326
327
328         # growfs -v /dev/md/rdsk/d99
329         /usr/lib/fs/ufs/mkfs -G /dev/md/rdsk/d99 2516631552 /dev/md/rdsk/d99:
330            2516631552 sectors in 68268 cylinders of 144 tracks, 256  sectors
331            1228824.0MB in 2731 cyl groups (25 c/g, 450.00MB/g, 448 i/g)...
332
333
334

EXIT STATUS

336       The following exit values are returned:
337
338       0
339
340           The operation was successful.
341
342
343       1, 10
344
345           Usage error or internal  error.  A  message  is  output  to  STDERR
346           explaining the error.
347
348
349
350       Other  exit  values  may  be  returned  by mkfs(1M), which is called by
351       newfs.
352

ATTRIBUTES

354       See attributes(5) for descriptions of the following attributes:
355
356
357
358
359       ┌─────────────────────────────┬─────────────────────────────┐
360       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
361       ├─────────────────────────────┼─────────────────────────────┤
362       │Availability                 │SUNWcsu                      │
363       └─────────────────────────────┴─────────────────────────────┘
364

SEE ALSO

366       fsck(1M),   fsck_ufs(1M),    fsirand(1M),    mkfs(1M),    mkfs_ufs(1M),
367       tunefs(1M), attributes(5), largefile(5), ufs(7FS)
368

DIAGNOSTICS

370       newfs: No such file or directory
371
372           The  device  specified  does not exist, or a disk partition was not
373           specified.
374
375
376       special: cannot open
377
378           You must write access to the device to use this command.
379
380
381
382
383SunOS 5.11                        1 Mar 2007                         newfs(1M)
Impressum