user3825: I had to delete my .bitcoin directory in Ubuntu 12.10, after months of getting the near 9 GB of blk data files.
I copied everything over to another machine (and back to the original too) and it gives me:

A fatal error occurred. Bitcoin can no longer continue safely and will quit.
  
     EXCEPTION: St13runtime_error 
     CDB() : can't open database file blkindex.dat, error 22 
     bitcoin in Runaway exception 

I tried chmod +w on the files, but still no go.  

user682: Two things come to mind as possible reasons.
The most probable reason is that you've switched client versions. There was a switch between 0.7 and 0.8 in how the block index (not the block data itself) was stored; it was changed from BerkeleyDB to LevelDB. If you remove the blkindex.dat (and really want to keep an index around, which is unlikely) you can restart the client with -rescan and -txindex. It will take a while (an hour?) to complete the indexing.
The other reason that I can think of is that it's genuinely corrupt, but that's unlikely.

3825: <p>I had to delete my .bitcoin directory in Ubuntu 12.10, after months of getting the near 9 GB of blk data files.</p>

<p>I copied everything over to another machine (and back to the original too) and it gives me:</p>

<blockquote>
  <p>A fatal error occurred. Bitcoin can no longer continue safely and will quit.
  <br/>
     EXCEPTION: St13runtime_error <br/>
     CDB() : can't open database file blkindex.dat, error 22 <br/>
     bitcoin in Runaway exception <br/></p>
</blockquote>

<p>I tried <code>chmod +w</code> on the files, but still no go.  </p>
 682: <p>Two things come to mind as possible reasons.</p>

<p>The most probable reason is that you've switched client versions. There was a switch between 0.7 and 0.8 in how the block index (not the block data itself) was stored; it was changed from BerkeleyDB to LevelDB. If you remove the <code>blkindex.dat</code> (and really want to keep an index around, which is unlikely) you can restart the client with <code>-rescan</code> and <code>-txindex</code>. It will take a while (an hour?) to complete the indexing.</p>

<p>The other reason that I can think of is that it's genuinely corrupt, but that's unlikely.</p>
