91f32f8b7abe7a0c6c947370abdbd769899debac
[apple/hfs.git] / newfs_hfs / newfs_hfs.8
1 .\" Copyright (c) 2002-2003 Apple Computer, Inc. All rights reserved.
2 .\"
3 .\" The contents of this file constitute Original Code as defined in and
4 .\" are subject to the Apple Public Source License Version 1.1 (the
5 .\" "License"). You may not use this file except in compliance with the
6 .\" License. Please obtain a copy of the License at
7 .\" http://www.apple.com/publicsource and read it before using this file.
8 .\"
9 .\" This Original Code and all software distributed under the License are
10 .\" distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
11 .\" EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
12 .\" INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
13 .\" FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
14 .\" License for the specific language governing rights and limitations
15 .\" under the License.
16 .\"
17 .\" @(#)newfs_hfs.8
18 .Dd June 19, 2008
19 .Dt NEWFS_HFS 8
20 .Os "Mac OS X"
21 .Sh NAME
22 .Nm newfs_hfs
23 .Nd construct a new HFS Plus file system
24 .Sh SYNOPSIS
25 .Nm newfs_hfs
26 .Op Fl N
27 .Op Fl U Ar uid
28 .Op Fl G Ar gid
29 .Op Fl M Ar mask
30 .Op Fl P
31 .Op Fl s
32 .Op Fl b Ar block-size
33 .Op Fl c Ar clump-size-list
34 .Op Fl i Ar first-cnid
35 .Op Fl J Ar [journal-size]
36 .Op Fl n Ar node-size-list
37 .Op Fl v Ar volume-name
38 .Ar special
39 .Nm newfs_hfs
40 .Fl N Ar partition-size
41 .Op Fl U Ar uid
42 .Op Fl G Ar gid
43 .Op Fl M Ar mask
44 .Op Fl P
45 .Op Fl h | w
46 .Op Fl s
47 .Op Fl b Ar block-size
48 .Op Fl c Ar clump-size-list
49 .Op Fl i Ar first-cnid
50 .Op Fl J Ar [journal-size]
51 .Op Fl n Ar node-size-list
52 .Op Fl v Ar volume-name
53 .Sh DESCRIPTION
54 .Nm Newfs_hfs
55 builds an HFS Plus file system on the specified special device.
56 Before running
57 .Nm newfs_hfs
58 the disk should be partitioned using the
59 .Em Disk Utility
60 application or
61 .Xr pdisk 8 .
62 .Pp
63 The file system default parameters are calculated based on
64 the size of the disk partition. Typically the defaults are
65 reasonable, however
66 .Nm newfs_hfs
67 has several options to allow the defaults to be selectively overridden.
68 The options are as follows:
69 .Bl -tag -width Fl
70 .It Fl N Ar [partition-size]
71 Causes the file system parameters to be printed out
72 without really creating the file system.
73 If the argument following the
74 .Fl N
75 starts with a decimal digit, it is assumed to be a partition size.
76 The paritition size may be given in decimal, octal (with leading `0'),
77 or hexadecimal (with leading `0x').
78 The partition size argument can be specified in 512-byte blocks (with a `b' suffix),
79 petabytes (`p' suffix), terabytes (`t' suffix), gigabytes
80 (`g' suffix), megabytes (`m' suffix), or kilobytes
81 (`k' suffix). All suffixes indicate binary, not decimal,
82 multipliers (e.g., `1k' is 1024 bytes). If no suffix is
83 specified, the value is assumed to be in bytes; if an illegal
84 suffix is specified, it results in a size of 0 bytes.
85 .Pp
86 If the partition size is given, then no special device argument shall be provided.
87 If no partition size is given, then the size of the given special device
88 is used instead, and the special device will not be written to.
89 .It Fl U Ar uid
90 Set the owner of the file system's root directory to
91 .Pa uid .
92 .It Fl G Ar gid
93 Set the group of the file system's root directory to
94 .Pa gid .
95 .It Fl M Ar mask
96 Specify the octal access permissions mask for the file system's root
97 directory.
98 .It Fl P
99 Set kHFSContentProtectionBit in the volume's attributes, which will cause the
100 volume to be mounted with the "protect" option if the kernel supports it.
101 .It Fl s
102 Creates a case-sensitive HFS Plus filesystem. By
103 default a case-insensitive filesystem is created.
104 Case-sensitive HFS Plus file systems require a Mac OS X
105 version of 10.3 (Darwin 7.0) or later.
106 .It Fl b Ar block-size
107 The allocation block size of the file system.
108 The default value is 4096.
109 .It Fl c Ar clump-size-list
110 This specifies the
111 .Em clump
112 and/or
113 .Em initial
114 sizes, in allocation
115 blocks, for the various metadata files.
116 .Em Clump
117 sizes are specified with the
118 .Fl c
119 option followed by a comma
120 separated list of the form arg=blocks.
121 .Pp
122 Example: -c c=5000,e=500
123 .Bl -tag -width Fl
124 .It Em a=blocks
125 Set the attribute file clump size.
126 .It Em b=blocks
127 Set the allocation bitmap file clump size.
128 .It Em c=blocks
129 Set the catalog file clump size.
130 .It Em d=blocks
131 Set the data fork clump size.
132 .It Em e=blocks
133 Set the extent overflow file clump size.
134 .It Em r=blocks
135 Set the resource fork clump size.
136 .El
137 .It Fl i Ar first-cnid
138 This specifies the initial catalog node ID for user files
139 and directories. The default value is 16.
140 .It Fl I Ar initial-size-list
141 This specifies the
142 .Em initial
143 size, in allocation
144 blocks, for the various metadata files.
145 .Em Initial
146 sizes are specified with the
147 .Fl I
148 option followed by a comma
149 separated list of the form arg=blocks.
150 .Pp
151 Example: -I c=5000,e=500
152 .Bl -tag -width Fl
153 .It Em a=blocks
154 Set the initial attribute file size.
155 .It Em c=blocks
156 Set the initial catalog file size.
157 .It Em e=blocks
158 Set the initial extent overflow file size.
159 .El
160 .It Fl J Ar [journal-size]
161 Creates a journaled HFS+ volume.
162 The default journal size varies, based on the size of the volume. Appending an 'M' to the
163 journal size implies megabytes (i.e. 64M is 64 megabytes).
164 The maximum journal size is 1024 megabytes.
165 .It Fl n Ar node-size-list
166 This specifies the b-tree
167 .Em node
168 sizes, in bytes,
169 for the various b-tree files.
170 .Em Node
171 sizes are specified with the
172 .Fl n
173 option followed by a comma separated list of
174 the form arg=bytes. The
175 .Em node
176 size must be a power of two and no larger than
177 32768 bytes.
178 .Pp
179 Example: -n c=8192,e=4096
180 .Bl -tag -width Fl
181 .It Em a=bytes
182 Set the attribute b-tree node size.
183 .It Em c=bytes
184 Set the catalog b-tree node size.
185 .It Em e=bytes
186 Set the extent overflow b-tree node size.
187 .El
188 .It Fl v Ar volume-name
189 Volume name (file system name) in ascii or UTF-8 format.
190 .El
191 .Sh SEE ALSO
192 .Xr mount 8 ,
193 .Xr pdisk 8
194 .Sh HISTORY
195 The
196 .Nm
197 command appeared in Mac OS X Server 1.0 . As of Mac OS X 10.6, this utility no longer generates HFS standard file systems.