mkfs 3.3 KB

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