Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ mkfs(1M) — Interactive 3.2r4.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

chmod(1)

labelit(1M)

dir(4)

fs(4)

mkfs(1M)  —  

NAME

mkfs − construct a file system

SYNOPSIS

/etc/mkfs [ −f ] [ −L ] [−F fsname] [−V volume_name] special blocks[:inodes] [gap blocks/cyl] [−b blocksize]
/etc/mkfs [ −L ] [−F fsname] [−V volume_name] special proto [gap blocks/cyl] [−b blocksize]

DESCRIPTION

mkfs constructs a file system by writing on the special file using the values found in the remaining arguments of the command line.  Unless given the −f option, the command waits 10 seconds before starting to construct the file system.  During this 10-second pause, the command can be aborted by entering the interrupt character, usually delete (DEL). 

The −L option specifies that the file system should be created as an S5L file system, allowing file names longer than the 14-character limit imposed on the S51K and S52K file system types. 

The −F fsname option allows the user to label the created file system in a way similar to the way it is done by the labelit(1M) command. The fsname argument represents the mounted name (for example, root, u, etc.) of the file system. 

The −V volume_name option is used to equate an internal name to a volume name applied externally to the disk pack, diskette, or tape. 

The −b blocksize option specifies the logical block size for the file system.  The logical block size is the number of bytes read or written by the operating system in a single I/O operation.  Valid values for blocksize are 1024 and 2048.  The default is 1024.  A block size of 2048 may be chosen only if the 2K file system package is installed.  If the −b option is used, it may appear last on the command line. 

If the second argument to mkfs is a string of digits, the size of the file system is the value of blocks interpreted as a decimal number.  This is the number of physical (512-byte) disk blocks the file system will occupy.  If the number of inodes is not given, the default is approximately the number of logical blocks divided by 4.  mkfs builds a file system with a single empty directory on it.  The boot program block (block zero) is left uninitialized. 

If the second argument is the name of a file that can be opened, mkfs assumes it to be a prototype file proto, and will take its directions from that file. 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):

1./stand/ diskboot
2.4872 110
3.d−−777 3 1
4.usrd−−777 3 1
5.sh−−−755 3 1 /bin/sh
6.kend−−755 6 1
7.$
8.b0b−−644 3 1 0 0
9.c0c−−644 3 1 0 0
10.linkl−−644 3 1 /tmp
11.$
12.$

Line 1 in the example is the name of a file to be copied onto block zero as the bootstrap program. 

Line 2 specifies the number of physical (512-byte) blocks the file system is to occupy and the number of inodes in the file system. 

Lines 3-10 tell mkfs about files and directories to be included in this file ­system. 

Line 3 specifies the root directory. 

Lines 4-6 and 8-10 specify other directories and files. 

The $ on line 7 tells mkfs to end the branch of the file system it is on, and continue from the next higher directory.  The $ on lines 11 and 12 end the process, since no additional specifications follow. 

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 −bcdl to specify regular, block special, character special, directory, and symbolic link files, 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 string tokens come after the mode; they specify the user and group IDs or names of the owner of the file. 

If the file is a regular file, the next token of the specification may be a path name from which the contents and size are copied.  If several files use the same source file path name, they will all be created as hard links to a single inode, sharing the same data blocks.  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 is the path name to use as the contents of the symbolic.  If the file is a directory, mkfs 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 gap blocks/cyl argument in both forms of the command specifies the rotational gap and the number of blocks/cylinder. 

SEE ALSO

chmod(1), labelit(1M). 
dir(4), fs(4).

NOTES

The maximum number of inodes configurable is 65500. 

If the −L option is not specified, any path name components in the prototype file will be truncated to the 14 character limit of the S51K and S52K file system types. 

ADDED VALUE

This entry, supplied by SunSoft, Inc., contains enhancements to UNIX ­System V. 

\*U  —  Version 1.0

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026