mkfs 3.4 KB

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