mkfs1b(1M) mkfs1b(1M)
NAME
mkfs1b - construct a file system with 512-byte blocks
SYNOPSIS
/etc/mkfs1b special blocks[:inodes] [m n]
/etc/mkfs1b special proto [m n]
DESCRIPTION
mkfs1b constructs a file system by writing on the special
file special. mkfs1b operates exactly like mkfs except that
the logical blocks created are 512 bytes instead of 1024
bytes.
In the first form of the command, a numeric size is given
and mkfs1b builds a file system with a single empty directo-
ry on it. The number of inodes is calculated as a function
of the file system size. m is an interleave factor for
building the freelist and n is a modulo for m. See the ex-
ample for usage.
Note: All file systems should have a lost+found directory
for fsck(1M); this should be created for each file system by
running mklost+found(1M) in the root directory of a newly
created file system, after the file system is first mounted.
In bootstrapping, the second form of mkfs1b is sometimes
used. In this form, the file system is constructed accord-
ing 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 inodes 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 char-
acters -bcd specify regular, block special, character spe-
cial and directory files, respectively.) The second charac-
ter 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 IDs of the owner of the file.
April, 1990 1
mkfs1b(1M) mkfs1b(1M)
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 de-
cimal number tokens follow which give the major and minor
device numbers.
If the file is a directory, mkfs1b 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 $.
A sample prototype specification follows:
/usr/mdec/uboot
4872 55
d--777 3 1
usr d--777 3 1
sh ---755 3 1 /bin/sh
ken d--755 6 1
$
b0 b--644 3 1 0 0
c0 c--644 3 1 0 0
$
$
EXAMPLE
mkfs1b /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 interleave
number which is used to stagger the disk blocks for more ra-
pid reading, every 7 blocks, and 50 is a modulo operator
that forces the sector interlace number first to allocate
all blocks in the first 50 sectors, then the next 50, etc.
Note: The proper selection of the m and n parameters
can improve disk 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 ro-
tational latency and CPU speed.
FILES
/etc/mkfs1b
SEE ALSO
fsck(1M), mklost+found(1M), dir(4).
2 April, 1990
BUGS
The default is 3500, which is probably not useful on any
disk.
There should be some way to specify links.
There should be some way to specify bad blocks.
Should make lost+found automatically.
April, 1990 3