Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Gentoo NFS server, ubuntu client: Can mount but no files
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
dylanthomasfan
n00b
n00b


Joined: 02 Mar 2005
Posts: 27

PostPosted: Sun Apr 24, 2011 9:58 pm    Post subject: Gentoo NFS server, ubuntu client: Can mount but no files Reply with quote

Hello,

I am running gentoo-2.6.37-r4 on an AMD64 machine A=10.10.1.3. I am sharing this with another machine, a Ubuntu maverick, with IP 10.10.1.4 (B). So, I export my filesystem like so on machine A.

Code:
MACHINE-A # more /etc/exports
/storage/    10.10.1.4(async,ro,no_subtree_check,all_squash,anonuid=1000,anongid=1000)

MACHINE-A # ls -l /storage
total 12
drwxrwxrwx 41 someuser someuser 4096 Apr 13 21:30 mp3
drwxrwxrwx 33 someuser someuser 4096 Apr 18 21:54 music
drwxrwxrwx  4 someuser someuser 4096 Apr 12 21:12 photos


I then
Code:
exportfs -av
and then
Code:
/etc/init.d/nfs restart
and confirm that nfs is running and will accept both NFS version 2 and 3:

Code:

MACHINE-A # rpcinfo -p
   program vers proto   port  service
    100000    4   tcp    111  portmapper
    100000    3   tcp    111  portmapper
    100000    2   tcp    111  portmapper
    100000    4   udp    111  portmapper
    100000    3   udp    111  portmapper
    100000    2   udp    111  portmapper
    100024    1   udp  46481  status
    100024    1   tcp  54519  status
    100005    1   udp  47437  mountd
    100005    1   tcp  48181  mountd
    100005    2   udp  47768  mountd
    100005    2   tcp  53891  mountd
    100005    3   udp  42775  mountd
    100005    3   tcp  44776  mountd
    100003    2   tcp   2049  nfs
    100003    3   tcp   2049  nfs
    100003    2   udp   2049  nfs
    100003    3   udp   2049  nfs
    100021    1   udp  34369  nlockmgr
    100021    3   udp  34369  nlockmgr
    100021    4   udp  34369  nlockmgr
    100021    1   tcp  56195  nlockmgr
    100021    3   tcp  56195  nlockmgr
    100021    4   tcp  56195  nlockmgr


On my Ubuntu machine, I mount the share like so:

Code:
UBUNTUMACHINE-B # mount MACHINE-A:/storage/ /nfs/


Then, I am able to see directories music, photos and mp3 when I do

Code:
UBUNTUMACHINE-B # ls /nfs/


but when I get into one of the directories, I don't see any files. I suspect this is a file permissions issue, but how do I go about fixing this?
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Mon Apr 25, 2011 12:47 am    Post subject: Reply with quote

because you are mounting them as nfsv4, while your export is valid for nfsv3, it is not for nfsv4, where first directory is your root directory, and then any directories in it must appears with their own rules (i'm still speaking about nfsv4). It's not really even valid for nfsv4, root directory must have fsid=0 but last time i check, if i'm not wrong, nfs was applying it to the first one it see if none with fsid=0 could be found.

imo, it's a design fault, they should have enforce strict format when using an nfsv4 server for exports, and force an nfsv2/3 export inside it to respect the v4 design.

make sure your ubuntu is mounting them as nfsv3, i suppose it works like in gentoo, add -o nfsvers=3 and try add the -v to see what is going on
remember that even you are using nfs as mount option, nfs might not be equal to nfs4 per default (as it is not the case in gentoo), and it's even simplier for your case, you didn't tell the server what version to use, so server decide what version to provide.
and your gentoo server is able to do nfsv4, so if anyone ask a default nfs sharing, your server will provide v4 first, and if your client accept it, all nfsv4 rules will be applied.
And gave your directories the nohide option (and not only to your root directory), if your client is nfsv3 only (i know 0 about ubuntu), the nohide should be enough for your problem.
Back to top
View user's profile Send private message
dylanthomasfan
n00b
n00b


Joined: 02 Mar 2005
Posts: 27

PostPosted: Mon Apr 25, 2011 1:50 pm    Post subject: [Solved] Silly error: each mount point is an export Reply with quote

Thanks for your response, krinn, but it happens to be a rather silly error on my part. I have now resolved the problem, and I see the remote files on the client exactly with the same permissions etc. The key idea is that each mount point gets an export--at least that's how I re-cast the exports and now I see all the files. Let me explain.

On MACHINE-A, I have the following mount points:
Code:

/dev/sdb1           /storage/music
/dev/sdb2           /storage/mp3
/dev/sdb3           /storage/photos

Now, the /etc/exports file should read
Code:

/storage/music/   10.10.1.4(async,ro,no_subtree_check,all_squash,anonuid=1000,anongid=1000)
/storage/mp3/   10.10.1.4(async,ro,no_subtree_check,all_squash,anonuid=1000,anongid=1000)
/storage/photos/   10.10.1.4(async,ro,no_subtree_check,all_squash,anonuid=1000,anongid=1000)


You will note that earlier, I was (incorrectly) exporting /storage like so:
Code:
/storage/    10.10.1.4(async,ro,no_subtree_check,all_squash,anonuid=1000,anongid=1000)

I have the same user with the same UID/GID on both machines, so I don't need the anonuid and anongid clauses in the exports.

I think it is easy to make this mistake, so I wanted to post this resolution to help other folks. Thanks for your time.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum