Changing an NFS mount and path...

Colin Guthrie gmane at colin.guthr.ie
Fri Nov 30 12:36:59 UTC 2007


Hi,

I knew this day would come but I've been putting it off!!

A long time ago on my home server I had separate partitions for
/mnt/media (where I keep my movies and music) and /home (where I keep my
home). Following a RAID rebuild some time ago (year or so) I just put
all the space into /home as it just seemed to make more sense and would
make moving files around faster etc.

As I had several apps configured for the /mnt/media path (myth, amarok
etc.) I just did a bind mount of /home/media to /mnt/media.

OK, so "where's the NFS reference" I hear you all scream in
anticipation.. Well, I NFS export both /home and /mnt/media to my
network and I run amarok on my laptop. This has worked fine for ages,
but I recently upgraded my server and the whole bind mount thing has
confused it slightly! It detects that /mnt/media and /home are actually
part of the same filesystem and when I mount /home or /mnt/media it
displays a warning saying that they have the same filehandle and it
arbitrarily picks the first one. This means that on my client both /home
and /mnt/media both look like /mnt/media. This is clearly (IMO) a
problem/bug with the NFS server but that aside I should really use this
opportunity to tidy things up and get my paths right.

So I want to move my NFS path in Amarok but preserve the stats/ratings etc.

Looking in the db I can change the mount path in the devices table but
the real problem is that I'm changing how it's mounted.

Previously:
[/mnt/media]/audio/file.ogg
Now:
[/home]/media/audio/file.ogg

As you can see the mount point has changed but so has the path.

Is there any way to update the path in the db nicely or will I just have
to do it all manually and find all tables that have a deviceid +
filename and update them accordingly?

Long winded way of asking quite a simple question!!

Col




More information about the Amarok mailing list