Commit | Line | Data |
---|---|---|
e6817382 BJ |
1 | .TH MKFS 1M |
2 | .SH NAME | |
3 | mkfs \- construct a file system | |
4 | .SH SYNOPSIS | |
5 | .B /etc/mkfs | |
6 | special | |
7 | proto | |
8 | .SH DESCRIPTION | |
9 | .I Mkfs | |
10 | constructs a file system | |
11 | by writing on the special file | |
12 | .I special | |
13 | according to the directions | |
14 | found in | |
15 | the prototype file | |
16 | .I proto. | |
17 | The prototype file | |
18 | contains tokens separated by spaces or | |
19 | new lines. | |
20 | The first token is the name of a file | |
21 | to be copied onto block zero as | |
22 | the bootstrap program, | |
23 | see | |
24 | .IR bproc (8). | |
25 | The second token is a number specifying the | |
26 | size of the created file system. | |
27 | Typically it will be the number of blocks on the device, | |
28 | perhaps diminished | |
29 | by space for swapping. | |
30 | The next token is the number of i-nodes | |
31 | in the i-list. | |
32 | The next set of tokens comprise the specification | |
33 | for the root file. | |
34 | File specifications consist of tokens | |
35 | giving the mode, | |
36 | the user-id, | |
37 | the group id, | |
38 | and the initial contents of the file. | |
39 | The syntax of the contents field | |
40 | depends on the mode. | |
41 | .PP | |
42 | The mode token for a file is a 6 character string. | |
43 | The first character | |
44 | specifies the type of the file. | |
45 | (The characters | |
46 | .B \-bcd | |
47 | specify regular, block special, | |
48 | character special and directory files | |
49 | respectively.) | |
50 | The second character of the type | |
51 | is either | |
52 | .B u | |
53 | or | |
54 | .B \- | |
55 | to specify set-user-id mode or not. | |
56 | The third is | |
57 | .B g | |
58 | or | |
59 | .B \- | |
60 | for the set-group-id mode. | |
61 | The rest of the mode | |
62 | is a three digit octal number giving the | |
63 | owner, group, and other read, write, execute | |
64 | permissions, see | |
65 | .IR chmod (1). | |
66 | .PP | |
67 | Two decimal number | |
68 | tokens come after the mode; they specify the | |
69 | user and group ID's of the owner of the file. | |
70 | .PP | |
71 | If the file is a regular file, | |
72 | the next token is a pathname | |
73 | whence the contents and size are copied. | |
74 | .PP | |
75 | If the file is a block or character special file, | |
76 | two decimal number tokens | |
77 | follow which give the major and minor device numbers. | |
78 | .PP | |
79 | If the file is a directory, | |
80 | .I mkfs | |
81 | makes the entries | |
82 | .BR . "" | |
83 | and | |
84 | .B .. | |
85 | and then | |
86 | reads a list of names and | |
87 | (recursively) | |
88 | file specifications for the entries | |
89 | in the directory. | |
90 | The scan is terminated with the | |
91 | token | |
92 | .BR $ . | |
93 | .PP | |
94 | If the prototype file cannot be opened and | |
95 | its name consists of a string of digits, | |
96 | .I mkfs | |
97 | builds a file system with a single | |
98 | empty directory on it. | |
99 | The size of the file system is the value | |
100 | of | |
101 | .I proto | |
102 | interpreted as a decimal number. | |
103 | The number of i-nodes is calculated | |
104 | as a function of the filsystem size. | |
105 | The boot program is left uninitialized. | |
106 | .PP | |
107 | A sample prototype specification follows: | |
108 | .PP | |
109 | .nf | |
110 | .in +5 | |
111 | /usr/mdec/uboot | |
112 | 4872 55 | |
113 | d\-\-777 3 1 | |
114 | usr d\-\-777 3 1 | |
115 | sh \-\-\-755 3 1 /bin/sh | |
116 | ken d\-\-755 6 1 | |
117 | $ | |
118 | b0 b\-\-644 3 1 0 0 | |
119 | c0 c\-\-644 3 1 0 0 | |
120 | $ | |
121 | $ | |
122 | .in -5 | |
123 | .fi | |
124 | .SH "SEE ALSO" | |
125 | filsys(5), | |
126 | dir(5), | |
127 | bproc(8) | |
128 | .SH BUGS | |
129 | There should be some way to specify links. | |
130 | There should be some way to specify bad blocks. |