xref: /minix3/minix/usr.sbin/mkfs.mfs/v3/mkfs.mfs.1 (revision 433d6423c39e34ec4b79c950597bb2d236f886be)
1.Dd April 28, 2013
2.Dt MKFS.MFS 1
3.Os MINIX 3
4.Sh NAME
5.Nm mkfs.mfs
6.Nd make a file system
7.Sh SYNOPSIS
8.Nm
9.Op Fl ldtv
10.Op Fl B Ar blocksize
11.Op Fl i Ar inodes
12.Op Fl b Ar blocks
13.Op Fl z Ar zone_shift
14.Op Fl x Ar extra_space
15.Op Fl I Ar fs_offset
16.Op Fl T Ar timestamp
17.Ar special
18.Op Ar prototype
19.Sh OPTIONS
20The following options are available:
21.Bl -tag -width indent
22.It Fl l
23Make a listing on standard output
24.It Fl d
25Use mod time of
26.Nm
27binary for all files
28.It Fl t
29Do not test if file system fits on the medium
30.It Fl v
31Be verbose on standard error stream; more
32.It Fl v
33options add to verbosity
34.It Fl i Ar inodes
35Number of i-nodes (files)
36.It Fl B Ar blocksize
37Filesystem block size (in bytes)
38.It Fl b Ar blocks
39Filesystem size (in blocks)
40.It Fl I Ar fs_offset
41Write filesystem starting at offset (in bytes)
42.It Fl T Ar timestamp
43Use timestamp for inode times
44.It Fl x Ar extra_space
45Extra space after dynamic sizing (blocks and inodes)
46.It Fl z Ar zone_shift
47Logarithm of the size of a zone with respect to a zone.
48With the default value of 0 zones are of the same size as blocks;
49with 1, each zone is made of two blocks; etc.
50.El
51.Sh EXAMPLES
52.Bl -enum
53.It
54Make a file system on
55.Pa /dev/ram1
56.Bd
57.Nm
58.Cm /dev/ram1 proto
59.Ed
60.It
61Make empty 300,000-block file system
62.Bd
63.Nm
64.Cm -b 300000 /dev/c0d0p0s0
65.Ed
66.It
67Alternate way to specify the size
68.Bd
69.Nm
70.Cm /dev/c0d0p0s0 300000
71.Ed
72.El
73.Sh DESCRIPTION
74The
75.Nm
76builds a file system and copies specified files to it.
77The prototype file tells which directories and files to copy to it.
78If the prototype file cannot be opened, and its name is just a string of
79digits, an empty file system will be made with the specified number of
80blocks.
81A sample prototype file follows.
82The text following the \fI#\fR sign in the example below is comment.
83In real prototype files, comments are not allowed.
84.Bd -literal
85	boot			# boot block file (ignored)
86	360 63			# blocks and i-nodes
87	d--755 1 1		# root directory
88	   bin	d--755 \|2 1	# bin dir: mode (755), uid (2), gid (1)
89		sh	\|---755 2 1 /user/bin/shell	# shell has mode \fIrwxr-xr-x\fP
90		mv	-u-755 2 1 /user/bin/mv	# u = SETUID bit
91		login	-ug755 2 1 /user/bin/login	# SETUID and SETGID
92	   $			# end of \fI/bin\fP
93	   dev	d--755 2 1	# special files: tty (char), fd0 (block)
94		tty	c--777 2 1 4 0	# uid=2, gid=1, major=4, minor=0
95		fd0	b--644 2 1 2 0 360	# uid, gid, major, minor, blocks
96	   $			# end of \fI/dev\fP
97	   user	d--755 12 1	# user dir: mode (755), uid (12), gid (1)
98		ast	d--755 12 1	# \fI/user/ast\fP
99		$		# \fI/user/ast\fP is empty
100	   $			# end of \fI/user\fP
101	$			# end of root directory
102.Ed
103.Pp
104The first entry on each line (except the first 3 and the $ lines, which
105terminate directories) is the name the file or directory will get on the
106new file system.
107Next comes its mode, with the first character being
108.Cm -dbcs
109for regular files, directories, block special files, character
110special files, and symlinks, respectively.
111The next two characters are used to specify the SETUID and SETGID bits, as
112shown above.
113The last three characters of the mode are the
114.Cm rwx
115protection bits, in octal notation.
116.Pp
117Following the mode are the uid and gid.
118For special files, the major and minor devices are needed.
119.Sh "SEE ALSO"
120.Xr mkproto 1 ,
121.Xr fsck.mfs 1 ,
122.Xr mount 1 .
123.Sh AUTHORS
124The
125.Nm
126utility was written by
127.An Andy Tanenbaum, Paul Ogilvie, Frans Meulenbroeks, Bruce Evans
128