]> git.saurik.com Git - apple/hfs.git/blob - newfs_hfs/newfs_hfs.8
hfs-407.200.4.tar.gz
[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 D Ar journal-device
37 .Op Fl n Ar node-size-list
38 .Op Fl v Ar volume-name
39 .Ar special
40 .Nm newfs_hfs
41 .Fl N Ar partition-size
42 .Op Fl U Ar uid
43 .Op Fl G Ar gid
44 .Op Fl M Ar mask
45 .Op Fl P
46 .Op Fl h | w
47 .Op Fl s
48 .Op Fl b Ar block-size
49 .Op Fl c Ar clump-size-list
50 .Op Fl i Ar first-cnid
51 .Op Fl J Ar [journal-size]
52 .Op Fl D Ar journal-device
53 .Op Fl n Ar node-size-list
54 .Op Fl v Ar volume-name
55 .Sh DESCRIPTION
56 .Nm Newfs_hfs
57 builds an HFS Plus file system on the specified special device.
58 Before running
59 .Nm newfs_hfs
60 the disk should be partitioned using the
61 .Em Disk Utility
62 application or
63 .Xr pdisk 8 .
64 .Pp
65 The file system default parameters are calculated based on
66 the size of the disk partition. Typically the defaults are
67 reasonable, however
68 .Nm newfs_hfs
69 has several options to allow the defaults to be selectively overridden.
70 The options are as follows:
71 .Bl -tag -width Fl
72 .It Fl N Ar [partition-size]
73 Causes the file system parameters to be printed out
74 without really creating the file system.
75 If the argument following the
76 .Fl N
77 starts with a decimal digit, it is assumed to be a partition size.
78 The paritition size may be given in decimal, octal (with leading `0'),
79 or hexadecimal (with leading `0x').
80 The partition size argument can be specified in 512-byte blocks (with a `b' suffix),
81 petabytes (`p' suffix), terabytes (`t' suffix), gigabytes
82 (`g' suffix), megabytes (`m' suffix), or kilobytes
83 (`k' suffix). All suffixes indicate binary, not decimal,
84 multipliers (e.g., `1k' is 1024 bytes). If no suffix is
85 specified, the value is assumed to be in bytes; if an illegal
86 suffix is specified, it results in a size of 0 bytes.
87 .Pp
88 If the partition size is given, then no special device argument shall be provided.
89 If no partition size is given, then the size of the given special device
90 is used instead, and the special device will not be written to.
91 .It Fl U Ar uid
92 Set the owner of the file system's root directory to
93 .Pa uid .
94 .It Fl G Ar gid
95 Set the group of the file system's root directory to
96 .Pa gid .
97 .It Fl M Ar mask
98 Specify the octal access permissions mask for the file system's root
99 directory.
100 .It Fl P
101 Set kHFSContentProtectionBit in the volume's attributes, which will cause the
102 volume to be mounted with the "protect" option if the kernel supports it.
103 .It Fl s
104 Creates a case-sensitive HFS Plus filesystem. By
105 default a case-insensitive filesystem is created.
106 Case-sensitive HFS Plus file systems require a Mac OS X
107 version of 10.3 (Darwin 7.0) or later.
108 .It Fl b Ar block-size
109 The allocation block size of the file system.
110 The default value is 4096.
111 .It Fl c Ar clump-size-list
112 This specifies the
113 .Em clump
114 and/or
115 .Em initial
116 sizes, in allocation
117 blocks, for the various metadata files.
118 .Em Clump
119 sizes are specified with the
120 .Fl c
121 option followed by a comma
122 separated list of the form arg=blocks.
123 .Pp
124 Example: -c c=5000,e=500
125 .Bl -tag -width Fl
126 .It Em a=blocks
127 Set the attribute file clump size.
128 .It Em b=blocks
129 Set the allocation bitmap file clump size.
130 .It Em c=blocks
131 Set the catalog file clump size.
132 .It Em d=blocks
133 Set the data fork clump size.
134 .It Em e=blocks
135 Set the extent overflow file clump size.
136 .It Em r=blocks
137 Set the resource fork clump size.
138 .El
139 .It Fl i Ar first-cnid
140 This specifies the initial catalog node ID for user files
141 and directories. The default value is 16.
142 .It Fl I Ar initial-size-list
143 This specifies the
144 .Em initial
145 size, in allocation
146 blocks, for the various metadata files.
147 .Em Initial
148 sizes are specified with the
149 .Fl I
150 option followed by a comma
151 separated list of the form arg=blocks.
152 .Pp
153 Example: -I c=5000,e=500
154 .Bl -tag -width Fl
155 .It Em a=blocks
156 Set the initial attribute file size.
157 .It Em c=blocks
158 Set the initial catalog file size.
159 .It Em e=blocks
160 Set the initial extent overflow file size.
161 .El
162 .It Fl J Ar [journal-size]
163 Creates a journaled HFS+ volume.
164 The default journal size varies, based on the size of the volume. Appending an 'M' to the
165 journal size implies megabytes (i.e. 64M is 64 megabytes).
166 The maximum journal size is 1024 megabytes.
167 .It Fl D Ar journal-device
168 Creates the journal on special device
169 .Em journal-device.
170 .It Fl n Ar node-size-list
171 This specifies the b-tree
172 .Em node
173 sizes, in bytes,
174 for the various b-tree files.
175 .Em Node
176 sizes are specified with the
177 .Fl n
178 option followed by a comma separated list of
179 the form arg=bytes. The
180 .Em node
181 size must be a power of two and no larger than
182 32768 bytes.
183 .Pp
184 Example: -n c=8192,e=4096
185 .Bl -tag -width Fl
186 .It Em a=bytes
187 Set the attribute b-tree node size.
188 .It Em c=bytes
189 Set the catalog b-tree node size.
190 .It Em e=bytes
191 Set the extent overflow b-tree node size.
192 .El
193 .It Fl v Ar volume-name
194 Volume name (file system name) in ascii or UTF-8 format.
195 .El
196 .Sh SEE ALSO
197 .Xr mount 8 ,
198 .Xr pdisk 8
199 .Sh HISTORY
200 The
201 .Nm
202 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.