mkfs(1m) DG/UX 4.30 mkfs(1m)
NAME
mkfs, newfs - create a file system
SYNOPSIS
/etc/mkfs special [-m freespace] [-r regionsize] [-i
inodedensity]
[-s dataelementlog] [-x indexelementlog] [-S
dirdataelementlog]
[-X dirindexelementlog] [-e firstanniversarysize]
[-E secondanniversarysize] [ {proto, blocks[:inodes]}
[gap blockspercyl]]
DESCRIPTION
Mkfs creates an empty file system on a logical or physical
disk. The argument <special> must be a block-special or
character-special device node, such as those nodes found in
/dev/dsk or /dev/rdsk. The file system will span the entire
disk; to create a file system of a particular size, first
create a logical disk of that size with diskman(1m) and then
run mkfs on that disk. Most invocations of mkfs will not
need to alter the defaults, so no option arguments need to
be specified:
# /etc/mkfs /dev/rdsk/<special>
Newfs is identical to mkfs and is retained for Berkeley
compatibility.
Arguments are:
special
This is the name of the disk upon which a file system
is to be created. Special must be the pathname of a
writable character-special or block-special file.
-m freespace: The minimum percentage of free space the
file system must have. If the file system's free space
drops below this level, only a superuser can allocate
more space. The value for free space must be an
integer in the range 0 to 99, inclusive. The default
value is 10%.
-r regionsize: Determines how many blocks each Disk
Allocation Region (DAR) in the file system will occupy
(including the bitmap, inode table, and data blocks).
This number must be an integer greater than or equal to
1000; the default value is based on the size of the
file system. The last DAR created may be smaller than
all others due to the target logical disk being an
uneven multiple of DAR size.
-i inodedensity: Determines how many inode slots
Licensed material--property of copyright holder(s) Page 1
mkfs(1m) DG/UX 4.30 mkfs(1m)
(potential files) the file system will have. The value
specified is the ratio of usable data bytes in the
logical disk to the number of inodes; the default is
3500. Any non-negative integer may be specified, but
the actual density will be rounded up to the next
integral multiple of 4 inodes per DAR. The maximum
possible number of inodes occurs when every usable
block of the DAR is occupied by inode slots.
-s dataelementlog: Determines the default data element
size of files to be created in the new file system.
The value specified is the element size in disk blocks,
expressed as a base 2 logarthm. This number must be an
integer from 0 to 31, inclusive. The default value is
4 (meaning data elements of 16 blocks).
-x indexelementlog: Determines the default index
element size of files to be created in the new file
system. The value specified is the element size in
disk blocks, expressed as a base 2 logarithm. This
number must be an integer from 0 to 15, inclusive; the
default value is 0 (meaning index elements of 1 block).
-S dirdataelementlog: Determines the default data
element size of directories to be created in the new
file system. The value specified is the element size
in disk blocks, expressed as a base 2 logarithm. This
number must be an integer from 0 to 31, inclusive; the
default value is 4 (meaning data elements of 16
blocks).
-X dirindexelementlog: Determines the default index
element size of directories to be created in the new
file system. The value specified is the element size
in disk blocks, expressed as a base 2 logarithm. This
number must be an integer from 0 to 15, inclusive; the
default value is 0 (meaning index elements of 1 block).
-e firstanniversarysize: Determines the maximum number
of blocks a file can allocate in its initial disk
allocation region before subsequent allocation requests
are redirected to a different region. This number must
be a positive integer; the default is determined based
on the size of the disk allocation region.
-E secondanniversarysize: Determines the maximum number
of blocks a file can allocate in any noninitial disk
allocation region before subsequent allocation requests
are redirected to a different region. This number must
be a positive integer greater than
first_anniversary_size; the default is determined based
on the size of the disk allocation region.
Licensed material--property of copyright holder(s) Page 2
mkfs(1m) DG/UX 4.30 mkfs(1m)
proto
If the argument following special is a non-numeric name
of a file that can be opened, it is taken as the
pathname of a prototype file.
blocks
If the argument following special is numeric, it is
interpreted as a decimal number specifying the size of
the file system in 512-byte disk blocks. However,
DG/UX file systems must occupy the entire logical disk,
so if this number is not equal to the disk size, mkfs
will fail.
inodes
If this argument is specified, it is taken as the
number of inodes to be created in the file system.
However, the specified number will be rounded up so
that each DAR is given an equal number (which is itself
a multiple of 4) of inodes. The same purpose can be
achieved through use of the -i option.
gap If this argument is specified, it is completely
ignored. Under System V it is used to allow for
characteristics of the target physical disk, a purpose
that is irrelevant under the DG/UX system.
blockspercyl
If this argument is specified, it is completely
ignored. Under System V it is used to allow for
characteristics of the target physical disk, a purpose
that is irrelevant under the DG/UX system.
Prototype File Format
The prototype file format is as follows. The file contains
tokens separated by spaces or new lines. The first token is
the name of the bootstrap program; this is completely
ignored since mkfs does not need to install bootstraps.
The second token is the size of the file system in disk
blocks; it is subject to exactly the same constraints as the
blocks argument.
The third token is the number of inodes to be created in the
file system; it is subject to exactly the same constraints
as the inodes argument.
The next set of tokens comprise the specification for the
root directory: the mode, the user id, the group id and the
initial contents. The syntax of the contents field depends
on the file mode. The mode token for a file is a six-
character string. The first character specifies the file
type using the same rules as ls(1). The second character is
Licensed material--property of copyright holder(s) Page 3
mkfs(1m) DG/UX 4.30 mkfs(1m)
either "u" or "-" to specify setuid or not. The third
character is either "g" or "-" to specify setgid or not.
The rest of the mode is a 3 digit octal number in the same
manner as ls(1). Two decimal number tokens follow the mode;
they specify the user and group ids of the file's owner.
If the file is an ordinary file, the next token is a
pathname from which the contents and size are copied. If
the file is a block-special or character special file, two
decimal tokens follow which give the file's major and minor
device numbers. If the file is a directory, mkfs makes the
entries specified. This specification may be recursive;
each directory is terminated with the token "$".
DIAGNOSTICS
Mkfs will have no output except for diagnostic output in the
case of errors. Mkfs will return an exit status of 0 if and
only if the specified file system was successfully created.
Otherwise, mkfs will return 1.
SEE ALSO
fsck(1m), tunefs(1m), diskman(1m), fs(4)
Licensed material--property of copyright holder(s) Page 4