View Single Post
Old 02-08-2011, 04:51 AM   #6
toddos
Guru
toddos ought to be getting tired of karma fortunes by now.toddos ought to be getting tired of karma fortunes by now.toddos ought to be getting tired of karma fortunes by now.toddos ought to be getting tired of karma fortunes by now.toddos ought to be getting tired of karma fortunes by now.toddos ought to be getting tired of karma fortunes by now.toddos ought to be getting tired of karma fortunes by now.toddos ought to be getting tired of karma fortunes by now.toddos ought to be getting tired of karma fortunes by now.toddos ought to be getting tired of karma fortunes by now.toddos ought to be getting tired of karma fortunes by now.
 
toddos's Avatar
 
Posts: 695
Karma: 822675
Join Date: May 2010
Device: Kobo Aura, Nokia Lumia 920 (Freda)
I ran calibre on my WHS for a while, and now I run just calibre-server there but I do keep my database and books on WHS. One thing I found is that wherever you store the calibre database file (metadata.db) must not be on a duplicated share. If it is and calibre is left running > 24 hours, drive extender will start through file inconsistency errors because it can't get write access to rebalance the file (DE tries to rebalance every hour or so, and will try for 24 hours before it throws errors). Note that this may still be a problem even if you only run calibre-server, since the SQLite library calibre uses has no concept of read-only access (calibre-server should be read-only, but it opens the database for read/write because it can't do it any other way. In theory, calibre-server should not keep the database open for long periods of time, but it's possible that it could).

The easiest solution is to put your calibre library on a non-duplicated share. However I wanted to ensure that my ebooks were duplicated for safety, so I came up with a different solution. WARNING: What I'm about to describe is non-standard, unsupported, and will probably break in future calibre versions (though it's been working for me since late-0.6.x builds up to current). What you need to do is put your database file on a non-duplicated share while you keep your library books themselves on a duplicated share. In my setup, I've created \\server\ebooks as a duplicated share and I keep \\server\software as a non-duplicated share.
  • Setup calibre as normal, using \\server\ebooks as your calibre library location (I put mine in \\server\ebooks\calibre, since I use that share for other non-calibre stuff as well)
  • Close calibre
  • Copy the metadata.db file from that library location to a non-duplicated share
  • Create the environment variable CALIBRE_OVERRIDE_DATABASE_PATH and set it to the path where you put metadata.db (in my case, \\server\software\calibre\metadata.db)
  • Re-open calibre

Calibre now should point to that database location for its library. Note that doing this will prevent you from using calibre's multiple library feature.

I need to go back and re-evaluate if it's truly necessary to put the database on a non-duplicated share if I'm only running calibre-server 24/7, but I can guarantee that it's required if you want to run the calibre gui 24/7 with the library hosted on a WHS duplicated share (whether you run calibre on the WHS directly or elsewhere, if it's pointint to WHS shares then it will take that write lock and break DE after 24 hours). Unless the SQLite library ever supports a true read-only mode (unlikely) and calibre uses that for everything except for when it needs to write, or calibre switches to a centralized DB model using MySQL or PostgreSQL or similar (even less likely), this is the only solution to keep WHS happy.
toddos is offline