This forum has been archived. All content is frozen. Please use KDE Discuss instead.

rescanning nfs collection

Tags: None
(comma "," separated)
felixnine
Registered Member
Posts
18
Karma
0
OS

rescanning nfs collection

Mon Aug 17, 2009 4:11 pm
i have my music, at home, on an nfs share. it's scanned to an amarok collection. when i don't have it mounted, it's going to rescan the empty directory and not find anything. when i remount it, it's going to have to scan 20000+ files over the network, which takes forever. is there any way i can avoid this?
User avatar
eliasp
Registered Member
Posts
19
Karma
0
OS

Re: rescanning nfs collection

Mon Aug 17, 2009 6:37 pm
The same problem here.

I have Amarok 2.1.1 running on my Gentoo Notebook.
The music collection resides on a NFS share on my fileserver, which is mounted using autofs.

When being out of reach of my fileserver the share is unavailable. When starting Amarok now, it shows my collection having 0 items - so far - no problem - I'm not connected, so I don't have any files in my collection.

But when returning now home and starting Amarok again, it still shows 0 items in the collection, although the share is connected again. But now Amarok starts rescanning the collection which takes 25-30 minutes via WLAN and 7-8 minutes via Gbit Ethernet.

I'd like Amarok to be more "intelligent" here when it comes to handling collection availability.
User avatar
Dieter Schroeder
Registered Member
Posts
714
Karma
7
OS

Re: rescanning nfs collection

Tue Aug 18, 2009 8:59 am
Does amarok have this behaviour still in 2.1?
When I started Amarok 2.1 the collection stays, but some of the covers (obviously) are missing.
There's a script on kde-apps.org, which shuts amarok 2 down after 5sec, if the mountpoint is missing.

m0nk
felixnine
Registered Member
Posts
18
Karma
0
OS

Re: rescanning nfs collection

Mon Aug 24, 2009 5:03 pm
yeah, happens for me as of 2.1.1.

the script is an interesting solution, i guess, but what if i actually want to use amarok?

is there a way to manage multiple collections (or locations scanned) in amarok? you could probably hack around it without too much trouble, even if it involved copying or renaming some files before amarok is launched, that is, if the nfs mountpoint has nothing in it.

i can't help but thinking this is a huge usability issue. i'm a little surprised i haven't read anything about it before since amarok 1.4 behaved the same way. i'd like to help resolve it, even if it's just a hacky shell script, i just need to know more about the workings of amarok's collections.
User avatar
Dieter Schroeder
Registered Member
Posts
714
Karma
7
OS

Re: rescanning nfs collection

Mon Aug 24, 2009 5:42 pm
If your collection is visible in A2, although the share is not there, A2 won't do a full scan on reconnect of the NFS share.

Anyway, seems there is a problem when the "root" folder of the collection exists, but it is empty.
On my external HDD, which is mounted via hal with dynamic creation of the folder (/media/IOMEGA_HDD in my case), my music is located in a folder (which is on the drive) called "Mucke" and its sub-folders.
So if I forget to power on the HDD, there will obviously be no folder "Mucke" and A2 behaves as stated in my 1st posting.
But in the case of NFS, there is a static mountpoint and folder under /net, /mnt or whatever, so A2 assumes the folder to be updated and starts a scan.
On the other hand my A2 (2.2-git) always does a initial scan on start-up.
The time A2 needs to scan NFS-shares probably could be decreased by adding wsize=8192 and rsize=8192 to the options when mounting the share.
In 2.0.x the whole collection disappeared, that was the reason for the script, btw.
@felixnine:
You can of course add multiple folders to your collection.

m0nk
felixnine
Registered Member
Posts
18
Karma
0
OS

Re: rescanning nfs collection

Mon Aug 24, 2009 5:55 pm
yeah, that's the problem, i have an empty dir when it's not mounted. as for the rescanning, i have to scan 20,000 songs over a wireless link, so i'm not sure i can do that much to speed it up.

i wonder if there's a way to use the nfs mount with hal so it's just not there when it's mounted. thoughts?

also, i could write a shell script that modifies amarok's config and removes the nfs mount from the list of locations to be scanned if the nfs mount is not present.
User avatar
Dieter Schroeder
Registered Member
Posts
714
Karma
7
OS

Re: rescanning nfs collection

Mon Aug 24, 2009 7:33 pm
HAL can't work, because it's not hardware related.
Script doesn't help, because the directories are in the DB, too.
And if your original amarokrc is restored (because of mounted share), you're in the same trouble again.
Have you tried to add the suggested parameters to your fstab?
Seems, that we must wait, until multiple collections are supported.


m0nk
felixnine
Registered Member
Posts
18
Karma
0
OS

Re: rescanning nfs collection

Mon Aug 24, 2009 7:48 pm
right, hal wouldn't work, but i'm wondering if there's an easy gnome-ish way to handle nfs shares, perhaps with gnome volume manager or something?

what about this? is it an amarok 2 thing?

http://amarok.kde.org/wiki/Dynamic_Collection
felixnine
Registered Member
Posts
18
Karma
0
OS

Re: rescanning nfs collection

Mon Aug 24, 2009 7:50 pm
Dieter Schroeder wrote:Script doesn't help, because the directories are in the DB, too.


ah, but if they're in the db, then why not make the script execute a db update?
User avatar
Dieter Schroeder
Registered Member
Posts
714
Karma
7
OS

Re: rescanning nfs collection

Tue Aug 25, 2009 7:32 am
No, it's for 1.4, but should be in A2, too.
Updating the db by script requires a mysqld to be started (if your using the default mysql embedded version)--> starting mysql--> connect to the amarok db--> update the db--> disconnect--> shut down the server.
And it won't help. The problem is not the status of the db, it's the status of your mounts.
The easiest way to prevent A2 is to uncheck the folder watching for the NFS share while offline.

m0nk
felixnine
Registered Member
Posts
18
Karma
0
OS

Re: rescanning nfs collection

Tue Aug 25, 2009 2:19 pm
well, thanks for the insight, i guess it's just something i'll have to deal with for now. i'll post an update if i have any revelations.


Bookmarks



Who is online

Registered users: Baidu [Spider], Bing [Bot], Google [Bot], Yahoo [Bot]