One NFS share mounts fine, the other doesn't

This is a strange problem that is driving me crazy. I’m trying to share two folders via NFS. First I share /media/disk/, that works fine and mounts on a remote computer as expected. Then I try to also share /home/Videos/ but when I add this folder to my /etc/exports I can’t mount any of the shares. I have tried to both do it on command line and with the Yast tool but the result is the same. I have checked permissions on both folders and they are the same. Also if I try to share only /home/Videos/ it won’t mount either. What am I doing wrong?

On Fri, 29 Oct 2010 10:06:01 +0530, scarleo
<scarleo@no-mx.forums.opensuse.org> wrote:

>
> This is a strange problem that is driving me crazy. I’m trying to share
> two folders via NFS. First I share /media/disk/, that works fine and
> mounts on a remote computer as expected. Then I try to also share
> /home/Videos/ but when I add this folder to my /etc/exports I can’t
> mount any of the shares. I have tried to both do it on command line and
> with the Yast tool but the result is the same. I have checked
> permissions on both folders and they are the same. Also if I try to
> share only /home/Videos/ it won’t mount either. What am I doing wrong?
>
>

you are, of course, sure that the files you want to share are not at
/home/<user name>/Videos ?


phani.

Yes they are, sorry it was just a typo. I’m trying to share /home/username/Videos/

On Fri, 29 Oct 2010 11:36:01 +0530, scarleo
<scarleo@no-mx.forums.opensuse.org> wrote:

>
> Yes they are, sorry it was just a typo. I’m trying to share
> /home/username/Videos/
>
>

you wrote permissions were the same; are you sure about that? do others
have permission to enter /home/username to get at the videos? to me this
sounds like a permission issue. you didn’t, by any chance, make the same
typo in /etc/exports that you made in your post?


phani.

I’m sure it’s not a typo in my mount, I’ve been double and triple checking everything. I only did the typo in my post.
I also suspected permission problems, and since I was able to mount the root owned /media/disk/ I also tried setting /home/username/Videos/ to be owned by root to test but that didn’t help. I also tried chmod it to have the exact permissions as the folder I was able to mount. EDIT: To clarify: I have tried it with both ‘username’ and ‘root’ as owners.

But regardless of that /home/username/Videos doesn’t mount, why does it lock the mounting of /media/disk/ when in /etc/exports? This seems very strange to me.

Also to add something more: When I have added /home/username/Videos and it has locked the mounting of /media/disk/ it doesnt help to just remove it and restart the nfsserver, rpcbind and xinetd. I have to remove also the /media/disk/ mount, restart everything and then add it again to be able to mount it again.

On Fri, 29 Oct 2010 12:36:01 +0530, scarleo
<scarleo@no-mx.forums.opensuse.org> wrote:

>
> I’m sure it’s not a typo in my mount, I’ve been double and triple
> checking everything. I only did the typo in my post.
> I also suspected permission problems, and since I was able to mount the
> root owned /media/disk/ I also tried setting /home/username/Videos/ to
> be owned by root to test but that didn’t help. I also tried chmod it to
> have the exact permissions as the folder I was able to mount. EDIT: To
> clarify: I have tried it with both ‘username’ and ‘root’ as owners.
>
> But regardless of that /home/username/Videos doesn’t mount, why does it
> lock the mounting of /media/disk/ when in /etc/exports? This seems very
> strange to me.

setting /home/usern./Videos to be owned by root certainly doesn’t help.
you should leave it in your normal user name. what matters are the
permissions others have in regards to your Video directory, and each file
inside it. you can see those by right-clicking on the folder, then
checking the tab that says “Permissions”. if you want to share it to other
users/machines, ‘everyone’ has to have at least read permission. if the
permissions need to be changed, make sure you click “apply changes to all
subfolders and their content” before saving the changes.


phani.

On Fri, 29 Oct 2010 12:36:01 +0530, scarleo
<scarleo@no-mx.forums.opensuse.org> wrote:

>
> Also to add something more: When I have added /home/username/Videos and
> it has locked the mounting of /media/disk/ it doesnt help to just remove
> it and restart the nfsserver, rpcbind and xinetd. I have to remove also
> the /media/disk/ mount, restart everything and then add it again to be
> able to mount it again.
>

of course, once you’ve mounted something, you have to unmount it (command:
umount) before mounting it again…


phani.

Thanks Phani, the folder is 777 recursively and has been the whole time. The reason I tried with root as user was because I wasn’t sure with what permissions the nfsserver was run as it’s part of the kernel (nobody?). And I knew that I was able to mount a root-owned directory so that’s the reason I tried that, but obviously you’re right since it didn’t work “my way”. So folder, files and subfolders are all chmoded recursively to 777

Of course I unmounted it, and like I said I also restarted nfsserver, rpcbind and xinetd. If I add only /media/disk to my shares it mounts and unmounts without any problem. Whenever /home/username/Videos is in /etc/exports /media/disk won’t mount (and neither does of course /home/user/Videos). If I again remove /home/user/Videos and restart nfsserver, rpcbind and xinetd and try to mount (I have unmounted it before I restarted everything) /media/disk it will not mount. What I have to do to make it mountable again is remove also /media/disk, restart everything and then add /media/disk again, only then it mounts without problem.

I think I found the problem. It was probably the firewall. I had enabled nfsserver, nfsclient and also manually set port 2049 TCP so I thought it would work (and it did sometimes, still not sure why?). I now opened port 2049 UDP and voila! it connected like it should! Thanks for your help.

Yo should do copy/paste of the relevant configuration files like /etc/exports on the server and /etc/fstab on the client. That would:

  1. avoid typos;
  2. give us some real information instead of your story telling.

On Fri, 29 Oct 2010 14:06:02 +0530, scarleo
<scarleo@no-mx.forums.opensuse.org> wrote:

> Thanks Phani, the folder is 777 recursively and has been the whole
> time. The reason I tried with root as user was because I wasn’t sure
> with what permissions the nfsserver was run as it’s part of the kernel
> (nobody?). And I knew that I was able to mount a root-owned directory so
> that’s the reason I tried that, but obviously you’re right since it
> didn’t work “my way”. So folder, files and subfolders are all chmoded
> recursively to 777

hm, dunno. i did the very same thing with my Videos & Music folders, and
it did work. only thing i can imagine is a typo somewhere; if not in
/etc/exports, then perhaps in the mount command? and what’s the
permissions of the /home folder itself? is everyone allowed to ‘enter,’ at
least?


phani.

Yeah, well /etc/fstab isn’t relevant since I’m mounting manually with my own script, but sure I could have copy/pasted /etc/exports and my script. I’ve been up all night so my head is a bit fuzzy, but I’ll try to stay away from “story telling” next time (if any). Thanks for the tip, all sorted now anyway.

On Fri, 29 Oct 2010 14:36:01 +0530, scarleo
<scarleo@no-mx.forums.opensuse.org> wrote:

>
> I think I found the problem. It was probably the firewall. I had enabled
> nfsserver, nfsclient and also manually set port 2049 TCP so I thought it
> would work (and it did sometimes, still not sure why?). I now opened
> port 2049 UDP and voila! it connected like it should! Thanks for your
> help.
>
>

i was thinking of the firewall possibly blocking the mount, but since
/mnt/media worked, i thought this couldn’t be the case. well, what’s that
quote again, “sufficiently advanced technology is not different from
magic,” or something like that? probably to always stop the firewall when
some network connection doesn’t work…


phani.