Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Devices

Notices

Reply
 
Thread Tools Search this Thread
Old 03-29-2015, 04:08 PM   #61
bambuko
Connoisseur
bambuko began at the beginning.
 
Posts: 62
Karma: 10
Join Date: Feb 2014
Device: Kobo mini, Kobo Clara HD
When I try to run it as user it insists that library database is corrupted and tries to repair it...
but there is nothing wrong with database - if I run it as root it is perfectly fine

Database is (as everything else) is read/write/modify by anybody.

The only issue I can think about, is that usb stick mounts in /media (which is only accessible as root).
bambuko is offline   Reply With Quote
Old 03-29-2015, 04:14 PM   #62
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Huh? I mean, /media is usually only writeable as root... but it should be readable by everyone, else how do you find your drives???
eschwartz is offline   Reply With Quote
Advert
Old 03-29-2015, 04:26 PM   #63
bambuko
Connoisseur
bambuko began at the beginning.
 
Posts: 62
Karma: 10
Join Date: Feb 2014
Device: Kobo mini, Kobo Clara HD
I know... I am as puzzled as you are by this weird behaviour.
bambuko is offline   Reply With Quote
Old 03-29-2015, 05:29 PM   #64
bambuko
Connoisseur
bambuko began at the beginning.
 
Posts: 62
Karma: 10
Join Date: Feb 2014
Device: Kobo mini, Kobo Clara HD
SOLVED the problem
It would appear that when Calibre creates library database metadata.db and metadata_db_prefs_backup.json it assigns to them an owner "1000" with write permissions to owner only.
I never created these files so it didn't occur to me to check the owner until this particular problem.

Which of course meant that it was OK when running as root, but not as dogsbody.

Simple solution - was to manually change the owner (to root as everything else onm this usb stick)

All runs as clappers

What do you reckon about this?
bambuko is offline   Reply With Quote
Old 03-29-2015, 05:35 PM   #65
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,568
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
I reckon you should get 1000 brownie points - when you installed and ran the welcome wizard who were you logged in as? I think that's when the files are created.

BR
BetterRed is offline   Reply With Quote
Advert
Old 03-29-2015, 05:47 PM   #66
bambuko
Connoisseur
bambuko began at the beginning.
 
Posts: 62
Karma: 10
Join Date: Feb 2014
Device: Kobo mini, Kobo Clara HD
Don't know enough to quibble, but I never existed as "1000"
Most puzzling (although I must admit that this is the usual state of mind for me )
bambuko is offline   Reply With Quote
Old 03-29-2015, 06:12 PM   #67
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Sounds like those files escaped the umask, I assume like everything else they were created before the current version of calibre-portable.sh -- so, the question is, when you originally did "chmod 777", did those files get skipped? Or is calibre overriding the umask, because I don't think it is.
eschwartz is offline   Reply With Quote
Old 03-29-2015, 06:29 PM   #68
bambuko
Connoisseur
bambuko began at the beginning.
 
Posts: 62
Karma: 10
Join Date: Feb 2014
Device: Kobo mini, Kobo Clara HD
Now that I know what the problem was I will create brand new/virgin usb stick to test it all, because to be honest even if I knew the answers to your questions, I wouldn't be sure I am right...
I'll be back

ps... just realised - library directory was copied from backup directory created on another linux machine - had a look at it and all the directories are owned by "1024"
What's going on?
I am not a number....

it would appear (from my searches) that:
Quote:
...user id for users created on Linux systems starts from 1000 (at least on some) It is specified in /etc/login.defs file. So, a user with uid 1000 is the first normal user (non-root user) created on the system...
That would explain why files created by the system were given owner number.
Still doesn't explain why they have escaped umask?

Last edited by bambuko; 03-29-2015 at 07:00 PM.
bambuko is offline   Reply With Quote
Old 03-29-2015, 07:15 PM   #69
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Well, the umask only applies for newly-created files, hence why I asked if it works on a virgin library.

