fs 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. .TH FS 3
  2. .SH NAME
  3. fs \- file system devices
  4. .SH SYNOPSIS
  5. .nf
  6. .B bind -b #k /dev
  7. .B /dev/fs
  8. .B /dev/fs/ctl
  9. .B /dev/fs/...
  10. .fi
  11. .SH DESCRIPTION
  12. The
  13. .I fs
  14. driver builds complex disk files out of simpler disk files.
  15. Inspired by the Plan 9 file server kernel's configuration strings,
  16. it provides device mirroring, partitioning, interleaving, and catenation
  17. for disk-based services like
  18. .IR kfs (4)
  19. or
  20. .IR venti (8).
  21. .PP
  22. The device
  23. is intended to be bound at
  24. .B /dev
  25. and contains a directory named
  26. .BR fs ,
  27. which in turn contains a
  28. .B ctl
  29. file and one file per configured device.
  30. .PP
  31. The control messages each introduce a new device, here named
  32. .IR new .
  33. The
  34. .I file
  35. arguments are interpreted in the name space of the writer.
  36. .TP
  37. .BI mirror " new files" \fR...
  38. The device
  39. .I new
  40. corresponds to a RAID 1 mirroring of
  41. .IR files .
  42. Writes to
  43. .BI new
  44. are handled by sequentially writing to the
  45. .I files
  46. from right to left (the reverse of
  47. the order in the control message).
  48. If any write fails, the write is aborted.
  49. Reads from
  50. .BI new
  51. are handled by sequentially reading from the
  52. .I files
  53. from left to right until one succeeds.
  54. The length of the mirror device is the minimum of the lengths of the
  55. .IR files .
  56. .TP
  57. .BI part " new file offset length"
  58. The device
  59. .I new
  60. corresponds to the
  61. .I length
  62. bytes starting at
  63. .I offset
  64. in
  65. .IR file .
  66. If
  67. .IR offset + length
  68. reaches past the end of
  69. .IR file ,
  70. .I length
  71. is silently reduced to fit.
  72. .TP
  73. .BI inter " new files" \fR...
  74. The device
  75. .I new
  76. corresponds to the block interleaving of
  77. .IR files ;
  78. an 8192-byte block size is assumed.
  79. .TP
  80. .BI cat " new files" \fR...
  81. The device
  82. .I new
  83. corresponds to the catenation of
  84. .IR files .
  85. .PD
  86. .LP
  87. If the variable
  88. .B fsconfig
  89. is set in
  90. .IR plan9.ini (8)
  91. then
  92. .I fs
  93. will read its configuration from the file
  94. .B $fsconfig
  95. on the first attach.
  96. This is useful when the machine boots
  97. from a local file server that uses
  98. .IR fs .
  99. .SH EXAMPLE
  100. Mirror the two disks
  101. .B /dev/sdC0/data
  102. and
  103. .B /dev/sdD0/data
  104. as
  105. .BR /dev/fs/m0 ;
  106. similarly, mirror
  107. .B /dev/sdC1/data
  108. and
  109. .B /dev/sdD1/data
  110. as
  111. .BR /dev/fs/m1 :
  112. .IP
  113. .EX
  114. echo mirror m0 /dev/sdC0/data /dev/sdD0/data >/dev/fs/ctl
  115. echo mirror m1 /dev/sdC1/data /dev/sdD1/data >/dev/fs/ctl
  116. .EE
  117. .LP
  118. Interleave the two mirrored disks to create
  119. .BR /dev/fs/data :
  120. .IP
  121. .EX
  122. echo inter data /dev/fs/m0 /dev/fs/m1 >/dev/fs/ctl
  123. .EE
  124. .LP
  125. Run
  126. .IR kfs (4)
  127. on the interleaved device:
  128. .IP
  129. .EX
  130. disk/kfs -f /dev/fs/data
  131. .EE
  132. .LP
  133. Save the configuration:
  134. .IP
  135. .EX
  136. cp /dev/fs/ctl /dev/fd0disk
  137. .EE
  138. To load the configuration automatically at boot time,
  139. add this to
  140. .IR plan9.ini :
  141. .IP
  142. .EX
  143. fsconfig=/dev/fd0disk
  144. .EE
  145. .SH "SEE ALSO"
  146. .IR kfs (4),
  147. .IR fs (8),
  148. .IR plan9.ini (8),
  149. .IR venti (8)
  150. .SH SOURCE
  151. .B /sys/src/9/port/devfs.c