3 mkfs \- make a file system
5 \fBmkfs \fR[\fB\-Ldot\fR] [\fB\-B \fIblocksize\fR] [\fB\-i \fIinodes\fR] [\fB\-b \fIblocks\fR] \fIspecial \fIprototype\fR
18 .FL "\-L" "Make a listing on standard output"
19 .FL "\-d" "Use mod time of \fImkfs\fR binary for all files"
20 .FL "\-o" "Use a drive other than 0 or 1 (safety precaution)"
21 .FL "\-t" "Do not test if file system fits on the medium"
22 .FL "\-1" "Make a version 1 file system (for backward compatibility)"
23 .FL "\-i" "Number of i-nodes (files)"
24 .FL "\-B" "Filesystem block size (in bytes)"
25 .FL "\-b" "Filesystem size (in blocks)"
27 .EX "mkfs /dev/fd1 proto" "Make a file system on \fI/dev/fd1\fR"
28 .EX "mkfs -b 360 /dev/fd1" "Make empty 360 block file system"
29 .EX "mkfs /dev/fd1 360" "Alternate way to specify the size"
33 builds a file system and copies specified files to it.
34 The prototype file tells which directories and files to copy to it.
35 If the prototype file cannot be opened, and its name is just a string of
36 digits, an empty file system will be made with the specified number of
38 A sample prototype file follows.
39 The text following the \fI#\fR sign in the example below is comment.
40 In real prototype files, comments are not allowed.
43 .ta 0.20i 0.70i 1.10i 3i 3.5i 4i
44 boot # boot block file (ignored)
45 360 63 # blocks and i-nodes
46 d--755 1 1 # root directory
47 bin d--755 \|2 1 # bin dir: mode (755), uid (2), gid (1)
48 sh \|---755 2 1 /user/bin/shell # shell has mode \fIrwxr-xr-x\fP
49 mv -u-755 2 1 /user/bin/mv # u = SETUID bit
50 login -ug755 2 1 /user/bin/login # SETUID and SETGID
52 dev d--755 2 1 # special files: tty (char), fd0 (block)
53 tty c--777 2 1 4 0 # uid=2, gid=1, major=4, minor=0
54 fd0 b--644 2 1 2 0 360 # uid, gid, major, minor, blocks
56 user d--755 12 1 # user dir: mode (755), uid (12), gid (1)
57 ast d--755 12 1 # \fI/user/ast\fP
58 $ # \fI/user/ast\fP is empty
59 $ # end of \fI/user\fP
60 $ # end of root directory
63 The first entry on each line (except the first 3 and the $ lines, which
64 terminate directories) is the name the file or directory will get on the
66 Next comes its mode, with the first character being
67 \fB\-dbc\fR for regular files, directories, block special files and character
68 special files, respectively.
69 The next two characters are used to specify the SETUID and SETGID bits, as
71 The last three characters of the mode are the
75 Following the mode are the uid and gid.
76 For special files, the major and minor devices are needed.
78 The maximum size of a file system is 1 Gb for a version 2 file system,
79 and 64 Mb for a version 1 file system. Alas the 8086
81 runs out of memory on a V2 file system larger than 128 Mb, so for the 8086
84 you have to limit yourself to file systems of that size.