As far as the actual user account, those are stored as numbers, it is the OS that gives them username labels. They don't typically transfer well across systems -- at least, they don't automagically bind themselves to the user account you desire.
eschwartz is offline   Reply With Quote
Old 03-29-2015, 07:55 PM   #70
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,800
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by bambuko View Post
Now that I know what the problem was I will create brand new/virgin usb stick to test it all, because to be honest even if I knew the answers to your questions, I wouldn't be sure I am right...
I'll be back

ps... just realised - library directory was copied from backup directory created on another linux machine - had a look at it and all the directories are owned by "1024"
What's going on?
I am not a number....

it would appear (from my searches) that:


That would explain why files created by the system were given owner number.
Still doesn't explain why they have escaped umask?
All *nix users and groups have numbers assigned.
Look in /etc/passwd

Users assignments typically start at 1000
theducks is offline   Reply With Quote
Old 03-30-2015, 01:20 PM   #71
bambuko
Connoisseur
bambuko began at the beginning.
 
Posts: 62
Karma: 10
Join Date: Feb 2014
Device: Kobo mini, Kobo Clara HD
OK...
re-created the usb stick and found the problem:
When copying library from it's backup location to usb stick all the directories change their owner from whatever it was in backup directory (in this particular case it happened to be 1024) to the root (which I am when doing the copying), but...
metadata.db and metadata_db_prefs_backup.json (and all the files inside sub-directories) do not change the owner and retain whatever it was originally (in this case 1024)

In doing so I have re-created exact issue I have reported before, and exactly as before if I run the script it reports that database is corrupted.
Ownership of the files inside sub-directories of library doesn't matter a hoot and Calibre is not bothered about it at all (once it gets going)
It is only the two database files that seem to bother it when starting

Luckily by now I know exactly what to do
go on the usb stick into the CalibreLibrary and manually modify the owner to root and Bob is your uncle

I am not knowledgeable enough to understand what is going on - I just report

For now I will modify my Library and use it OK.

Last edited by bambuko; 03-30-2015 at 01:25 PM.
bambuko is offline   Reply With Quote
Old 03-30-2015, 01:31 PM   #72
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Ownership of the files matters greatly. If you try to do anthying with them, you will soon see...

calibre doesn't try reading and writing to every file just because you launched the program, it maintains info in the database and tries to access the files as and when needed.

Try running calibre sometime with a database copy-pasted from a library into an empty folder. It will work... until it doesn't.
eschwartz is offline   Reply With Quote
Old 03-30-2015, 01:48 PM   #73
bambuko
Connoisseur
bambuko began at the beginning.
 
Posts: 62
Karma: 10
Join Date: Feb 2014
Device: Kobo mini, Kobo Clara HD
OK, so what do I do with it?

I guess there is a Linux way of copying Library without loosing permissions and ownership?
Off to educate myself

Last edited by bambuko; 03-30-2015 at 02:17 PM.
bambuko is offline   Reply With Quote
Old 03-30-2015, 02:32 PM   #74
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Code:
cp -pr
manpages are useful

rsync -a (for archive) does that too.

Note: Must run as root in order to set ownership.

There you go, I've saved you the time to google the answer: answer being, "man cp".
eschwartz is offline   Reply With Quote
Old 03-30-2015, 02:51 PM   #75
bambuko
Connoisseur
bambuko began at the beginning.
 
Posts: 62
Karma: 10
Join Date: Feb 2014
Device: Kobo mini, Kobo Clara HD
Starting totally from scratch, including installing Calibre directly into the stick (just in case this is also causing some grief) and then big cp of library and will report result!
bambuko is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibre Portable cstandifird Devices 3 01-24-2012 02:29 PM
Portable Calibre? hermes Related Tools 2 06-02-2011 02:50 PM
Calibre Portable beckywc Calibre 4 12-21-2010 11:13 AM
Portable Linux version of Sigil readx Sigil 9 09-03-2010 02:59 AM
Portable Linux-Mobile-Guide for iSilo and Plucker Colin Dunstan Lounge 0 08-31-2005 05:48 AM


All times are GMT -4. The time now is 08:40 PM.


MobileRead.com is a privately owned, operated and funded community.