1MKFS(1M) MKFS(1M)
2
3
4
6 mkfs - construct a file system
7
9 /etc/mkfs special proto
10
12 Mkfs constructs a file system by writing on the special file special
13 according to the directions found in the prototype file proto. The
14 prototype file contains tokens separated by spaces or new lines. The
15 first token is the name of a file to be copied onto block zero as the
16 bootstrap program, see bproc(8). The second token is a number specify‐
17 ing the size of the created file system. Typically it will be the num‐
18 ber of blocks on the device, perhaps diminished by space for swapping.
19 The next token is the number of i-nodes in the i-list. The next set of
20 tokens comprise the specification for the root file. File specifica‐
21 tions consist of tokens giving the mode, the user-id, the group id, and
22 the initial contents of the file. The syntax of the contents field
23 depends on the mode.
24
25 The mode token for a file is a 6 character string. The first character
26 specifies the type of the file. (The characters -bcd specify regular,
27 block special, character special and directory files respectively.)
28 The second character of the type is either u or - to specify set-user-
29 id mode or not. The third is g or - for the set-group-id mode. The
30 rest of the mode is a three digit octal number giving the owner, group,
31 and other read, write, execute permissions, see chmod(1).
32
33 Two decimal number tokens come after the mode; they specify the user
34 and group ID's of the owner of the file.
35
36 If the file is a regular file, the next token is a pathname whence the
37 contents and size are copied.
38
39 If the file is a block or character special file, two decimal number
40 tokens follow which give the major and minor device numbers.
41
42 If the file is a directory, mkfs makes the entries . and .. and then
43 reads a list of names and (recursively) file specifications for the
44 entries in the directory. The scan is terminated with the token $.
45
46 If the prototype file cannot be opened and its name consists of a
47 string of digits, mkfs builds a file system with a single empty direc‐
48 tory on it. The size of the file system is the value of proto inter‐
49 preted as a decimal number. The number of i-nodes is calculated as a
50 function of the filsystem size. The boot program is left uninitial‐
51 ized.
52
53 A sample prototype specification follows:
54
55 /usr/mdec/uboot
56 4872 55
57 d--777 3 1
58 usr d--777 3 1
59 sh ---755 3 1 /bin/sh
60 ken d--755 6 1
61 $
62 b0 b--644 3 1 0 0
63 c0 c--644 3 1 0 0
64 $
65 $
66
68 filsys(5), dir(5), bproc(8)
69
71 There should be some way to specify links.
72
73
74
75 MKFS(1M)