Connect to Amazon EC2 with NFS

2

0

I'm trying to connect to my Amazon EC2 from my laptop using NFS. I've installed nfs-utils rpcbind and have the following in /etc/exports

/mnt/data/myuser *(rw,async)

Then load the changes

exportfs -ar

And start the services

service rpcbind start
service nfs start
service nfslock start

And finally open the following ports in Amazons "Security Group" for the instance.

  • TCP: 111, 2049
  • UDP: 111, 32806

Then on my laptop (MacBook Pro), i try the following

mkdir test
mount -t nfs myserver.com:/mnt/data/myuser ./test

But I get the following response each time:

mount_nfs: can't mount /mnt/data/myuser from nmdev.no onto ./test: Operation timed out

Any ideas why this might be happening?

frigg

Posted 2013-03-12T13:38:29.073

Reputation: 645

Did you ever fix your problem? I'm experiencing the same issues with mounting an NFS share – Ben Fransen – 2014-04-12T11:12:44.220

Unfortunately I did not – frigg – 2014-05-30T12:49:59.557

Answers

3

I had the same problem, and in my case I had not opened the required ports in my ec2 security group(s).

Double check that you have opened all the ports used by nfs, mountd, rpcbind, and/or portmapper. You can see the list of ports by running rpcinfo -p on the NFS server, for example:

[ec2-user@ip-xxx ~]$ 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
    100005    1   udp  34972  mountd
    100005    1   tcp  38192  mountd
    100005    2   udp  35637  mountd
    100005    2   tcp  57896  mountd
    100005    3   udp  54764  mountd
    100005    3   tcp  38193  mountd
    100003    2   udp   2049  nfs
    100003    3   udp   2049  nfs
    100003    4   udp   2049  nfs
    100227    2   udp   2049  nfs_acl
    100227    3   udp   2049  nfs_acl
    100003    2   tcp   2049  nfs
    100003    3   tcp   2049  nfs
    100003    4   tcp   2049  nfs
    100227    2   tcp   2049  nfs_acl
    100227    3   tcp   2049  nfs_acl
    100021    1   udp  48615  nlockmgr
    100021    3   udp  48615  nlockmgr
    100021    4   udp  48615  nlockmgr
    100021    1   tcp  49687  nlockmgr
    100021    3   tcp  49687  nlockmgr
    100021    4   tcp  49687  nlockmgr

In my case I had already opened 111 and 2049, but none of the ports used by mountd. I was getting a long wait and eventually "Resource not available" when running my mount command, after opening the required ports it works immediately.

user201267

Posted 2013-03-12T13:38:29.073

Reputation: