解決 Calibre 無法從 Samba 掛載點下建立(讀取)書庫的問題

Posted on

在 Fedora 下使用 Calibre,訪問在 NAS 上通過 Samba 裝載的書庫時,一直提示「資料庫損毀」並詢問是否重建,但多次嘗試都重建失敗,大致的提示是

....
 Traceback (most recent call last):
 File "site-packages/calibre/gui2/main.py", line 190, in initialize_db
 File "site-packages/calibre/library/database2.py", line 196, in __init__
 File "site-packages/calibre/library/database2.py", line 151, in connect
 File "site-packages/calibre/library/database2.py", line 518, in initialize_database
 File "site-packages/calibre/library/sqlite.py", line 314, in run
 DatabaseException: database is locked
 RemoteTraceback (most recent call last):
 File "site-packages/calibre/library/sqlite.py", line 271, in run
 OperationalError: database is locked

後來翻了一下 Google,發現增加 nobrl 到 Samba 的裝載選項就可以了。Man Page 裏是這麼解釋的:

nobrlDo not send byte range lock requests to the server. This is necessary for certain applications that break with cifs style mandatory byte range locks (and most cifs servers do not yet support requesting advisory byte range locks).

再 Google 了一下,基本上用 Sqlite3 的都遇到了 Samba 的這個問題。加上 nobrl 選項後,暫時用起來還沒有問題。

另外,KindleUnpack 真的是非常不錯用的東西,淺羽一直都靠它轉換 Amazon 買的書給 Kobo Aura HD 看。它是一個開源的 Python 軟體,可以在 Github 上找到,也有 Calibre 的插件


This site uses Akismet to reduce spam. Learn how your comment data is processed.