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
20 # Make a listing on standard output
23 # Use mod time of \fImkfs\fR binary for all files
26 # Use a drive other than 0 or 1 (safety precaution)
29 # Do not test if file system fits on the medium
32 # Make a version 1 file system (for backward compatibility)
35 # Number of i-nodes (files)
38 # Filesystem block size (in bytes)
41 # Filesystem size (in blocks)
44 .B mkfs /dev/fd1 proto
45 # Make a file system on \fI/dev/fd1\fR
47 .B mkfs -b 360 /dev/fd1
48 # Make empty 360 block file system
51 # Alternate way to specify the size
55 builds a file system and copies specified files to it.
56 The prototype file tells which directories and files to copy to it.
57 If the prototype file cannot be opened, and its name is just a string of
58 digits, an empty file system will be made with the specified number of
60 A sample prototype file follows.
61 The text following the \fI#\fR sign in the example below is comment.
62 In real prototype files, comments are not allowed.
65 .ta 0.20i 0.70i 1.10i 3i 3.5i 4i
66 boot # boot block file (ignored)
67 360 63 # blocks and i-nodes
68 d--755 1 1 # root directory
69 bin d--755 \|2 1 # bin dir: mode (755), uid (2), gid (1)
70 sh \|---755 2 1 /user/bin/shell # shell has mode \fIrwxr-xr-x\fP
71 mv -u-755 2 1 /user/bin/mv # u = SETUID bit
72 login -ug755 2 1 /user/bin/login # SETUID and SETGID
74 dev d--755 2 1 # special files: tty (char), fd0 (block)
75 tty c--777 2 1 4 0 # uid=2, gid=1, major=4, minor=0
76 fd0 b--644 2 1 2 0 360 # uid, gid, major, minor, blocks
78 user d--755 12 1 # user dir: mode (755), uid (12), gid (1)
79 ast d--755 12 1 # \fI/user/ast\fP
80 $ # \fI/user/ast\fP is empty
81 $ # end of \fI/user\fP
82 $ # end of root directory
85 The first entry on each line (except the first 3 and the $ lines, which
86 terminate directories) is the name the file or directory will get on the
88 Next comes its mode, with the first character being
89 \fB\-dbc\fR for regular files, directories, block special files and character
90 special files, respectively.
91 The next two characters are used to specify the SETUID and SETGID bits, as
93 The last three characters of the mode are the
97 Following the mode are the uid and gid.
98 For special files, the major and minor devices are needed.
100 The maximum size of a file system is 1 Gb for a version 2 file system,
101 and 64 Mb for a version 1 file system. Alas the 8086
103 runs out of memory on a V2 file system larger than 128 Mb, so for the 8086
106 you have to limit yourself to file systems of that size.