Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ mkfs(8) — Unisoft V7

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

filsys(5)

dir(5)

fsck(8)

mklost+found(8)

MKFS(8)  —  UNIX Programmer’s Manual

NAME

mkfs − construct a file system

SYNOPSIS

mkfs special size [ m n ]
mkfs special proto

DESCRIPTION

Mkfs constructs a file system by writing on the special file special.  In the first form of the command a numeric size is given and mkfs builds a file system with a single empty directory on it.  The number of i-nodes is calculated as a function of the filesystem size. 

N.B.: All filesystems should have a lost+found directory for fsck(8); this should be created for each file system by running mklost+found(8) in the root directory of a newly created file system, after the file system is first mounted.

In bootstrapping, the second form of mkfs is sometimes used.  In this form, the file system is constructed according to the directions found in the prototype file proto.  The prototype file contains tokens separated by spaces or new lines.  The first token is the name of a file to be copied onto sector zero as the bootstrap program.  The second token is a number specifying the size of the created file system.  Typically it will be the number of blocks on the device, perhaps diminished by space for swapping.  The next token is the number of i-nodes in the i-list.  The next set of tokens comprise the specification for the root file.  File specifications consist of tokens giving the mode, the user-id, the group id, and the initial contents of the file.  The syntax of the contents field depends on the mode. 

The mode token for a file is a 6 character string.  The first character specifies the type of the file.  (The characters −bcd specify regular, block special, character special and directory files respectively.)  The second character of the type 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 three 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 ID’s of the owner of the file. 

If the file is a regular file, the next token is a pathname whence the contents and size are copied. 

If the file is a block or character special file, two decimal number tokens follow which give the major and minor device numbers. 

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.  The scan is terminated with the token $. 

EXAMPLE

mkfs /dev/fd0 2000 7 50

makes a file system in which 2000 is the total size of the file system to be put on /dev/fd0; 7 is a sector interface number which is used to stagger the disk blocks for more rapid reading, every 7 blocks, and 50 is a modulo operator that forces the sector interlace number first to allocate all block in the first 50 sectors, then the next 50, etc. 

SEE ALSO

filsys(5), dir(5), fsck(8), mklost+found(8)

BUGS

There should be some way to specify links. 

There should be some way to specify bad blocks. 

Should make lost+found automatically. 

7th Edition  —  5/10/81

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