Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ mkfs.bell(1M) — GL2 W3.6

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

labelit(1M)

dir(4)

fs(4)

boot(8)

MKFS(1M)  —  Silicon Graphics

NAME

mkfs − construct a file system

SYNOPSIS

/etc/mkfs [ −C cgfsize[:cgisize] [ /-D deviceproto ] [ -G heads sectors ]

special [ proto ]

/etc/mkfs.bell special proto [ m n ]

DESCRIPTION

mkfs constructs an Extent file system by writing on the file special according to the directions found in the remainder of the command line.  The file system is created with (at least) a root directory and the lost+found directory used by fsck(1M). mkfs.bell constructs a Bell file system.  The file system is created with (at least) a root directory.  The optional modifiers are different for the two types of file systems, and are described later. 

The proto argument specifies the size and content of the file system.  If proto is of the form number[:number], mkfs builds a file system with at most the first number of physical blocks and approximately the second number of inodes, containing a root directory.  mkfs (but not mkfs.bell) also creates the directory lost+found used by fsck(1M). The actual sizes are rounded up or down according to a formula. If the second number is not given, the number of inodes is set to approximately the number of logical blocks divided by 5 (4 for a Bell file system).  In either case, the boot program is left uninitialized. 

Otherwise, mkfs uses proto as the name of a description file containing tokens separated by white space.  The first token is the name of a file to be copied onto block zero as the bootstrap program.  The second token is a number specifying the size of the created file system in physical disk blocks.  Typically it will be the number of blocks on the device, perhaps diminished by space for swapping.  The next token is the number of inodes in the file system.  The maximum number of inodes configurable is 65500.  The next set of tokens comprise the specification for the root directory.  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 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 ID’s of the owner of the file. 

If the file is a regular file, the next token is a path name 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 (recursively) a list of names and file specifications for the entries in the directory.  The scan is terminated with the token ‘$’. 

A sample prototype specification follows:

/stand/ diskboot
4872 110
d−−777 3 1
usrd−−777 3 1
sh−−−755 3 1 /bin/sh
kend−−755 6 1
$
b0b−−644 3 1 0 0
c0c−−644 3 1 0 0
$
$

Mkfs Options

mkfs needs the the number of heads, the number of sectors per track, and the size in physical blocks for the disk and partition on which filsys resides.  The cylinder group size, and the number of inodes per cylinder group are also needed.  If these are not specified on the command line, they are read from the disk label (heads, sectors, and size) or computed from a formula (cylinder group size and inodes per cylinder group). 

−C cgfsize[:cgisize]

gives the (approximate) size and number of inodes in a cylinder group.  The actual sizes are rounded up or down according to a formula. 

−Ddevice

specifies another file system device whose disk label parameters are to be used as defaults. 

−G heads sectors

specifies the geometry of the disk on which filsys resides. 

Mkfs.bell Options

The optional m and n arguments to mkfs.bell are used to tune the construction of the freelist (and thus the allocation of files) for particular disk on which filsys resides.  mkfs.bell will process m consecutive blocks at a time, arranging them such that consecutive allocations are mostly n blocks apart.  Typically, n is the number of logical blocks per cylinder.  A default will be used if the supplied m or n is missing or illegal.  The proper selection of the m and n parameters can improve file system efficiency.  Disks which have full or partial track buffering should specify a m and n of 1 and 1; m and n for other disks must be determined by trial and error as the disk latency is related to rotational latency and CPU speed. 

EXAMPLE

mkfs −D /dev/md0a /dev/rmd1a

makes a minimal Extent file system on /dev/rmd1a, with the same parameters as /dev/md0a.

mkfs.bell /dev/fd0 2000 7 50

makes a minimal Bell file system of size 2000 on disk /dev/fd0. The freelist is processed 50 blocks at a time, in such a way that consecutive allocations will be mostly 7 blocks apart.

SEE ALSO

labelit(1M), dir(4), fs(4), boot(8)

BUGS

If a prototype is used, it is not possible to initialize a file larger than 64K bytes, nor is there a way to specify links. 

Version 3.6  —  December 20, 1987

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