NFS mount fails

0

newbie question - following the NFS instructions in AWS tutorial but when I use the -t options is fails. https://aws.amazon.com/getting-started/tutorials/create-network-file-system/ step 4 f and g. g. Paste and run the entire sudo mount –t nfs4… command in your SSH window.

sudo mount -t nfs4.1 -o nfsvers=4.1 ...... returns /sbin/mount.nfs4: invalid option -- 't' usage: mount.nfs4 remotetarget dir [-rvVwfnsh] [-o nfsoptions] options: -r Mount file system readonly -v Verbose -V Print version -w Mount file system read-write -f Fake mount, do not actually mount -n Do not update /etc/mtab -s Tolerate sloppy mount options rather than fail -h Print this help nfsoptions Refer to mount.nfs(8) or nfs(5) the -t option is gone but all the commands referenced in the tutorial and multiple searches have it. I've tried other options but

asked a year ago699 views
4 Answers
0

Hi,

If you look closely, it's not -t nsf4.1 but -t nfs4.

profile picture
Donov
answered a year ago
  • I had tried the 4.1 and 4 option $ sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize-1048576,hard,time0=600,retrans=2 fs-024391065c66b61a2.efs.us-east-2.amazonaws.com:/ efs mount.nfs4: an incorrect mount option was specified

0

Hi, It looks like you have a completely basic version of the mount command that doesn't understand there are different types of filesystems that can be mounted (this is what the -t flag handles).

I suspect that if you install the nfs client/tools as part of the installation a different version of the mount command will be made available which does have the -t flag. (node you'd need the nfs client software even if the -t flag was there otherwise the software is not available that can talk to nfs).

How the nfs client is installed varies between different versions of linux - the most likely choice is probably:

sudo yum install nfs-utils rpcbind

if yum isn't on whatever linux version you are using then the next best choice is probably apt

sudo apt install nfs-common

Hope that solves it.

Cheers, Rich

AWS
answered a year ago
  • I had already installed nfs-utils before running the mount commands.

    sudo yum install -y nfs-utils Last metadata expiration check: 0:39:13 ago on Fri May 5 15:40:33 2023. Package nfs-utils-1:2.5.4-2.rc3.amzn2023.0.3.x86_64 is already installed. Dependencies resolved. Nothing to do. Complete!

0

Hi, It looks like there is a typo in your command $ sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize-1048576,hard,time0=600,retrans=2 fs-024391065c66b61a2.efs.us-east-2.amazonaws.com:/ efs mount.nfs4: an incorrect mount option was specified

"time0=600" should be "timeo=600".

If the issue still persists, let me know the error message when you tried to mount the EFS with 't' option.

Cheers, East

AWS
East
answered a year ago
  • $ sudo mount -t nfs4.1 -o nfsvers=4.1,rsize=1048576,wsize-1048576,hard,timeo=600,retrans=2 fs-024391065c66b61a2.efs.us-east-2.amazonaws.com:/ efs /sbin/mount.nfs4: invalid option -- 't' usage: mount.nfs4 remotetarget dir [-rvVwfnsh] [-o nfsoptions] options: -r Mount file system readonly -v Verbose -V Print version -w Mount file system read-write -f Fake mount, do not actually mount -n Do not update /etc/mtab -s Tolerate sloppy mount options rather than fail -h Print this help nfsoptions Refer to mount.nfs(8) or nfs(5)

0

Welcome back!

As per your comment I can see that you specified the -t option to 'nfs4.1' which Donov already mentioned.

$ sudo mount -t nfs4.1 -o nfsvers=4.1,rsize=1048576,wsize-1048576,hard,timeo=600,retrans=2 fs-024391065c66b61a2.efs.us-east-2.amazonaws.com:/ efs

I can see that you're OS is AL2023(Amazon Linux 2023) and the version of nfs-utils is nfs-utils-1:2.5.4-2.rc3.

By default mount command uses NFSv4 with mount -t nfs. If you take a look inside of /sbin directory, you will be able to find /sbin/mount.nfs4 which is symbolic link of /sbin/mount.nfs So mount -t nfs4 will do the same.

-t option is for specifying the filesystem not the version. You will apply the protocol version at nfsvers.

If no version is specified, NFS uses the highest version supported by the kernel and mount command.

Kindly try to mount your EFS as below command and let me know if the issue still goes. I'd be glad to help.

$ sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport fs-024391065c66b61a2.efs.us-east-2.amazonaws.com:/ efs
AWS
East
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions