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