IRIX 5.3 » Man Pages
find in page | jump to first hit | clear highlight
mkfs_efs - construct an EFS file system
/sbin/mkfs_efs [-q] [-a] [-i] [-r] [-n inodes] special [proto]
/sbin/mkfs_efs [-q] [-i] [-r] special blocks inodes heads sectors cgsize
cgalign ialign [proto]
mkfs_efs constructs a file system by writing on the special file using
the values found in the remaining arguments of the command line. Normally
mkfs_efs prints the parameters of the file system to be constructed; the
-q flag suppresses this.
If the -i flag is given, mkfs_efs will ask for confirmation after
displaying the parameters of the file system to be constructed.
The -r flag causes mkfs_efs to write only the superblock, without
touching other areas of the file system. See the section below on the
The -a flag causes mkfs_efs to align inodes and data on cylinder
boundaries (equivalent to setting cgalign and ialign to a cylinder size).
This option can result in a loss of 10MB or more in a file system, since
the resulting cylinder groups are not very flexible in size, and runt
cylinder groups are not allowed. Aligning data and inodes with this
option can result in an increase in performance (about two percent) on
drives that have a fixed number of sectors per track. Many SCSI disk
drives do not have a fixed number of sectors per track, and thus, will
see no benefit from this option.
When the first form of mkfs_efs is used, mkfs_efs obtains information
about the device size and geometry by means of appropriate IOCTLs, and
assigns values to the file system parameters on the basis of this
If the -n option is present, however, the given number of inodes is used
rather than the default. This allows a nonstandard number of inodes to be
assigned without needing to resort to the long form invocation.
If the second form of mkfs_efs is used, then all the file system
parameters must be specified from the command line. Each argument other
than special and proto is interpreted as a decimal number.
The file system parameters are as follows:
blocks is the number of physical (512 byte) disk blocks the file
system will occupy.
Note that the current maximum limit on the size of an EFS filesystem
is 16777214 blocks (two to the 24th power). This could also be
expressed as 8 gigabytes. mkfs_efs will not attempt to make a
filesystem larger than this limit.
inodes is the number of inodes the file system should have as a
heads is an unused parameter, retained only for backward
sectors is the number of sectors per track of the physical medium.
cgsize is the size of each cylinder group, in disk blocks,
cgalign is the boundary, in disk blocks, that a cylinder group
should be aligned to.
ialign is the boundary, in disk blocks, that each cylinder group's
inode list should be aligned to.
Once mkfs_efs has the file system parameters it needs, it then builds a
file system containing two directories. The file system's root directory
is created with one entry, the lost+found directory. The lost+found
directory is filled with zeros out to approximately 10 disk blocks, so as
to allow space for fsck(1M) to reconnect disconnected files. The boot
program block, block zero, is left uninitialized.
If the optional proto argument is given, mkfs_efs uses it as a prototype
file and will take its directions from that file. The blocks and inodes
specifiers in the proto file are provided for backwards compatibility,
but are otherwise unused. The prototype file contains tokens separated
by spaces or new-lines. A sample prototype specification follows (line
numbers have been added to aid in the explanation):
2. 4872 110
3. d--777 3 1
4. usr d--777 3 1
5. sh ---755 3 1 /bin/sh
6. ken d--755 6 1
8. b0 b--644 3 1 0 0
9. c0 c--644 3 1 0 0
10 fifo p--644 3 1
11 slink l--644 3 1 /a/symbolic/link
12 : This is a comment line
Line 1 is a dummy string. (It was formerly the bootfile name). It is
present for backward compatibility; boot blocks are not used on SGI
machines, and mkfs_efs merely clears block zero.
Note that some string of characters must be present as the first line of
the proto file to cause it to be parsed correctly; the value of this
string is immaterial since it is ignored.
Line 2 contains two numeric values (formerly the numbers of blocks and
inodes). These are also merely for backward compatibility: two numeric
values must appear at this point for the proto file to be correctly
parsed, but their values are immaterial since they are ignored.
Lines 3-11 tell mkfs_efs about files and directories to be included in
this file system.
Line 3 specifies the root directory.
lines 4-6 and 8-10 specifies other directories and files. Note the
special symbolic link syntax on line 11.
The $ on line 7 tells mkfs_efs to end the branch of the file system it is
on, and continue from the next higher directory. It must be the last
character on a line. The : on line 12 introduces a comment; all
characters up until the following newline are ignored. Note that this
means you may not have files in a prototype file whose name contains a :.
The $ on lines 13 and 14 end the process, since no additional
File specifications give the mode, the user ID, the group ID, and the
initial contents of the file. Valid syntax for the contents field
depends on the first character of the mode.
The mode for a file is specified by a 6-character string. The first
character specifies the type of the file. The character range is -bcdpl
to specify regular, block special, character special, directory files,
named pipes (fifos) and symbolic links, respectively. The second
character of the mode is either u or - to specify set-user-ID mode or
not. The third is g or - for the set-group-ID mode. The rest of the
mode is a 3-digit octal number giving the owner, group, and other read,
write, execute permissions (see chmod(1)).
Two decimal number tokens come after the mode; they specify the user and
group IDs of the owner of the file.
If the file is a regular file, the next token of the specification may be
a path name whence the contents and size are copied. If the file is a
block or character special file, two decimal numbers follow which give
the major and minor device numbers. If the file is a symbolic link, the
next token of the specification is used as the contents of the link. If
the file is a directory, mkfs_efs makes the entries . and .. and then
reads a list of names and (recursively) file specifications for the
entries in the directory. As noted above, the scan is terminated with
the token $.
The -r flag causes mkfs_efs to write only the superblock, without
touching the remainder of the file system space. This allows a last-ditch
recovery attempt on a file system whose superblocks have been destroyed:
by running mkfs_efs on the device with the -r option, a superblock is
created from which fsck(1M) can obtain the geometry information it needs
to analyze the file system.
Note that this procedure will only be of use if the regenerated
superblock matches the parameters of the original file system. If the
file system was created using the long form invocation, parameters
identical to the original invocation must be given with the -r option.
Note also that file system defaults may change from release to release to
allow more efficient use of newer disk technologies; thus, the -r option
may not be useful for file systems created under IRIX versions other than
the version being run.
It should be clear that this is a limited recovery facility; it will not
help if, for example, the root directory of the file system has been
chmod(1), mkfp(1M), mkfs(1M), mkfs_xfs(1M), dir(4), fs(4)
With a prototype file, it is not possible to specify hard links.
what's new |