cwfs 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. .TH CWFS 4
  2. .SH NAME
  3. cwfs \- cached-worm file server, dump
  4. .SH SYNOPSIS
  5. .B cwfs
  6. [
  7. .B -f
  8. ] [
  9. .B -a
  10. .I announce-string
  11. ] ... [
  12. .B -m
  13. .I device-map
  14. ]
  15. .I config-device
  16. .SH DESCRIPTION
  17. .I Cwfs
  18. is a cached-worm file server that runs
  19. as a user-mode program and can
  20. maintain file systems created by
  21. .IR fs (4),
  22. the original Plan 9 file server
  23. that had its own kernel and operated
  24. a standalone system with disks and
  25. optical-disc jukebox attached.
  26. Unlike
  27. .IR fs (4),
  28. which could only accept 9P connections over IL/IPv4 on Ethernets
  29. (or over Datakit and Cyclones, long ago),
  30. .I cwfs
  31. accepts 9P connections over any network medium and protocol
  32. that it can announce on,
  33. by default TCP (over IPv4 or IPv6).
  34. Given suitable 9P clients,
  35. one could even run 9P over
  36. .IR aan (8)
  37. or
  38. .IR tls (3).
  39. .PP
  40. The stock
  41. .I cwfs
  42. implements a 16K file system block size
  43. and 32-bit disk addresses,
  44. in order to be compatible with some existing file systems, notably
  45. .IR emelie 's.
  46. These parameters can be changed by recompilation.
  47. .PP
  48. .I Cwfs
  49. expects to find the configuration block on
  50. .IR config-device .
  51. .PP
  52. Options are:
  53. .TF -m
  54. .TP
  55. .B -a
  56. announce on
  57. .I announce-string
  58. instead of
  59. .LR tcp!*!9fs .
  60. .TP
  61. .B -f
  62. enter the file server's configuration mode
  63. before starting normal operation.
  64. .TP
  65. .B -m
  66. the file
  67. .I device-map
  68. contains a simple device name
  69. (e.g.,
  70. .LR w9 )
  71. and a replacement per line.
  72. The device name is in the usual
  73. .I filsys
  74. notation of
  75. .IR fsconfig (8).
  76. The replacement can be the name of an existing file
  77. or another such device name.
  78. For example, the file
  79. .RS
  80. .PD
  81. .IP
  82. .EX
  83. w0 /tmp/w0
  84. h1 w2
  85. .EE
  86. .PP
  87. .PD 0.3v
  88. would map accesses to device
  89. .L w0
  90. to existing file
  91. .LR /tmp/w0
  92. and accesses to device
  93. .L h1
  94. to device
  95. .LR w2 ,
  96. if no file named
  97. .L w2
  98. exists.
  99. .RE
  100. .PD
  101. .PP
  102. The file server normally requires all users except
  103. .L none
  104. to provide authentication tickets on each
  105. .IR attach (5).
  106. This can be disabled using the
  107. .B noauth
  108. configuration command (see
  109. .IR fsconfig (8)).
  110. .PP
  111. The group numbered 9999, normally called
  112. .BR noworld ,
  113. is special
  114. on the file server. Any user belonging to that group has
  115. attenuated access privileges. Specifically, when checking such
  116. a user's access to files, the file's permission bits are first ANDed
  117. with 0770 for normal files or 0771 for directories. The effect is
  118. to deny world access permissions to
  119. .B noworld
  120. users, except
  121. when walking directories.
  122. .PP
  123. The user
  124. .B none
  125. is always allowed to attach to
  126. .B emelie
  127. without authentication but has minimal permissions.
  128. .PP
  129. .B Emelie
  130. maintains three file systems
  131. on a combination of disks and
  132. write-once-read-many (WORM) magneto-optical disks.
  133. .TP
  134. .B other
  135. is a simple disk-based file system similar to
  136. .IR kfs (4) .
  137. .TP
  138. .B main
  139. is a worm-based file system with a disk-based
  140. look-aside cache.
  141. The disk cache holds
  142. modified worm blocks
  143. to overcome the write-once property of the worm.
  144. The cache also holds recently accessed
  145. non-modified blocks to
  146. speed up the effective access time of the worm.
  147. Occasionally
  148. (usually daily at 5AM) the modified blocks in the
  149. disk cache are
  150. .IR dumped .
  151. At this time,
  152. traffic to the file system is halted and the
  153. modified blocks are relabeled to the unwritten
  154. portion of the worm.
  155. After the dump,
  156. the file system traffic is continued and
  157. the relabeled blocks are copied to the worm by
  158. a background process.
  159. .TP
  160. .B dump
  161. Each time the main file system is dumped,
  162. its root is appended to a subdirectory of the dump file system.
  163. Since the dump file system is not mirrored with a disk
  164. cache,
  165. it is read-only.
  166. The name of the newly added root is created from the date
  167. of the dump:
  168. .BI / yyyy / mmdds\f1.
  169. Here
  170. .I yyyy
  171. is the full year,
  172. .I mm
  173. is the month number,
  174. .I dd
  175. is the day number and
  176. .I s
  177. is a sequence number if more than
  178. one dump is done in a day.
  179. For the first dump,
  180. .I s
  181. is null.
  182. For the subsequent dumps
  183. .I s
  184. is 1, 2, 3, etc.
  185. .sp
  186. The root of the main file system
  187. that is frozen on the first dump
  188. of March 1, 1992
  189. will be named
  190. .B /1992/0301/
  191. in the dump file system.
  192. .SS "Changes from fs(4)"
  193. .IR fs (4)'s
  194. IP configuration is ignored and the underlying system's is used.
  195. .PP
  196. Various other
  197. .IR fs (4)
  198. commands have been omitted since they (or equivalents) can now be
  199. executed directly on the underlying CPU server,
  200. notably
  201. .I date
  202. and
  203. .I passwd
  204. (see
  205. .IR auth/wrkey ).
  206. .PP
  207. .IR fs (4)'s
  208. device names
  209. .L h
  210. for IDE disks and
  211. .L m
  212. for Marvell SATA disks are not supported; use
  213. .B -m
  214. to map wren devices to appropriate names under
  215. .BR /dev/sd* .
  216. .PP
  217. The file server kernel seems to have scanned PCI buses
  218. in reverse order from the other Plan 9 kernels,
  219. so systems with multiple SCSI cards may find controller
  220. numbering reversed.
  221. .B -m
  222. can be used to compensate for this if you don't want to change
  223. .I filsys
  224. declarations.
  225. .PP
  226. The file server kernel's
  227. .I config
  228. field in NVRAM was overloaded in recent times to hold a
  229. .IR secstore (1)
  230. key for the CPU hostowner.
  231. Since
  232. .I cwfs
  233. runs on a CPU kernel,
  234. the location of its configuration block must be supplied on the command line.
  235. .PP
  236. Disk labels are now implemented for
  237. .B l
  238. devices.
  239. At the first access of a side,
  240. .I cwfs
  241. will attempt to read the label and verify that it has the correct side
  242. number and byte order; if either is wrong, it will issue a warning.
  243. If the label cannot be read,
  244. .I cwfs
  245. will attempt to write a new label.
  246. .SH EXAMPLES
  247. Place the root of the
  248. .B dump
  249. file system on
  250. .B /n/dump
  251. and show the modified times of the MIPS C compiler
  252. over all dumps in February, 1992:
  253. .IP
  254. .EX
  255. cwfs w0
  256. 9fs dump
  257. ls -l /n/dump/1992/02??/mips/bin/vc
  258. .EE
  259. .PP
  260. To get only one line of output for each version of the compiler:
  261. .IP
  262. .EX
  263. ls -lp /n/dump/1992/02??/mips/bin/vc | uniq
  264. .EE
  265. .SH SOURCE
  266. .B /sys/src/cmd/cwfs
  267. .SH SEE ALSO
  268. .IR yesterday (1),
  269. .IR fs (3),
  270. .IR sd (3),
  271. .IR fs (4),
  272. .IR srv (4),
  273. .IR fs (8),
  274. .IR fsconfig (8)
  275. .br
  276. Sean Quinlan,
  277. ``A Cached WORM File System'',
  278. .I
  279. Software \- Practice and Experience,
  280. December, 1991
  281. .br
  282. Ken Thompson,
  283. Geoff Collyer,
  284. ``The 64-bit Standalone Plan 9 File Server''
  285. .SH BUGS
  286. For the moment,
  287. the file server serves both the old (9P1) and new (9P2000) versions of 9P,
  288. deciding which to serve by sniffing the first packet on each connection.
  289. .PP
  290. File system block size and disk address size (32- or 64-bit) are fixed
  291. at compilation time, and this is not easily changed.