Re: Recovering from disk errors

Toby Dickenson <[email protected]>
Newsgroups gmane.comp.web.zope.zodb.dirstorage
Message-ID <[email protected]>
On Friday 02 July 2004 21:43, Ed Leafe wrote:
> 	I'm hosed. I woke up this morning to a series of I/O error messages on
> my server. They were so bad that I couldn't even log in at the console
> to try to correct the problem.
>
> 	I rebooted, and ran the drives through the SCSI utilities to check for
> problems, and then fsck'ed like crazy, due to all the problems
> reported. Supposedly, though, the disk is fixed, at least to fsck's
> liking.
>
> 	I can't start Zope, though. Since I store my data in /usr/zopestorage,
> and the highest number of errors was in the /usr partition, I'm not too
> surprised. I looked at the docs on the website, and found "checkds.py -
> DirectoryStorage checking tool". Sounds like a good start, so I ran it:
>
> [root@leafe DirectoryStorage]python snapshot.py /usr/zopestorage -
> python checkds.py
> failed to open /usr/zopestorage/config/snapshot.conf
> SnapshotError: directory is not a snapshot
>
> 	OK, not too surprising. So I renamed this to zopestorage.BAD, and then
> restored from my backup. But when I ran it again, I got the exact same
> result.
>
> 	So what do you suggest I do next?

You still get the error message 'failed to 
open /usr/zopestorage/config/snapshot.conf'? Does that file exist in your 
restored backup?

Hmmmm.... Ive just noticed a gap in the documentation for backup.py which 
explains this, assuming you used backup.py to take your backup. That tool 
only takes backup copied of the storage *data*, the files in the 
directory /usr/zopestorage/A. It doesnt backup /usr/zopestorage/config, or 
any of the other directories in /usr/zopestorage/

No problem - all those files are easy to recreate. I suggest:
1. move your restored /usr/zopestorage/A into a safe place. This contains
   all your data.
2. run mkds.py to create a new storage.
3. remove the newly created /usr/zopestorage/A, and replace it with
   your restored one from step 1
4. recreate your config.snapshot.conf. (ok, I lied. all but one of these
   files are easy to recreate ;-)

mkds.py wont be doing anything complicated for you here. If you prefer a more 
hands-on approach:
1. cd /usr/zopestorage
2. mkdir journal
3. mkdir B
4. put the default settings file in config/settings
5. put a random number in config/identity. On linux,
   /proc/sys/kernel/random/uuid is a good source. The only purpose of
   this identity is replication.



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.