UNSOLVED

dancaps

updated

1 year ago

D

dancaps

2 Intern

18 Posts

0

12638

April 13th, 2016 07:00

nfs export question

Can someone please explain why this isn't working?

I created a file export in my ecs ui with the following options

Export Path: /ns1/nfsbucket/

Under export host options i did this:

Export host: IP of the client

Permissions: Read/Write

Write Transfer Policy: Sync

Authentication: I didn't select anything here

Mounting Directories: Allow

AnonUser: blank

AnonGroup: blank

RootSquash: blank


From my client I get this:

[nfsclient ~]$ showmount -e ecsnode

Export list for ecsnode:

/ns1/nfsbucket ecsnode

[nfsclient ~]$ sudo mount -t nfs -o vers=3 -o rw,async ecsnode:/ns1/nfsbucket/ /nfsshare/

mount.nfs: access denied by server while mounting ecsnode:/ns1/nfsbucket/

I feel like I'm missing where I should link the user to the bucket. Does anyone have any good setup instructions for mounting nfs?

  • dancaps

    2 Intern

    18 Posts

    3508

    0

    Posted April 15th, 2016 07:00

    This is good information. I've completed all the steps for ecs. Do you know the syntax for the mount command in linux. I keep getting an incorrect mount option error. For the life of me I can't get these options to work either manually or in the fstab file.

  • dancaps

    2 Intern

    18 Posts

    3508

    0

    Posted April 16th, 2016 08:00

    Let me start by saying I'm new to Linux. My background is in windows. I'm also new to NFS. I tell you this so you don't gloss over something you assume I know about.

    I'm pretty confused at this point, but I'll try to tell you everything I've done.

    I've tried manually mounting with various options. I've done some searching on the web to find the options and I now understand the anonuid and anongid aren't client options. At least I think that's the case.

    So that's why this command was getting invalid option error. I also tried various combinations of these options in the fstab file.

    mount -t nfs -v -o vers=3,rw,anonuid=nfsuser01,anongid=nfsgroup1 10.44.236.56:/ns001/bucket001/test/ /nfsshare/

    I moved on to only options I know exist and I came up with this command.

    mount -t nfs -v -o vers=3,rw 10.44.236.56:/ns001/bucket001/test/ /nfsshare

    I get an access denied error on this one. I did more looking online.


    I found information on this file /etc/idmapd.conf so I commented out these lines and changed the user info to match the information in ecs.

    [Mapping]

    Nobody-User = nfsuser01

    Nobody-Group = nfsgroup1

    Still got an access denied error.

    I tried changing the passwd file from

    nfsnobody:x:65534:65534:Anonymous NFS User:/var/lib/nfs:/sbin/nologin

    to this:

    nfsuser01:x:65534:65534:Anonymous NFS nfsuser01:/var/lib/nfs:/sbin/nologin

    and I tried this as well:

    nfsuser01:x:10000:20000:Anonymous NFS User:/var/lib/nfs:/sbin/nologin

    I got the same access denied and I'm not really sure what I'm doing in this file but I feel like I'm on to something here.

    I'd like to point out the I'm using the vers=3 option because when I leave that out it tells me that it's not a supported version. I really think I'm not fully understanding how the permissions work.

  • dancaps

    2 Intern

    18 Posts

    3509

    0

    Posted April 18th, 2016 13:00

    I'm going over the settings again and this is how my bucket is configured. Is this group correct? Is there anyway you could share some screen shots of your working configuration?

    ecs.JPG.jpg

  • dancaps

    2 Intern

    18 Posts

    3509

    0

    Posted April 18th, 2016 13:00

    Ok so this is where I am at.

    I noticed that in your post that when you ran the showmount command it return the path followed by a * also I was using the user and group names in the export instead of the ID number. The later was probably the cause of my problems.

    I recreated my export using the ID number and a wildcard for the export host. It looks like my attachment.

    ecs.JPG.jpg

    So now I run the following command and it mounts! I add the rw option to it because when I try to do anything inside the share I get permission denied.

    Here's what that looks like.

    [root@ric1pdvcsmgt02 /]# mount -t nfs -o sec=sys,vers=3,proto=tcp,rw 10.44.236.56:/ns1/nfsbucket /nfsshare/

    [root@ric1pdvcsmgt02 /]# cd /nfsshare/

    [root@ric1pdvcsmgt02 nfsshare]# ls -al

    total 1

    drwx---rwx. 3 bin 2147483647 96 Apr 18 13:00 .

    -rwxrwx---. 1 bin      20000  0 Apr 18 12:59 file.txt

    [root@ric1pdvcsmgt02 nfsshare]# cat file.txt

    cat: file.txt: Permission denied

    Am I using the right option in the rootsquash field? Any idea what I'm missing here?

  • dancaps

    2 Intern

    18 Posts

    3509

    0

    Posted April 18th, 2016 16:00

    How do I map the bucket owner to the 10000 ID. I thought nfs users and object users were different. I don't have a nfsuser01 account created as an object user.

    mappings.JPG.jpg

    bucket.JPG.jpg

    So are saying that I need to create a nfsuser01 under the users tab and make that the bucket owner. Then create the nfsuser with the same name and map it to 10000?

  • dancaps

    2 Intern

    18 Posts

    1967

    0

    Posted April 20th, 2016 09:00

    I still can't get this to work. I've been able to mount the export but when I try to create a file I get permission denied. I know I'm missing something small here. Could you do me a favor and basically write the steps, maybe even screenshot the pages? I've tried to do it from scratch and these are the steps I'm doing.

    1. Create an object user named nfs_user. I generate a s3 password for this user.

    create nfs user.JPG.jpg

    2. Create a bucket named nfs_bucket and make nfs_user the owner. I also enable file system. I put a group that hasn't been defined anywhere named nfs_group and assign it read, write and execute. I make the retention 1 second.

    create bucket.JPG.jpg

    3. I go to file --> user/ group mapping and create a new user with the same name as the object user I created earlier and assign it an id of 30001

    create nfs user non object.JPG.jpg

    4. I go to file --> user/ group mapping and create a new group with the same name as the group I used earlier during bucket creation and assign it an id of 30002

    create nfs group.JPG.jpg

    5. I go to file --> exports and create a new export. I select the nfs_bucket I created in step 2.

    6. I add an export host. I add * to the export host field, I select Read/Write for permissions, I select Sys for authentication, I allow mounting directories for anonuser I enter the nfs_user id I created of 30001, for anongroup I add the nfs_group id I created of 30002 and for rootsquash I add the nfs_user id of 30001.

    host export options.JPG.jpg

    export creation.JPG.jpg

    At this point I would expect it to be working. I go to the linux client and run this.

    [root@localhost /]# showmount -e 10.44.236.56

    Export list for 10.44.236.56:

    /ns1/test_nfs   *

    /ns1/nfs_bucket *

    /ns1/nfs_test2  *

    [root@localhost /]# mount -t nfs -o vers=3,sec=sys,proto=tcp 10.44.236.56:/ns1/nfs_bucket /nfsshare/

    [root@localhost /]# ls -al /nfsshare/

    total 1

    drwxrwxrwx. 3 30001 30002 96 Apr 20 10:36 .

    [root@localhost /]# touch /nfsshare/file1

    touch: cannot touch ‘/nfsshare/file1’: Permission denied

    [root@localhost /]#

    What step am I missing here?


  • dancaps

    2 Intern

    18 Posts

    1967

    0

    Posted April 20th, 2016 17:00

    So check this out. I changed the users and groups in my export to the name instead of the ID and now I can create directories but I get this weird I/O error when I try and put a file in there.

    [root@localhost /]# mount -t nfs -o vers=3,sec=sys,proto=tcp,async 10.44.236.56:/ns1/nfs_bucket /nfsshare/

    [root@localhost /]# cd /nfsshare/

    [root@localhost nfsshare]# ls -al

    total 1

    drwxrwxrwx. 3 30001 30002 96 Apr 20 18:00 .

    [root@localhost nfsshare]# mkdir test_dir

    [root@localhost nfsshare]# touch test_file

    touch: cannot touch ‘test_file’: Remote I/O error

    [root@localhost nfsshare]# ls -al

    total 1

    drwxrwxrwx. 3 30001 30002 96 Apr 20 18:02 .

    drwxr-xr-x. 3 30001 30002 96 Apr 20 18:02 test_dir

    Also I am mounting the nfs_bucket. The last part "/nfsshare/" is the location I'm mounting to.

    Any ideas on the I/O error?

  • dancaps

    2 Intern

    18 Posts

    1708

    0

    Posted April 21st, 2016 09:00

    Yeah the same thing. I'm going to try and reinstall ecs.

    [root@localhost ~]# chmod 777 /nfsshare/

    [root@localhost ~]# mount -t nfs -o vers=3,sec=sys,proto=tcp,async 10.44.236.56:/ns1/nfs_bucket /nfsshare/

    [root@localhost ~]# cd /nfsshare/

    [root@localhost nfsshare]# ls -al

    total 1

    drwxrwxrwx. 3 30001 30002 96 Apr 20 18:02 .

    drwxr-xr-x. 3 30001 30002 96 Apr 20 18:02 test_dir

    [root@localhost nfsshare]# echo 'test data in test file' > test

    -bash: test: Remote I/O error

    [root@localhost nfsshare]# ls -al

    total 1

    drwxrwxrwx. 3 30001 30002 96 Apr 20 18:02 .

    drwxr-xr-x. 3 30001 30002 96 Apr 20 18:02 test_dir

  • dancaps

    2 Intern

    18 Posts

    1984

    0

    Posted April 21st, 2016 09:00

    Do you mean the acl of the bucket? The only acl information I know about for the nfs export is when you are configuring you user group mappings and you host export options. Both of which I have screenshots of above.

  • dancaps

    2 Intern

    18 Posts

    1782

    0

    Posted April 21st, 2016 13:00

    No problem. I thought I posted a picture of that as well but I didn't.

    exports.JPG.jpg