]> git.lizzy.rs Git - plan9front.git/blob - sys/man/8/mkfs
audiohda: fix syntax error
[plan9front.git] / sys / man / 8 / mkfs
1 .TH MKFS 8
2 .SH NAME
3 mkfs, mkext \- archive or update a file system
4 .SH SYNOPSIS
5 .B disk/mkfs
6 .RB [ -aprvoxU ]
7 .RB [ -d
8 .IR root ]
9 .RB [ -s
10 .IR source ]
11 .RB [ -z
12 .IR n ]
13 .I proto ...
14 .PP
15 .B disk/mkext
16 .RB [ -d
17 .IR name ]
18 .RB [ -u ]
19 .RB [ -h ]
20 .RB [ -v ]
21 .RB [ -x ]
22 .RB [ -T ]
23 .I file ...
24 .SH DESCRIPTION
25 .I Mkfs
26 copies files from the file tree
27 .I source
28 (default
29 .BR / )
30 to a new file system
31 .I root
32 (default
33 .BR /n/newfs ).
34 The
35 .I proto
36 files are read
37 (see
38 .IR proto (2)
39 for their format)
40 and any files specified in them that are out of date are copied.
41 .PP
42 .I Mkfs
43 copies only those files that are out of date.
44 Such a file is first copied into a temporary
45 file in the appropriate destination directory
46 and then moved to the destination file.
47 Files that are not specified in the
48 .I proto
49 file
50 are not updated and not removed.
51 .PP
52 The options to
53 .I mkfs
54 are:
55 .TF "s source"
56 .TP
57 .B a
58 Instead of writing to new file system,
59 write an archive file to standard output, suitable for
60 .IR mkext .
61 All files in
62 .IR proto ,
63 not just those out of date, are archived.
64 .TP
65 .B x
66 For use with
67 .BR -a ,
68 this option writes a list of file names, dates, and sizes to standard output
69 rather than producing an archive file.
70 .TP
71 .B o
72 Similar to
73 .BR -x
74 above, but produces a list of source file names to standard output
75 rather than producing an archive file.
76 .TP
77 .BI "d " root
78 Copy files into the tree rooted at
79 .I root 
80 (default
81 .BR /n/newfs ).
82 This option suppresses setting the
83 .B uid
84 and
85 .B gid
86 fields when copying files.
87 Use
88 .B -U
89 to reenable it. 
90 .TP
91 .B p
92 Update the permissions of a file even if it is up to date.
93 .TP
94 .B U
95 Update of uid and gid of the target files.
96 .TP
97 .B r
98 Copy all files.
99 .TP
100 .BI "s " source
101 Copy from files rooted at the tree
102 .IR source .
103 .TP
104 .B v
105 Print the names of all of the files as they are copied.
106 .TP
107 .BI "z " n
108 Copy files assuming block size
109 .I n
110 (default 1024)
111 bytes long.
112 If a block contains only 0-valued bytes, it is not copied.
113 .PD
114 .PP
115 .I Mkext
116 unpacks archive files made by the
117 .B -a
118 option of
119 .IR mkfs .
120 Each file on the command line is unpacked in one pass through the archive.
121 If the file is a directory,
122 all files and subdirectories of that directory are also unpacked.
123 When a file is unpacked, the entire path is created if it
124 does not exist.
125 If no files are specified, the entire archive is unpacked;
126 in this case, missing intermediate directories are not created.
127 The options are:
128 .TP
129 .B d
130 specifies a directory (default
131 .BR / )
132 to serve as the root of the unpacked file system.
133 .TP
134 .B u
135 sets the owners of the files created to correspond to
136 those in the archive and restores the modification times of the files.
137 .TP
138 .B T
139 restores only the modification times of the files.
140 .TP
141 .B v
142 prints the names and sizes of files as they are extracted.
143 .TP
144 .B h
145 prints headers for the files on standard output
146 instead of unpacking the files.
147 .PD
148 .SH EXAMPLES
149 .PP
150 Make an archive to establish a new file system:
151 .IP
152 .EX
153 disk/mkfs -a -s dist proto > arch
154 .EE
155 .PP
156 Unpack that archive onto a new file system:
157 .IP
158 .EX
159 srv newfs
160 mount -c /srv/newfs /n/newfs
161 disk/mkext -u -d /n/newfs < arch
162 .EE
163 .SH SOURCE
164 .B /sys/src/cmd/disk/mkfs.c
165 .br
166 .B /sys/src/cmd/disk/mkext.c
167 .SH "SEE ALSO"
168 .IR prep (8),
169 .IR sd (3),
170 .IR tar (1)