newfs_hfs.8   [plain text]

.\" Copyright (c) 2002-2003 Apple Computer, Inc. All rights reserved.
.\" The contents of this file constitute Original Code as defined in and
.\" are subject to the Apple Public Source License Version 1.1 (the
.\" "License").  You may not use this file except in compliance with the
.\" License.  Please obtain a copy of the License at
.\" and read it before using this file.
.\" This Original Code and all software distributed under the License are
.\" distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
.\" License for the specific language governing rights and limitations
.\" under the License.
.\"     @(#)newfs_hfs.8
.Dd June 19, 2008
.Os "Mac OS X"
.Nm newfs_hfs
.Nd construct a new HFS Plus file system
.Nm newfs_hfs
.Op Fl N
.Op Fl U Ar uid
.Op Fl G Ar gid
.Op Fl M Ar mask
.Op Fl P
.Op Fl s
.Op Fl b Ar block-size
.Op Fl c Ar clump-size-list
.Op Fl i Ar first-cnid
.Op Fl J Ar [journal-size]
.Op Fl n Ar node-size-list
.Op Fl v Ar volume-name
.Ar special
.Nm newfs_hfs
.Fl N Ar partition-size
.Op Fl U Ar uid
.Op Fl G Ar gid
.Op Fl M Ar mask
.Op Fl P
.Op Fl h | w
.Op Fl s
.Op Fl b Ar block-size
.Op Fl c Ar clump-size-list
.Op Fl i Ar first-cnid
.Op Fl J Ar [journal-size]
.Op Fl n Ar node-size-list
.Op Fl v Ar volume-name
.Nm Newfs_hfs
builds an HFS Plus file system on the specified special device.
Before running 
.Nm newfs_hfs
the disk should be partitioned using the
.Em Disk Utility
application or
.Xr pdisk 8 .
The file system default parameters are calculated based on
the size of the disk partition. Typically the defaults are
reasonable, however
.Nm newfs_hfs
has several options to allow the defaults to be selectively overridden.
The options are as follows:
.Bl -tag -width Fl
.It Fl N Ar [partition-size]
Causes the file system parameters to be printed out
without really creating the file system.
If the argument following the
.Fl N
starts with a decimal digit, it is assumed to be a partition size.
The paritition size may be given in decimal, octal (with leading `0'),
or hexadecimal (with leading `0x').
The partition size argument can be specified in 512-byte blocks (with a `b' suffix),
petabytes (`p' suffix), terabytes (`t' suffix), gigabytes
(`g' suffix), megabytes (`m' suffix), or kilobytes
(`k' suffix).  All suffixes indicate binary, not decimal,
multipliers (e.g., `1k' is 1024 bytes).  If no suffix is
specified, the value is assumed to be in bytes; if an illegal
suffix is specified, it results in a size of 0 bytes.
If the partition size is given, then no special device argument shall be provided.
If no partition size is given, then the size of the given special device
is used instead, and the special device will not be written to.
.It Fl U Ar uid
Set the owner of the file system's root directory to
.Pa uid .
.It Fl G Ar gid
Set the group of the file system's root directory to
.Pa gid .
.It Fl M Ar mask
Specify the octal access permissions mask for the file system's root
.It Fl P
Set kHFSContentProtectionBit in the volume's attributes, which will cause the 
volume to be mounted with the "protect" option if the kernel supports it.
.It Fl s
Creates a case-sensitive HFS Plus filesystem. By
default a case-insensitive filesystem is created.
Case-sensitive HFS Plus file systems require a Mac OS X
version of 10.3 (Darwin 7.0) or later. 
.It Fl b Ar block-size
The allocation block size of the file system.  
The default value is 4096.
.It Fl c Ar clump-size-list
This specifies the
.Em clump
.Em initial
sizes, in allocation
blocks, for the various metadata files.
.Em Clump
sizes are specified with the
.Fl c
option followed by a comma
separated list of the form arg=blocks.
Example:  -c c=5000,e=500
.Bl -tag -width Fl
.It Em a=blocks
Set the attribute file clump size.
.It Em b=blocks
Set the allocation bitmap file clump size.
.It Em c=blocks
Set the catalog file clump size.
.It Em d=blocks
Set the data fork clump size.
.It Em e=blocks
Set the extent overflow file clump size.
.It Em r=blocks
Set the resource fork clump size.
.It Fl i Ar first-cnid
This specifies the initial catalog node ID for user files
and directories. The default value is 16.
.It Fl J Ar [journal-size]
Creates a journaled HFS+ volume.
The default journal size varies, based on the size of the volume.  Appending an 'M' to the
journal size implies megabytes (i.e. 64M is 64 megabytes).
The maximum journal size is 1024 megabytes.
.It Fl n Ar node-size-list
This specifies the b-tree
.Em node
sizes, in bytes,
for the various b-tree files.
.Em Node
sizes are specified with the
.Fl n
option followed by a comma separated list of
the form arg=bytes. The
.Em node
size must be a power of two and no larger than
32768 bytes.
Example:  -n c=8192,e=4096
.Bl -tag -width Fl
.It Em a=bytes
Set the attribute b-tree node size.
.It Em c=bytes
Set the catalog b-tree node size.
.It Em e=bytes
Set the extent overflow b-tree node size.
.It Fl v Ar volume-name
Volume name (file system name) in ascii or UTF-8 format.
.Xr mount 8 ,
.Xr pdisk 8
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.