backup.ms 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. .FP lucidasans
  2. .HTML "Venti Backups to Blu-Ray Discs"
  3. .EQ
  4. delim $$
  5. .EN
  6. .
  7. .TL
  8. Venti Backups to Blu-Ray Discs
  9. .AU
  10. Geoff Collyer
  11. .AI
  12. .MH
  13. .SH
  14. Overview
  15. .PP
  16. As a precaution against multiple disks in our
  17. Plan 9
  18. .I venti
  19. server's RAID array failing at about the same time,
  20. or other catastrophic failure, we record
  21. .I venti
  22. arenas,
  23. after they are sealed,
  24. onto dual-layer Blu-Ray discs (BDs).
  25. One could use other large optical discs instead.
  26. .PP
  27. The advertised capacity of a dual-layer BD is 50GB,
  28. but those aren't even disk-manufacturer's (decimal) gigabytes,
  29. which would give a capacity of
  30. $50 times 10 sup 9$ bytes,
  31. which is roughly equivalent to 46.6 gigabytes,
  32. as the term is used by everyone but disk manufacturers.
  33. In the case of BDs,
  34. even that is an exaggeration, with the actual capacity being
  35. closer to $48.44 times 10 sup 9$ bytes,
  36. so the claimed capacity should be read as `50 VAX-gigabytes',
  37. where a
  38. .I VAX-gigabyte
  39. is 968,800,338 bytes.
  40. The default
  41. .I venti
  42. arena size is 512MB, but for some reason our server is configured
  43. with 1GB arenas, so we could fit 46 of them on a BD.
  44. To leave a little extra room for lead-in, lead-out, inter-track gaps,
  45. lossless-linking and the like,
  46. we record 45 arenas per BD.
  47. .PP
  48. The scripts used and records kept are in
  49. .CW /sys/lib/backup
  50. and pertain to the file server on which they are stored.
  51. You will probably want to edit
  52. .CW funcs
  53. to set default file server and Blu-ray device, at minimum.
  54. .SH
  55. Creating and Updating Backups
  56. .PP
  57. We start
  58. .I cdfs
  59. after inserting a disc (virgin or partially-written),
  60. then use
  61. .I venti/rdarena
  62. to copy the next sealed but not backed-up arena
  63. to the start of the unwritten portion of the BD by writing to
  64. .CW /mnt/cd/wd/x .
  65. We don't fixate data BDs, as that seems to tickle a bug,
  66. perhaps in our Sony Blu-Ray burners, that only records the first track
  67. in the disc index upon fixation.
  68. .PP
  69. One can find out which arenas are sealed and which are open by viewing
  70. .CW http://\fIventi-server\fP/index .
  71. We also periodically print the most recent
  72. .I fossil
  73. dump scores and save the paper with the discs.
  74. .PP
  75. All of this is packaged up as scripts in
  76. .CW /sys/lib/backup ,
  77. notably
  78. .CW backup .
  79. A typical invocation would be just
  80. .DS
  81. .ft CW
  82. cd /sys/lib/backup
  83. backup
  84. .ft
  85. .DE
  86. which will guide its invoker as to which discs to insert into a Blu-ray
  87. burner and when.
  88. This works for a first full backup and for subsequent incremental backups
  89. of just the newly-sealed arenas.
  90. There is provision for burning multiple backup sets, the default being
  91. .CW set1 .
  92. To burn a second set, we would
  93. .DS
  94. .ft CW
  95. mkdir /sys/lib/backup/set2
  96. backup -s set2
  97. .ft
  98. .DE
  99. .CW backup
  100. and related scripts keep track of which BD is current and how many
  101. tracks are recorded, and which arenas have been dumped to BD.
  102. .PP
  103. We have recorded two sets of BD backups, one of which will go to
  104. Antwerp to seed their
  105. .I venti
  106. server and also serve as off-site backup for Murray Hill.
  107. .SH
  108. Restoring from Backups
  109. .PP
  110. After a disaster, or when setting up a new
  111. .I venti
  112. server from BD backups,
  113. the first step is to get Plan 9 running on the new
  114. .I venti
  115. server.
  116. This could be done by installing into a smallish (2GB)
  117. .I fossil
  118. partition from a Plan 9 installation CD, if necessary.
  119. One would then initialise the new disk partitions per
  120. .I venti-fmt (8)
  121. and read all the arenas on all the BDs into the new
  122. .I venti
  123. by running
  124. .I venti/wrarena
  125. once per BD track (arena).
  126. .br
  127. .ne 3
  128. .PP
  129. To add the contents of a backup BD to a (possibly fresh)
  130. .I venti
  131. store,
  132. shut down the
  133. .I venti
  134. server,
  135. format the arenas partition, then
  136. run
  137. .DS
  138. .ft CW
  139. restore \fIfirst-arena-number\fP
  140. .ft
  141. .DE
  142. after inserting a BD into the Blu-ray drive.
  143. Repeat this for each BD in the backup set.
  144. When all the arenas have been restored,
  145. it will be necessary to build a new
  146. .I venti
  147. index,
  148. the usual steps being to run
  149. .I checkarenas ,
  150. .I fmtisect ,
  151. .I fmtbloom ,
  152. .I fmtindex ,
  153. and
  154. .I "buildindex -b" ,
  155. all from
  156. .I venti-fmt (8).
  157. Then the
  158. .I venti
  159. server may be restarted.
  160. .PP
  161. Once the
  162. .I venti
  163. storage has been restored,
  164. a new
  165. .I fossil
  166. partition (perhaps the existing one or another one)
  167. can be initialised from the last
  168. .I fossil
  169. dump score corresponding to the last arena on BD
  170. (see
  171. .I fossil/flfmt
  172. in
  173. .I fossil (4)):
  174. .DS
  175. .ft CW
  176. fossil/flfmt -v c388...32b5 /dev/sdC0/fossil
  177. .ft
  178. .DE