fsconfig 8.2 KB

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