fsconfig 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396
  1. .TH FSCONFIG 8
  2. .SH NAME
  3. fsconfig \- configuring a file server
  4. .SH SYNOPSIS
  5. .B service
  6. .I name
  7. .PP
  8. .B config
  9. .I device
  10. .PP
  11. .B nvram
  12. .I device
  13. .PP
  14. .B filsys
  15. .I name
  16. .I device
  17. .PP
  18. .B ip
  19. .I ipaddr
  20. .PP
  21. .B ipgw
  22. .I ipaddr
  23. .PP
  24. .B ipmask
  25. .I ipaddr
  26. .PP
  27. .B ipauth
  28. .I ipaddr
  29. .PP
  30. .B ipsntp
  31. .I ipaddr
  32. .PP
  33. .B ream
  34. .I name
  35. .PP
  36. .B recover
  37. .I name
  38. .PP
  39. .B allow
  40. .PP
  41. .B readonly
  42. .PP
  43. .B noauth
  44. .PP
  45. .B noattach
  46. .PP
  47. .B copyworm
  48. .PP
  49. .B halt
  50. .PP
  51. .B end
  52. .SH DESCRIPTION
  53. When a file server's configuration has not been set,
  54. or by explicit request early in the server's initialization (see
  55. .IR fs (8)),
  56. the server enters `config mode'. The commands described here
  57. apply only in that mode. They establish configuration constants
  58. that are typically valid for the life of the server, and therefore
  59. need be run only once. If the non-volatile RAM on the server
  60. gets erased, it will be necessary to recreate the configuration.
  61. .SS Syntax
  62. In these commands,
  63. .I ipaddr
  64. is an IP address in the form
  65. .BR 111.103.94.19
  66. and
  67. .I name
  68. is a text string without white space.
  69. The syntax of a
  70. .I device
  71. is more complicated:
  72. .TP
  73. .BI w n1 . n2 . n3
  74. Defines a SCSI disk on target (unit) id
  75. .IR n2 ,
  76. controller (host adapter)
  77. .IR n1 ,
  78. and LUN (logical unit number)
  79. .IR n3 .
  80. A single number specifies a target, while two numbers specify
  81. .IB target . lun\f1,
  82. with the missing numbers defaulting to zero.
  83. Any one of the numbers may be replaced by
  84. .BI < m - n >
  85. to represent the values
  86. .I m
  87. through
  88. .I n
  89. inclusive.
  90. .I M
  91. may be greater than
  92. .IR n .
  93. For example,
  94. .B (w<1-4>)
  95. is the concatenation of SCSI targets 1 through 4.
  96. .TP
  97. .BI h n1 . n2 . n3
  98. .I H
  99. is similar to
  100. .IR w ,
  101. but for IDE or ATA disks,
  102. and the controllers must be specified in
  103. .BR plan9.ini .
  104. .I Lun
  105. is ignored.
  106. .I Target
  107. 0 is an IDE master
  108. and 1 is a slave.
  109. Instead of specifying
  110. .I controller
  111. and
  112. .IR target
  113. separately,
  114. one may omit the
  115. .I controller
  116. and specify a target of
  117. .IB controller-number *2
  118. .B +
  119. .IR target-number ,
  120. thus
  121. .B h2
  122. is equivalent to
  123. .B h1.0.0
  124. (second IDE controller, master drive).
  125. .TP
  126. .BI l n1 . n2 . n3
  127. .TP
  128. .BI r n1 . n2 . n3
  129. The same as
  130. .BR w ,
  131. but leaving a single block at the beginning for a label
  132. .BI ( l ),
  133. or not.
  134. Only
  135. .I n2
  136. is really of interest,
  137. and refers to a side of a WORM disc.
  138. These are only really relevant when used as
  139. .I device3
  140. in the
  141. .B j
  142. device (see below).
  143. .TP
  144. .BI ( device... )
  145. A pseudo-device formed from the concatenation of the
  146. .I devices
  147. in the list. The devices are
  148. .I not
  149. blank- or comma-separated.
  150. .TP
  151. .BI [ device... ]
  152. A pseudo-device formed from the block-wise interleaving of the
  153. .I devices
  154. in the list. The size of the result is the number of devices times
  155. the size of the smallest device.
  156. .TP
  157. .BI { device... }
  158. A pseudo-device formed from the mirroring of the first
  159. .I device
  160. in the list onto all the others.
  161. The size of the result is the size of the smallest device.
  162. One might think of this as RAID 1,
  163. and
  164. .B [
  165. .B ]
  166. as RAID 0.
  167. Each block is written to all the devices,
  168. starting with the rightmost in the list and working leftward.
  169. A block is read from the first device that provides it without error,
  170. starting with the leftmost in the list and working rightward.
  171. .TP
  172. .BI p device . n1 . n2
  173. A partition starting at
  174. .IR n1 %
  175. from the beginning of
  176. .I device
  177. with a length
  178. .IR n2 %
  179. of the size of the device.
  180. Parenthesize
  181. .I device
  182. if it contains periods.
  183. .TP
  184. .BI x device
  185. A pseudo-device that contains the byte-swapped contents of
  186. .IR device .
  187. Since the file server writes integers to disk in its native byte order,
  188. it can be necessary to use this device to read file systems written
  189. by processors of the other byte order.
  190. .TP
  191. .BR j (\f2device1\ device2\f1...)\f2device3
  192. .I Device1
  193. is the SCSI juke box interface.
  194. The
  195. .IR device2 s
  196. are the SCSI drives in the jukebox and
  197. .I device3
  198. represents the demountable platters in the juke box.
  199. .TP
  200. .BI f device
  201. A pseudo-WORM disk: blocks on
  202. .I device
  203. can be written only once and may not be read unless written.
  204. .TP
  205. .BI c device1device2
  206. A cached WORM. The first
  207. .I device
  208. is the cache, the second the WORM.
  209. .TP
  210. .BI o
  211. (Letter o) The read-only (dump) file system
  212. of the most-recently defined cached WORM file system.
  213. .SS Configuration
  214. The
  215. .B service
  216. command sets the textual name of the server as known in
  217. the network databases.
  218. .PP
  219. The configuration information is stored in block zero on a
  220. device whose device string is written in non-volatile RAM.
  221. The
  222. .B config
  223. and
  224. .B nvram
  225. commands identify the
  226. .I device
  227. on which the information is recorded.
  228. The
  229. .B config
  230. command also erases any previous configuration.
  231. .PP
  232. The
  233. .I filsys
  234. command configures a file system on
  235. .I device
  236. and calls it
  237. .IR name .
  238. .I Name
  239. is used as the specifier in
  240. .B attach
  241. messages to connect to that file system.
  242. (The file system
  243. .B main
  244. is the one attached to if the specifier is null; see
  245. .IR attach (5)).
  246. .PP
  247. The rest of the configuration commands record IP addresses:
  248. the file server's address
  249. .RI ( ip ),
  250. the local gateway's
  251. .RI ( ipgw ),
  252. the local authentication server's
  253. .RI ( ipauth ),
  254. the local subnet mask
  255. .RI ( ipmask ),
  256. and the address of a system running an SNTP server
  257. .RI ( ipsntp ).
  258. .I Ipauth
  259. is no longer used.
  260. If the server has more than one network interface,
  261. a digit may be appended to the keywords
  262. .BR ip ,
  263. .B ipgw
  264. and
  265. .B ipmask
  266. to indicate the interface number;
  267. zero is the default.
  268. .SS "One-time actions"
  269. .PP
  270. The
  271. .I ream
  272. command initializes the named file system. It overwrites
  273. any previous file system on the same device
  274. and creates an empty root directory
  275. on the device.
  276. If
  277. .I name
  278. is
  279. .BR main ,
  280. the file server, until the next reboot,
  281. will accept
  282. .B wstat
  283. messages
  284. (see
  285. .IR stat (5))
  286. that change the owner and group of files,
  287. to enable initializing a fresh file system from a
  288. .IR mkfs (8)
  289. archive.
  290. .PP
  291. For the
  292. .I recover
  293. command, the
  294. named file system
  295. must be a cached WORM.
  296. .I Recover
  297. clears the associated magnetic cache and initializes the file
  298. system, effectively resetting its contents to the last dump.
  299. .PP
  300. .I Allow
  301. turns off all permission checking; use with caution.
  302. .PP
  303. .I Readonly
  304. disables all writing to all devices.
  305. This is useful for trying dangerous experiments.
  306. .PP
  307. .I Noauth
  308. disables authentication.
  309. .PP
  310. .I Noattach
  311. prevents attachs.
  312. .PP
  313. .I Copyworm
  314. will copy a file system named
  315. .I main
  316. to one named
  317. .IR output ,
  318. block by block,
  319. and loop.
  320. It knows how to read a fake worm file system.
  321. .PP
  322. .I Halt
  323. will cause the server to
  324. .I immediately
  325. exit and reboot.
  326. .PP
  327. The various configuration commands only record what to do; they write
  328. no data to disk. The command
  329. .I end
  330. exits config mode and begins running the file server proper.
  331. The server will then perform whatever I/O is required to establish
  332. the configuration.
  333. .SH EXAMPLE
  334. Initialize a file server
  335. .B kgbsun
  336. with a single file system interleaved between SCSI targets 3 and 4.
  337. .IP
  338. .EX
  339. service kgbsun
  340. config w3
  341. filsys main [w<3-4>]
  342. ream main
  343. .EE
  344. .PP
  345. Initialize a file server
  346. .B kremvax
  347. with a single disk on target 0 partitioned as a cached pseudo-WORM
  348. file system with the cache on the third quarter of the drive
  349. and the pseudo-WORM on the interleave of the first, second, and
  350. fourth quarters.
  351. .IP
  352. .EX
  353. service kremvax
  354. config p(w0)50.1
  355. filsys main cp(w0)50.25f[p(w0)0.25p(w0)25.25p(w0)75.25]
  356. filsys dump o
  357. ream main
  358. .EE
  359. .PP
  360. A complete and complex example:
  361. initialize a file server
  362. .I fsb
  363. with a single SCSI disk on target 0 for a scratch file system,
  364. a cached WORM file system with cache disk on target 2 and
  365. an optical-disc jukebox on targets 4 (robotics) and 5 (one optical drive),
  366. and another cached WORM file system with cache disk on target 3
  367. and another optical-disc jukebox on a second SCSI bus at targets 3 and 4.
  368. Both jukeboxes contain 16 slots of optical discs.
  369. It has two Ethernet interfaces and can reach an SNTP server on the first one.
  370. .IP
  371. .EX
  372. service fsb
  373. config w0
  374. filsys main cw2j(w4w5)(l<0-31>)
  375. filsys dump o
  376. filsys hp40fx cw3j(w1.<3-4>.0)(l<0-31>)
  377. filsys hp40fxdump o
  378. filsys other w0
  379. ipauth 0.0.0.0
  380. ipsntp 10.9.0.3
  381. ip0 10.9.0.2
  382. ipgw0 10.9.0.3
  383. ipmask0 255.255.0.0
  384. ip1 10.0.0.2
  385. ipgw1 10.0.0.1
  386. ipmask1 255.255.0.0
  387. ream main
  388. ream hp40fx
  389. ream other
  390. end
  391. .EE
  392. .SH SOURCE
  393. .BR /sys/src/fs/port/config.c
  394. .SH "SEE ALSO
  395. Ken Thompson,
  396. ``The Plan 9 File Server''.