gname, not gid
[unix-history] / usr / src / usr.sbin / mkproto / mkproto.8
CommitLineData
b42074ab
CL
1.\" Copyright (c) 1983, 1991 Regents of the University of California.
2.\" All rights reserved.
f25e9191 3.\"
b42074ab 4.\" %sccs.include.redist.man%
f25e9191 5.\"
b42074ab
CL
6.\" @(#)mkproto.8 6.3 (Berkeley) %G%
7.\"
8.Dd
9.Dt MKPROTO 8
10.Os BSD 4.2
11.Sh NAME
12.Nm mkproto
13.Nd construct a prototype file system
14.Sh SYNOPSIS
15.Nm mkproto
16.Ar special proto
17.Sh DESCRIPTION
18.Nm Mkproto
f25e9191
KM
19is used to bootstrap a new file system.
20First a new file system is created using
b42074ab
CL
21.Xr newfs 8 .
22.Nm Mkproto
f25e9191
KM
23is then used to copy files from the old file system into the new
24file system according to the directions found in the prototype file
b42074ab 25.Ar proto .
f25e9191
KM
26The prototype file
27contains tokens separated by spaces or
28new lines.
29The first tokens comprise the specification
30for the root directory.
31File specifications consist of tokens
32giving the mode,
33the user-id,
34the group id,
35and the initial contents of the file.
36The syntax of the contents field
37depends on the mode.
b42074ab 38.Pp
f25e9191
KM
39The mode token for a file is a 6 character string.
40The first character
41specifies the type of the file.
42(The characters
b42074ab 43.Fl bcd
f25e9191
KM
44specify regular, block special,
45character special and directory files
46respectively.)
47The second character of the type
48is either
b42074ab 49.Cm u
f25e9191 50or
b42074ab 51.Ql Fl
f25e9191
KM
52to specify set-user-id mode or not.
53The third is
b42074ab 54.Cm g
f25e9191 55or
b42074ab 56.Ql Fl
f25e9191
KM
57for the set-group-id mode.
58The rest of the mode
59is a three digit octal number giving the
60owner, group, and other read, write, execute
61permissions, see
b42074ab
CL
62.Xr chmod 1 .
63.Pp
f25e9191
KM
64Two decimal number
65tokens come after the mode; they specify the
66user and group ID's of the owner of the file.
b42074ab 67.Pp
f25e9191
KM
68If the file is a regular file,
69the next token is a pathname
70whence the contents and size are copied.
b42074ab 71.Pp
f25e9191
KM
72If the file is a block or character special file,
73two decimal number tokens
74follow which give the major and minor device numbers.
b42074ab 75.Pp
f25e9191 76If the file is a directory,
b42074ab 77.Nm mkproto
f25e9191 78makes the entries
b42074ab 79.Ql \&.
f25e9191 80and
b42074ab 81.Ql \&..
f25e9191
KM
82and then
83reads a list of names and
84(recursively)
85file specifications for the entries
86in the directory.
87The scan is terminated with the
88token
b42074ab
CL
89.Cm $ .
90.Pp
f25e9191 91A sample prototype specification follows:
b42074ab 92.Bd -literal -offset indent
f25e9191
KM
93d\-\-777 3 1
94usr d\-\-777 3 1
95 sh \-\-\-755 3 1 /bin/sh
96 ken d\-\-755 6 1
97 $
98 b0 b\-\-644 3 1 0 0
99 c0 c\-\-644 3 1 0 0
100 $
101$
b42074ab
CL
102.Ed
103.Sh SEE ALSO
104.Xr fs 5 ,
105.Xr dir 5 ,
106.Xr fsck 8 ,
107.Xr newfs 8
108.Sh BUGS
f25e9191 109There should be some way to specify links.
b42074ab 110.Pp
f25e9191 111There should be some way to specify bad blocks.
b42074ab
CL
112.Pp
113.Nm Mkproto
114can only be run on virgin file systems.
f25e9191 115It should be possible to copy files into existent file systems.
b42074ab
CL
116.Sh HISTORY
117The
118.Nm
119command appeared in
120.Bx 4.2 .