mkfs(1M) DG/UX R4.11MU05 mkfs(1M)
NAME
mkfs, newfs - create a file system
SYNOPSIS
/usr/sbin/mkfs [options] device_pathname [proto]
[-m free_space]
[-r region_size]
[-i inode_density]
[-f num_inodes]
[-s data_element_log]
[-x index_element_log]
[-S dir_data_element_log]
[-X dir_index_element_log]
[-e first_anniversary_size]
[-E second_anniversary_size]
[-c SVR3_inode_numbering_compatibility]
[density]
[{"pc"|"dos"}]
[gap]
[blocks_per_cyl]]
DESCRIPTION
Mkfs creates an empty file system on a virtual or physical disk. The
required argument device_pathname specifies a block-special or
character-special device node, such as those nodes found in /dev/dsk
or /dev/rdsk. The created file system will span the entire disk
indicated by device_pathname. To create a file system of a
particular size, first create a virtual disk of the desired size (see
admvdisk(1M)), 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:
# /usr/sbin/mkfs device_pathname
In such cases, you may use the Create or Add operation in the
File_System->Local_Filesys menu of sysadm instead of mkfs.
Newfs is identical to mkfs and is retained for Berkeley
compatibility.
Floppy Diskette Options
To format an MS-DOS diskette, type:
# /usr/sbin/mkfs density "dos" device_pathname
where device_pathname specifies the diskette device. The density
argument specifies the diskette capacity. The valid densities for
5.25 inch diskettes are 360kb or 1220kb; for 3.5 inch diskettes,
720kb and 1440kb. The argument "dos" or "pc" indicates that the
diskette should be formatted for use by the DFM file system manager,
dfm(4), which reads and writes MS-DOS diskettes. If present, mkfs
will do a hard format of the diskette and lay down the file system
format, and ignore any other DG/UX file system options.
To format a diskette with a DG/UX file system, leave off the "dos" or
"pc" option. For example, to format 1,440 KB diskette, you would
type:
# mkfs 1440kb /dev/rpdsk/0
If the floppy is physically write protected, the format will fail.
You are required to use the character special (/dev/rpdsk)
representation of the device to format the floppy. If the block
special representation is specified (/dev/pdsk), mfks will attempt to
use the character special form, but the format will fail if the final
component of the pathname is not the same for both devices.
DG/UX Options
The DG/UX file system options and option arguments are:
-m free_space: The minimum percentage of free space the file
system must have. If the file system's free space drops below
this level, only a user with appropriate privilege (See NOTES,
below) 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.
Note that file system space is counted in blocks rather than
bytes. As a result, mkfs might not be able to reserve the
exact percentage of free space specified with this option. It
will round the free space percentage to a value that
represents a whole number of blocks.
-r region_size: 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 4032; 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 virtual disk
being an uneven multiple of DAR size. Each DAR (except the
last one) is required to be large enough to hold the DAR
bitmap, at least 64 inodes, and at least one default sized
data element for files.
-i inode_density: Determines how many inode slots (potential
files) the file system will have. The value specified is the
ratio of usable data bytes in the virtual disk to the number
of inodes; the default is 3500. Any integer greater than zero
may be specified, but the actual density will be rounded down
to an integral multiple of 64 inodes per DAR. Since most file
systems over 241920 blocks will have 60 DARs, you have a
minimum of 3840 inodes per file system if you set the value
for the -i option very high. If you wish to reduce the number
of inodes below the 3840 minimum, you have to reduce the
number of DARs in the file system by using the -r flag to
specify a large region size. If, for example, you wish to
have only 256 inodes in your file system, then you would use a
region size that was 1/4 of the file system size (giving you 4
DARs). The maximum possible number of inodes occurs when
every usable block of the DAR is occupied by inode slots,
except for the required space mention under region_size.
-f num_inodes: Provides an alternate way to specify how many
inode slots (potential files) the file system will have. The
-f option makes it possible to directly specify the desired
number of inode slots in a file system. There is no default
value; -i option defaults will be used if -f is not specified.
The same restrictions that apply to the -i option also apply
to the -f option. Both the -i and -f options may not be
specified at the same time.
-s data_element_log: 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 logarithm. This number must be an integer from 0 to
31, inclusive. The default value is 4 (meaning data elements
of 16 blocks).
-x index_element_log: 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 dir_data_element_log: 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 dir_index_element_log: 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 first_anniversary_size: 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 second_anniversary_size: 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.
-c SVR3_inode_numbering_compatibility: Places a maximum limit of
65536 on the number of inode slots (potential files) that can
be created and supported by the file system. The -c option is
used only to support applications which use SVR3 system call
interfaces, which expect a limited number of inodes. Most file
systems should not use the -c option. By default, mkfs numbers
inodes in a manner incompatible with the expectations of SVR3
system calls.
proto If the argument following device_pathname is a name of a file
that can be opened, it is taken as the pathname of a prototype
file.
gap This argument has no effect. Under System V, the argument can
specify characteristics of the target physical disk, a purpose
that is irrelevant under the DG/UX system.
blocks_per_cyl
This argument has no effect. Under System V, the argument can
specify 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.
DG/UX file systems must occupy the entire virtual disk, so if this
number is not equal to the disk size, mkfs will fail.
The third token is the number of inodes to be created in the file
system. The specified number will be rounded up so that each DAR is
given an equal number (which is itself a multiple of 64) of inodes.
The next set of tokens compose 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 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 "$".
NOTES
On a traditional DG/UX system, appropriate privilege is granted by
having an effective UID of 0 (root). On a system with DG/UX
information security, appropriate privilege is granted by having one
or more specific capabilities enabled in the effective capability set
of the user. See the appropriate_privilege(5) man page for more
information.
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
admpdisk(1M), admvdisk(1M), dfm(4), fsck(1M), sysadm(1M), tunefs(1M),
fs(4) cap_defaults(5).
Licensed material--property of copyright holder(s)