Editing NFS

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
[[wikipedia:Network_File_System|Network File System]] (NFS) ([[1984]]) is a distributed file system protocol that allow to share files and folders using a TCP network.
+
[[wikipedia:Network_File_System|Network File System]] (NFS) is a distributed file system protocol that allow to share files and folders using a TCP network.
 
 
 
 
* Ports:  Port 111 (TCP and UDP) and 2049 (TCP and UDP) for the NFS server.
 
 
 
  
 
== Installation ==
 
== Installation ==
* <code>[[apt install]] [[nfs-common]]</code>
+
apt install [[nfs-common]]
* <code>apt install nfs-kernel-server</code>
+
apt install nfs-kernel-server
  
* <code>[[systemctl status nfs-server.service]]</code>
+
  [[systemctl]] status [[nfs-server]].service
  
 
== Linux commands ==
 
== Linux commands ==
* <code>[[exportfs]]</code> (<code>apt install [[nfs-kernel-server]]: [[nfsdcltrack]], [[rpc.nfsd]], [[rpc.mountd]]</code>)
+
* <code>[[exportfs]]</code> (<code>apt install nfs-kernel-server</code>)
 
Example output NFS share to everyone:
 
Example output NFS share to everyone:
 
<code>
 
<code>
Line 18: Line 14:
 
/nfs          <world>
 
/nfs          <world>
 
</code>
 
</code>
* <code>[[showmount]]</code>
+
 
* <code>[[mount -t nfs]]</code>
+
 
 +
showmount
 +
Hosts on SERVER_NAME:
 +
 
 +
showmount -e
 +
Export list for SERVER_NAME:
 +
 
 +
 
 +
showmount -e
 +
Export list for SERVER_NAME:
 +
/path/exported 10.10.10.10/24
 +
 
 +
showmount
 +
clnt_create: RPC: Program not registered
 +
 
 +
showmount -e
 +
Restart service: <code>systemctl start nfs-server</code>
  
 
== Windows commands ==
 
== Windows commands ==
 
* <code>[[Get-WindowsFeature]] -Name NFS*</code>
 
* <code>[[Get-WindowsFeature]] -Name NFS*</code>
 
* <code>[[Install-WindowsFeature]] -Name NFS-Client</code>
 
* <code>[[Install-WindowsFeature]] -Name NFS-Client</code>
* <code>[[mount]] 192.168.0.1:/FOLDER_NAME n: </code>
+
* <code>mount 192.168.0.1:/FOLDER_NAME n: </code>
 
* <code>[[New-PSDrive]] -Name Z -PSProvider FileSystem -Root "\\192.168.0.251\FOLDER_NAME"</code><ref>https://www.server-world.info/en/note?os=Windows_Server_2019&p=nfs&f=4</ref>
 
* <code>[[New-PSDrive]] -Name Z -PSProvider FileSystem -Root "\\192.168.0.251\FOLDER_NAME"</code><ref>https://www.server-world.info/en/note?os=Windows_Server_2019&p=nfs&f=4</ref>
** <code>Remove-PSDrive Z </code>
 
* <code>New-PSDrive -Name K -PSProvider FileSystem -Root "\\ServerName\ShareName" -Persist -Scope Global</code><ref>https://community.spiceworks.com/topic/2219152-powershell-mapping-network-drive</ref>
 
* <code>New-PSDrive -Name K -PSProvider FileSystem -Root "\\ServerName\ShareName" -Persist -Credential $cre -Scope Global</code>
 
 
See also: https://davidring.ie/2018/07/06/windows-2016-mount-an-nfs-share/
 
  
== Configuration file: /etc/exports ==
+
== Configuration files ==
<code>[[/etc/exports]]</code> <ref>https://linux.die.net/man/5/exports</ref>
+
<code>/etc/exports</code> <ref>https://linux.die.net/man/5/exports</ref>
  
 
Example:
 
Example:
Line 41: Line 48:
 
:<code>fsid=0</code> signals the NFS server that this export is the root.
 
:<code>fsid=0</code> signals the NFS server that this export is the root.
  
Warning: <code>/etc/exports</code> is affected by adding additional space characters, be mindful about format
+
Warning: /etc/exports is affected by adding additional space characters, be mindful about format
  
 
== NFSv4 ==
 
== NFSv4 ==
[[NFSv4]] no longer utilizes the MOUNT protocol.
+
NFSv4 no longer utilizes the MOUNT protocol.
 
 
== Linux Kernel ==
 
* [[5.12]] [[Eager]] NFS writes
 
 
 
== Related terms ==
 
* [[Round Time Trip]]
 
* [[NetBIOS]]
 
* <code>[[systemctl status rpc-statd]]</code>
 
* [[Nutanix Distributed Filesystem (NDFS)]]
 
* [[Filestore CSI driver]]
 
  
 
== Activities ==
 
== Activities ==
Line 61: Line 58:
 
::Install client (optional): <code> apt-get install nfs-common</code>
 
::Install client (optional): <code> apt-get install nfs-common</code>
  
* [[Mount a remote nfs share]]: <code>[[mount -t nfs]]</code>
+
* Mount a remote nfs share:
* [[List mounted NFS resources]]
+
::<code>[[mount -t nfs]] -o proto=tcp,port=2049 REMOTE_IP_SERVER:/REMOTE_SHARE_DIR /YOUR/LOCAL_DIR/</code>
 +
 +
mount -t nfs4 10.10.10.2:/ ./
 +
mount: /mnt: bad option; for several filesystems (e.g. nfs, cifs) you might need a /sbin/mount.<type> helper program
 +
(Install client: <code> apt-get install nfs-common</code>)
  
 
== See also ==
 
== See also ==
* {{NFS}}
 
 
* [[Red Hat Virtualization|sanlock]] shared storage lock manager
 
* [[Red Hat Virtualization|sanlock]] shared storage lock manager
 
* {{storage protocols}}
 
* {{storage protocols}}
* [[Amazon Elastic File System]] (EFS) and [[EBS]]
+
* [[EFS]] and [[EBS]]
  
 
[[Category:Linux]]
 
[[Category:Linux]]

Please note that all contributions to wikieduonline may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Wikieduonline:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)

Templates used on this page:

Advertising: