| 1 | <?xml version="1.0" encoding="iso-8859-1"?> |
|---|
| 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|---|
| 3 | <html xmlns="http://www.w3.org/1999/xhtml"> |
|---|
| 4 | <head> |
|---|
| 5 | <meta http-equiv="content-type" content="text/html;charset=iso-8859-1" /> |
|---|
| 6 | <title>Fixing problems with corruption on the server</title> |
|---|
| 7 | <link rel="stylesheet" href="bbstyles.css" type="text/css" /> |
|---|
| 8 | </head> |
|---|
| 9 | <body> |
|---|
| 10 | <div align="center"> |
|---|
| 11 | <div id="header"> |
|---|
| 12 | <div id="logo"> |
|---|
| 13 | <img src="images/bblogo.png" alt="logo" height="65" width="331" border="0" vspace="5" align="middle" /> <img src="images/stepahead.png" alt="a step ahead in data security" width="182" height="11" hspace="10" vspace="20" border="0" align="middle" /></div> |
|---|
| 14 | </div> |
|---|
| 15 | <div id="page"> |
|---|
| 16 | |
|---|
| 17 | <h1>Fixing problems with corruption on the server</h1> |
|---|
| 18 | |
|---|
| 19 | <p>This page gives help on what to do if your server has suffered corruption, for example, |
|---|
| 20 | after an unclean shutdown or other OS or hardware problem.</p> |
|---|
| 21 | |
|---|
| 22 | <p>In general, as updates to the store are made in an atomic manner, the most |
|---|
| 23 | likely result is wasted disc space. However, if really bad things happen, or you believe that |
|---|
| 24 | there is a lot of wasted space, then these instructions will help to restore your data.</p> |
|---|
| 25 | |
|---|
| 26 | <p>You know you will need to do something if you get strange errors, and <tt>bbackupd</tt> attempts |
|---|
| 27 | to contact the server every 100 seconds or so. Or if one of the discs in your RAID disc set has failed.</p> |
|---|
| 28 | |
|---|
| 29 | <p>After following these instructions, the end result will be that <tt>bbackupquery</tt> will be able to see all the files which |
|---|
| 30 | were stored on your server, and retrieve them. Some of them may be in <tt>lost+found</tt> |
|---|
| 31 | directories in the root of the store (or in their original position if they have been moved) but they will all |
|---|
| 32 | be able to be retrieved.</p> |
|---|
| 33 | |
|---|
| 34 | <p>After you have retrieved the files you want, <tt>bbackupd</tt> will upload new versions |
|---|
| 35 | where necessary, and after about two days, mark any <tt>lost+found</tt> directories as deleted. |
|---|
| 36 | Finally, those directories will be removed by the housekeeping process on the server.</p> |
|---|
| 37 | |
|---|
| 38 | <p>These instructions assume you're working on account 1234, subsitute this for whatever account |
|---|
| 39 | you're actually working on. These will need to be repeated for all affected accounts.</p> |
|---|
| 40 | |
|---|
| 41 | <h2>1. Stop bbackupd</h2> |
|---|
| 42 | |
|---|
| 43 | <p>First, make sure that <tt>bbackupd</tt> is not running on the client machine for the account |
|---|
| 44 | you are going to recover. Use <tt>kill</tt> to terminate it.</p> |
|---|
| 45 | |
|---|
| 46 | <p>(This step is not strictly necessary, but is recommended. During any checks on the account, |
|---|
| 47 | <tt>bbackupd</tt> will be unable to log in, and after they are complete, the account is marked |
|---|
| 48 | as changed on the server so <tt>bbackupd</tt> will perform a complete scan.)</p> |
|---|
| 49 | |
|---|
| 50 | <h2>2. Are you using RAID on the server?</h2> |
|---|
| 51 | |
|---|
| 52 | <p>At the moment, the raidfile recovery tools have not been written. However, when two out of |
|---|
| 53 | three files are available, the server will run succesfully, even if it complains a lot in the logs. |
|---|
| 54 | So, your best bet here is to fix the accounts, if necessary, and retrieve any files you need. Then move |
|---|
| 55 | the old store directories aside (in case you need them) and start afresh with new accounts, and |
|---|
| 56 | let the clients upload all their data again.</p> |
|---|
| 57 | |
|---|
| 58 | <p>These utilities will be written shortly!</p> |
|---|
| 59 | |
|---|
| 60 | <h2>3. Check and fix the account</h2> |
|---|
| 61 | |
|---|
| 62 | <p>First, run the check utility, and see what errors it reports.</p> |
|---|
| 63 | |
|---|
| 64 | <pre> |
|---|
| 65 | /usr/local/bin/bbstoreaccounts check 1234 |
|---|
| 66 | </pre> |
|---|
| 67 | |
|---|
| 68 | <p>This will take some time, and use a fair bit of memory (about 16 bytes per file and directory). |
|---|
| 69 | If the output looks plausible and reports errors which need fixing, run it again but with the |
|---|
| 70 | <tt>fix</tt> flag:</p> |
|---|
| 71 | |
|---|
| 72 | <pre> |
|---|
| 73 | /usr/local/bin/bbstoreaccounts check 1234 fix |
|---|
| 74 | </pre> |
|---|
| 75 | |
|---|
| 76 | <p>This will fix any errors, and remove unrecoverable files. Directories will be recreated if necessary.</p> |
|---|
| 77 | |
|---|
| 78 | <p><b>NOTE</b>: The utility may adjust the soft and hard limits on the account to make sure that |
|---|
| 79 | housekeeping will not remove anything -- check these afterwards.</p> |
|---|
| 80 | |
|---|
| 81 | <h2>4. Grab any files you need with bbackupquery</h2> |
|---|
| 82 | |
|---|
| 83 | <p>At this point, you will have a working store. Every file which was on the server, and wasn't corrupt, |
|---|
| 84 | will be available.<p> |
|---|
| 85 | |
|---|
| 86 | <p>On the client, use <tt>bbackupquery</tt> to log in and examine the store. (type <tt>help</tt> at the |
|---|
| 87 | prompt for instructions). Retrieve any files you need, paying attention to any <tt>lost+found</tt> |
|---|
| 88 | directories in the root directory of the store.</p> |
|---|
| 89 | |
|---|
| 90 | <p>You can skip this step if you are sure that the client machine is fine -- in this case, <tt>bbackupd</tt> |
|---|
| 91 | will bring the store up to date.</p> |
|---|
| 92 | |
|---|
| 93 | <h2>5. Restart bbackupd</h2> |
|---|
| 94 | |
|---|
| 95 | <p>Restart <tt>bbackupd</tt> on the client machine. The store account will be brought up to date, and |
|---|
| 96 | files in the wrong place will be marked for eventual deletion.</p> |
|---|
| 97 | |
|---|
| 98 | |
|---|
| 99 | <p> </p> |
|---|
| 100 | <p>© Ben Summers, 2003, 2004</p> |
|---|
| 101 | <p> </p> |
|---|
| 102 | </div> |
|---|
| 103 | </div> |
|---|
| 104 | </body> |
|---|
| 105 | </html> |
|---|