24

I have a NFS share folder on a FreeNas system. I'm able to mount this share and use it with this command:

mount -t nfs -o proto=tcp,port=2049 192.168.0.216:/mnt/HDD1
/media/freenas/

I just don't know how to do that in /etc/fstab so it does it automatically. How can I do that?

David Foerster
  • 35,754
  • 55
  • 92
  • 145

2 Answers2

41

A typical /etc/fstab entry for a NFS mount looks like as follows:

192.168.0.216:/mnt/HDD1    /media/freenas/    nfs    defaults    0 0 

The options you supply looks pretty much default, but you can add those as well:

192.168.0.216:/mnt/HDD1    /media/freenas/    nfs    defaults,proto=tcp,port=2049    0 0 
David Foerster
  • 35,754
  • 55
  • 92
  • 145
Thomas
  • 6,143
  • 12
  • 30
  • 36
1

Edit /etc/fstab and append to the end:

192.168.0.216:/mnt/HDD1 /media/freenas/ nfs rw,bg,soft,intr,nosuid 0 0
zx485
  • 2,249
  • 11
  • 24
  • 34
Heron
  • 11
  • 1
  • 1
    .....soft and intr configure the same behavior and should not be used together. Also, soft can lead to data corruption and should not be used unless you understand the nuances deeply. – Ajax May 07 '21 at 00:43