Find the answer to your Linux question:
Results 1 to 6 of 6
hi all, I am trying to share a folder named "test_share" from server1 to server2 using an nfs share(os-centos 5.2), I am successful in configuring nfs share and able to ...
  1. #1
    Just Joined!
    Join Date
    Sep 2006
    Posts
    4

    Post NFS sharing problem

    hi all,

    I am trying to share a folder named "test_share" from server1 to server2 using an nfs share(os-centos 5.2), I am successful in configuring nfs share and able to access but the file has been reflecting with different owner (user name and group).

    problem is I have a user "test" in both server1 and server2, with UID=500 and GID=500 in server1 and for "test" user in server2 with UID=501 and GID=501, due to this the files which are written by server1 and server2 are appearing as different onwers and can't edit the each other files as files belongs to different users.
    but I wanted the shared directory to have permissions for both users in server1 and server2.

    to make it clear:
    say file named "data_from_server1.txt" is created by test user from server1 in test_share folder.
    and file named "data_from_server2.txt" is created by test user from server2 in nfs shared folder test_share.

    from server1 if I do ls -l following is the result:
    -rw-rw-r-- 1 test test 15 2009-08-01 15:02 data_from_server1.txt
    -rw-rw-r-- 1 sapdb sapsys 11 2009-08-01 15:03 data_from_server2.txt

    from server2 if I do ls -l following is the result:
    -rw-rw-r-- 1 500 500 15 2009-08-01 15:02 data_from_server1.txt
    -rw-rw-r-- 1 test test 11 2009-08-01 15:03 data_from_server2.txt

    This is because sapdb is installed in server1 consisting of UID=501 and GID=501, so in server1 the owner is reflecting as sapdb sapsys and in server2 there are no user with UID and GID 500 so it reflecting as 500 500 as owner,

    due to this problem the files created by server1 can't edited by the test user of server2 and vice versa.

    can anybody Please help in resolving the issue.

  2. #2
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,281
    Check out this PAGE, it might help you.

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  3. #3
    Just Joined!
    Join Date
    Sep 2006
    Posts
    4
    I have read the artical and tried map_static but i am getting following error

    exportfs: /etc/exports:1: unknown keyword "map_static=/etc/nfs/home_test.map"
    I doubt map_static is supported or not in CentOS release 5.2 (Final)

  4. #4
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,281
    I don't know what to tell you then. That was from my quick google search. I don't have this problem as I make sure all files on the share are read/write for everyone. If you are not looking for this then maybe you have to ensure that the users ID is the same on every system.

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  5. #5

  6. #6
    Just Joined!
    Join Date
    Sep 2006
    Posts
    4
    Hi all,

    Thanks you for all your suggestions, I felt nfs v4 is bit tough so I have solved this issue by using nfs v3 where i have exported as follows

    test_share server2(rw,all_squash,anonuid=65534,anongid=65534)

    65534 is nfsnobody as both server having the same UID and GID so I mounted this exported folder in both servers so that applications from both server will write as nfsnobody and have permissions to edit or modify.
    changed test_share folder permission to 0777.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...