https://wiki.archlinux.org/api.php?action=feedcontributions&user=Bjschuma&feedformat=atomArchWiki - User contributions [en]2024-03-29T10:20:37ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=NFS&diff=264140NFS2013-06-24T18:42:05Z<p>Bjschuma: </p>
<hr />
<div>[[Category:Networking]]<br />
[[ar:NFS]]<br />
[[de:Network File System]]<br />
[[es:NFS]]<br />
[[fr:NFS]]<br />
[[it:NFSv4]]<br />
[[zh-CN:NFS]]<br />
{{Article summary start}}<br />
{{Article summary text|Article covers configuration of NFSv4 which is an open standard network file sharing protocol.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|NFS Troubleshooting}} - Dedicated article for common problems and solutions.<br />
{{Article summary wiki|NFSv3}} - Deprecated v3 format.<br />
{{Article summary end}}<br />
From [[Wikipedia: Network File System|Wikipedia]]: <br />
:''Network File System (NFS) is a distributed file system protocol originally developed by Sun Microsystems in 1984, allowing a user on a client computer to access files over a network in a manner similar to how local storage is accessed.''<br />
<br />
==Installing==<br />
Both client and server only require the [[Pacman|installation]] of the {{Pkg|nfs-utils}} package.<br />
<br />
{{Note|It is HIGHLY recommended to use a time sync daemon on ALL nodes of your network to keep client/server clocks in sync. Without accurate clocks on all nodes, NFS can introduce unwanted delays! The [[NTP]] system is recommended to sync both the server and the clients to the highly accurate NTP servers available on the Internet.}}<br />
<br />
==Configuration==<br />
<br />
===Server===<br />
==== ID mapping ====<br />
Edit {{ic|/etc/idmapd.conf}} and set the {{ic|Domain}} field to your domain name.<br />
<br />
{{hc|/etc/idmapd.conf|<nowiki><br />
[General]<br />
<br />
Verbosity = 1<br />
Pipefs-Directory = /var/lib/nfs/rpc_pipefs<br />
Domain = atomic<br />
<br />
[Mapping]<br />
<br />
Nobody-User = nobody<br />
Nobody-Group = nobody<br />
</nowiki>}}<br />
==== File system ====<br />
{{Note|For security reasons, it is recommended to use an NFS export root which will keep users limited to that mount point only. The following example illustrates this concept.}}<br />
<br />
Define any NFS shares in {{ic|/etc/exports}} which are relative to the NFS root. In this example, the NFS root will be {{ic|/srv/nfs4}} and we will be sharing {{ic|/mnt/music}}.<br />
<br />
{{bc|# mkdir -p /srv/nfs4/music}}<br />
<br />
Read/Write permissions must be set on the music directory so clients may write to it. <br />
<br />
Now mount the actual target share, {{ic|/mnt/music}} to the NFS share via the mount command:<br />
<br />
{{bc|# mount --bind /mnt/music /srv/nfs4/music}}<br />
<br />
To make it stick across server reboots, add the bind mount to {{ic|fstab}}:<br />
{{hc|/etc/fstab|<br />
/mnt/music /srv/nfs4/music none bind 0 0<br />
}}<br />
<br />
==== Exports ====<br />
Add directories to be shared and an ip address or hostname(s) of client machines that will be allowed to mount them in {{ic|exports}}:<br />
{{hc|/etc/exports|<nowiki><br />
/srv/nfs4/ 192.168.0.1/24(rw,fsid=root,no_subtree_check)<br />
/srv/nfs4/music 192.168.0.1/24(rw,no_subtree_check,nohide) # note the nohide option which is applied to mounted directories on the file system.<br />
</nowiki>}}<br />
<br />
Users need-not open the share to the entire subnet; one can specify a single IP address or hostname as well.<br />
<br />
For more information about all available options see {{ic|man 5 exports}}.<br />
<br />
If you modify {{ic|/etc/exports}} while the server is running, you must re-export them for changes to take effect:<br />
{{bc|# exportfs -ra}}<br />
<br />
====Starting the server====<br />
<br />
[[Daemons|Start/enable]] {{ic|rpc-idmapd.service}} and {{ic|rpc-mountd.service}}. Note that these units require other services, which are launched automatically by [[systemd]].<br />
<br />
===Client===<br />
Clients need {{Pkg|nfs-utils}} to connect, but no special setup is required when connecting to NFS 4 servers.<br />
<br />
====Mounting from Linux====<br />
Show the server's exported filesystems:<br />
{{bc|$ showmount -e servername}}<br />
<br />
Then mount omitting the server's NFS export root: <br />
{{bc|# mount -t nfs4 servername:/music /mountpoint/on/client}}<br />
<br />
=====/etc/fstab Settings=====<br />
Using [[fstab]] is useful for a server which is always on, and the NFS shares are available whenever the client boots up. Edit {{ic|/etc/fstab}} file, and add an appropriate line reflecting the setup. Again, the server's NFS export root is omitted.<br />
{{hc|/etc/fstab|<nowiki><br />
servername:/music /mountpoint/on/client nfs4 rsize=8192,wsize=8192,timeo=14,intr,_netdev 0 0<br />
</nowiki>}}<br />
<br />
{{Note|Additional mount options can be specified here. Consult the NFS man page for further information.}}<br />
Some additional mount options to consider are include:<br />
<br />
* {{ic|1=rsize=8192}} and {{ic|1=wsize=8192}}<br />
* {{ic|1=timeo=14}}<br />
* {{ic|1=intr}}<br />
* {{ic|1=_netdev}}<br />
<br />
The {{ic|rsize}} value is the number of bytes used when reading from the server. The {{ic|wsize}} value is the number of bytes used when writing to the server. The default for both is 1024, but using higher values such as 8192 can improve throughput. This is not universal. It is recommended to test after making this change.<br />
<br />
The {{ic|timeo}} value is the amount of time, in tenths of a second, to wait before resending a transmission after an RPC timeout. After the first timeout, the timeout value is doubled for each retry for a maximum of 60 seconds or until a major timeout occurs. If connecting to a slow server or over a busy network, better performance can be achieved by increasing this timeout value. <br />
<br />
The {{ic|intr}} option allows signals to interrupt the file operation if a major timeout occurs for a hard-mounted share.<br />
<br />
The {{ic|_netdev}} option tells the system to wait until the network is up before trying to mount the share. systemd assumes this for NFS, but anyway it's good practice to use it for all types of networked filesystems<br />
<br />
=====Using autofs=====<br />
Using [[autofs]] is useful when multiple machines want to connect via NFS; they could both be clients as well as servers. The reason this method is preferable over the earlier one is that if the server is switched off, the client will not throw errors about being unable to find NFS shares. See [[autofs#NFS Network mounts]] for details.<br />
<br />
<br />
==== Mounting from Windows ====<br />
{{note|Only the Ultimate and Enterprise editions of Windows 7 and the Enterprise edition of Windows 8 include "Client for NFS".}}<br />
NFS shares can be mounted from Windows if the "Client for NFS" service is activated (which it is not by default).<br />
To install the service go to "Programs and features" in the Control Panel and click on "Turn Windows features on or off". Locate "Services for NFS" and activate it as well as both subservices ("Administrative tools" and "Client for NFS").<br />
<br />
Some global options can be set by opening the "Services for Network File System" (locate it with the search box) and right click on client->properties. <br />
<br />
{{Warning|Serious performance issues may occur (it randomly takes 30-60 seconds to display a folder, 2 MB/s file copy speed on gigabit LAN, ...) to which Microsoft does not have a solution yet.[https://social.technet.microsoft.com/Forums/en-CA/w7itpronetworking/thread/40cc01e3-65e4-4bb6-855e-cef1364a60ac]}}<br />
<br />
To mount a share using Explorer:<br />
<br />
{{ic|Computer}} > {{ic|Map network drive}} > {{ic|servername:/srv/nfs4/music}}<br />
<br />
==== Mounting from OS X ====<br />
{{note|OS X by default uses an insecure (>1024) port to mount a share.}}<br />
Either export the share with the {{ic|insecure}} flag, and mount using Finder:<br />
<br />
{{ic|Go}} > {{ic|Connect to Server}} > {{ic|nfs://servername/}}<br />
<br />
Or, mount the share using a secure port using the terminal:<br />
{{bc|# sudo mount -t nfs -o resvport servername:/srv/nfs4 /Volumes/servername}}<br />
<br />
== Troubleshooting ==<br />
''There is a dedicated article [[NFS Troubleshooting]].''</div>Bjschumahttps://wiki.archlinux.org/index.php?title=NFS&diff=263479NFS2013-06-19T14:58:55Z<p>Bjschuma: </p>
<hr />
<div>[[Category:Networking]]<br />
[[ar:NFS]]<br />
[[de:Network File System]]<br />
[[es:NFS]]<br />
[[fr:NFS]]<br />
[[it:NFSv4]]<br />
[[zh-CN:NFS]]<br />
{{Article summary start}}<br />
{{Article summary text|Article covers configuration of NFSv4 which is an open standard network file sharing protocol.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|NFS Troubleshooting}} - Dedicated article for common problems and solutions.<br />
{{Article summary wiki|NFSv3}} - Deprecated v3 format.<br />
{{Article summary end}}<br />
From [[Wikipedia: Network File System|Wikipedia]]: <br />
:''Network File System (NFS) is a distributed file system protocol originally developed by Sun Microsystems in 1984, allowing a user on a client computer to access files over a network in a manner similar to how local storage is accessed.''<br />
<br />
==Installing==<br />
Both client and server only require the [[Pacman|installation]] of the {{Pkg|nfs-utils}} package.<br />
<br />
{{Note|It is HIGHLY recommended to use a time sync daemon on ALL nodes of your network to keep client/server clocks in sync. Without accurate clocks on all nodes, NFS can introduce unwanted delays! The [[NTP]] system is recommended to sync both the server and the clients to the highly accurate NTP servers available on the Internet.}}<br />
<br />
==Configuration==<br />
<br />
===Server===<br />
==== ID mapping ====<br />
Edit {{ic|/etc/idmapd.conf}} and set the {{ic|Domain}} field to your domain name.<br />
<br />
{{hc|/etc/idmapd.conf|<nowiki><br />
[General]<br />
<br />
Verbosity = 1<br />
Pipefs-Directory = /var/lib/nfs/rpc_pipefs<br />
Domain = atomic<br />
<br />
[Mapping]<br />
<br />
Nobody-User = nobody<br />
Nobody-Group = nobody<br />
</nowiki>}}<br />
==== File system ====<br />
{{Note|For security reasons, it is recommended to use an NFS export root which will keep users limited to that mount point only. The following example illustrates this concept.}}<br />
<br />
Define any NFS shares in {{ic|/etc/exports}} which are relative to the NFS root. In this example, the NFS root will be {{ic|/srv/nfs4}} and we will be sharing {{ic|/mnt/music}}.<br />
<br />
{{bc|# mkdir -p /srv/nfs4/music}}<br />
<br />
Read/Write permissions must be set on the music directory so clients may write to it. <br />
<br />
Now mount the actual target share, {{ic|/mnt/music}} to the NFS share via the mount command:<br />
<br />
{{bc|# mount --bind /mnt/music /srv/nfs4/music}}<br />
<br />
To make it stick across server reboots, add the bind mount to {{ic|fstab}}:<br />
{{hc|/etc/fstab|<br />
/mnt/music /srv/nfs4/music none bind 0 0<br />
}}<br />
<br />
==== Exports ====<br />
Add directories to be shared and an ip address or hostname(s) of client machines that will be allowed to mount them in {{ic|exports}}:<br />
{{hc|/etc/exports|<nowiki><br />
/srv/nfs4/ 192.168.0.1/24(rw,fsid=root,no_subtree_check)<br />
/srv/nfs4/music 192.168.0.1/24(rw,no_subtree_check,nohide) # note the nohide option which is applied to mounted directories on the file system.<br />
</nowiki>}}<br />
<br />
Users need-not open the share to the entire subnet; one can specify a single IP address or hostname as well.<br />
<br />
For more information about all available options see {{ic|man 5 exports}}.<br />
<br />
If you modify {{ic|/etc/exports}} while the server is running, you must re-export them for changes to take effect:<br />
{{bc|# exportfs -ra}}<br />
<br />
====Starting the server====<br />
<br />
[[Daemons|Start/enable]] {{ic|rpc-idmapd.service}} and {{ic|rpc-mountd.service}}. Note that these units require other services, which are launched automatically by [[systemd]].<br />
<br />
===Client===<br />
Clients need {{Pkg|nfs-utils}} to connect, but no special setup is required when connecting to NFS 4 servers.<br />
<br />
====Mounting from Linux====<br />
Show the server's exported filesystems:<br />
{{bc|$ showmount -e servername}}<br />
<br />
Then mount omitting the server's NFS export root: <br />
{{bc|# mount -t nfs4 servername:/music /mountpoint/on/client}}<br />
<br />
=====/etc/fstab Settings=====<br />
Using [[fstab]] is useful for a server which is always on, and the NFS shares are available whenever the client boots up. Edit {{ic|/etc/fstab}} file, and add an appropriate line reflecting the setup. Again, the server's NFS export root is omitted.<br />
{{hc|/etc/fstab|<nowiki><br />
servername:/music /mountpoint/on/client nfs4 rsize=8192,wsize=8192,timeo=14,intr,_netdev 0 0<br />
</nowiki>}}<br />
<br />
{{Note|Additional mount options can be specified here. Consult the NFS man page for further information.}}<br />
Some additional mount options to consider are include:<br />
<br />
* {{ic|1=rsize=8192}} and {{ic|1=wsize=8192}}<br />
* {{ic|1=timeo=14}}<br />
* {{ic|1=intr}}<br />
* {{ic|1=_netdev}}<br />
<br />
The {{ic|rsize}} value is the number of bytes used when reading from the server. The {{ic|wsize}} value is the number of bytes used when writing to the server. The default for both is 1024, but using higher values such as 8192 can improve throughput. This is not universal. It is recommended to test after making this change.<br />
<br />
The {{ic|timeo}} value is the amount of time, in tenths of a second, to wait before resending a transmission after an RPC timeout. After the first timeout, the timeout value is doubled for each retry for a maximum of 60 seconds or until a major timeout occurs. If connecting to a slow server or over a busy network, better performance can be achieved by increasing this timeout value. <br />
<br />
The {{ic|intr}} option allows signals to interrupt the file operation if a major timeout occurs for a hard-mounted share.<br />
<br />
The {{ic|_netdev}} option tells the system to wait until the network is up before trying to mount the share. systemd assumes this for NFS, but anyway it's good practice to use it for all types of networked filesystems<br />
<br />
=====Using autofs=====<br />
Using [[autofs]] is useful when multiple machines want to connect via NFS; they could both be clients as well as servers. The reason this method is preferable over the earlier one is that if the server is switched off, the client will not throw errors about being unable to find NFS shares. See [[autofs#NFS Network mounts]] for details.<br />
<br />
=====Using the kernel keyring for idmapping=====<br />
Using keyrings scales better than using the custom NFS idmap cache, since the custom code can only perform one ID lookup at a time. Edit {{ic|/etc/request-key.conf}} and add in the configuration line anywhere before the negate entry at the end.<br />
{{hc|/etc/request-key.conf|<nowiki><br />
create id_resolver * * /usr/bin/nfsidmap %k %d 600<br />
</nowiki>}}<br />
<br />
==== Mounting from Windows ====<br />
{{note|Only the Ultimate and Enterprise editions of Windows 7 and the Enterprise edition of Windows 8 include "Client for NFS".}}<br />
NFS shares can be mounted from Windows if the "Client for NFS" service is activated (which it is not by default).<br />
To install the service go to "Programs and features" in the Control Panel and click on "Turn Windows features on or off". Locate "Services for NFS" and activate it as well as both subservices ("Administrative tools" and "Client for NFS").<br />
<br />
Some global options can be set by opening the "Services for Network File System" (locate it with the search box) and right click on client->properties. <br />
<br />
{{Warning|Serious performance issues may occur (it randomly takes 30-60 seconds to display a folder, 2 MB/s file copy speed on gigabit LAN, ...) to which Microsoft does not have a solution yet.[https://social.technet.microsoft.com/Forums/en-CA/w7itpronetworking/thread/40cc01e3-65e4-4bb6-855e-cef1364a60ac]}}<br />
<br />
To mount a share using Explorer:<br />
<br />
{{ic|Computer}} > {{ic|Map network drive}} > {{ic|servername:/srv/nfs4/music}}<br />
<br />
==== Mounting from OS X ====<br />
{{note|OS X by default uses an insecure (>1024) port to mount a share.}}<br />
Either export the share with the {{ic|insecure}} flag, and mount using Finder:<br />
<br />
{{ic|Go}} > {{ic|Connect to Server}} > {{ic|nfs://servername/}}<br />
<br />
Or, mount the share using a secure port using the terminal:<br />
{{bc|# sudo mount -t nfs -o resvport servername:/srv/nfs4 /Volumes/servername}}<br />
<br />
== Troubleshooting ==<br />
''There is a dedicated article [[NFS Troubleshooting]].''</div>Bjschumahttps://wiki.archlinux.org/index.php?title=NFS&diff=245702NFS2013-01-30T20:26:55Z<p>Bjschuma: The fsid=0 export option is no longer necessary (or recommended) for NFS v4. Just set up exports the way you would for v3 and v4 should work too.</p>
<hr />
<div>[[Category:Networking]]<br />
[[de:Network File System]]<br />
[[it:NFSv4]]<br />
[[zh-CN:NFS]]<br />
{{Article summary start}}<br />
{{Article summary text|Article covers configuration of NFSv4 which is an open standard network file sharing protocol.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|NFS Troubleshooting}} - Dedicated article for common problems and solutions.<br />
{{Article summary wiki|NFSv3}} - Deprecated v3 format.<br />
{{Article summary end}}<br />
From [[Wikipedia: Network File System|Wikipedia]]: Network File System (NFS) is a distributed file system protocol originally developed by Sun Microsystems in 1984, allowing a user on a client computer to access files over a network in a manner similar to how local storage is accessed.<br />
<br />
This article covers the installation of NFSv4.<br />
==Installing==<br />
Both client and server only require the [[Pacman|installation]] of the {{Pkg|nfs-utils}} package.<br />
<br />
{{Note|It is HIGHLY recommended to use a time sync daemon on ALL nodes of your network to keep client/server clocks in sync. Without accurate clocks on all nodes, NFS can introduce unwanted delays!}}<br />
<br />
The [[NTP]] system is recommended to sync both the server and the clients to the highly accurate NTP servers available on the Internet. <br />
<br />
==Configuration==<br />
<br />
===Server===<br />
==== ID mapping ====<br />
Edit {{ic|/etc/idmapd.conf}} and set the {{ic|Domain}} field to your domain name.<br />
<br />
{{hc|/etc/idmapd.conf|<nowiki><br />
[General]<br />
<br />
Verbosity = 1<br />
Pipefs-Directory = /var/lib/nfs/rpc_pipefs<br />
Domain = atomic<br />
<br />
[Mapping]<br />
<br />
Nobody-User = nobody<br />
Nobody-Group = nobody<br />
</nowiki>}}<br />
==== File system ====<br />
{{Note|For security reasons, it is recommended to use an NFS export root which will keep users limited to that mount point only. The following example illustrates this concept.}}<br />
<br />
Define any NFS shares in {{ic|/etc/exports}} which are relative to the NFS root. In this example, the NFS root will be {{ic|/srv/nfs4}} and we will be sharing {{ic|/mnt/music}}.<br />
<br />
{{bc|# mkdir -p /srv/nfs4/music}}<br />
<br />
Read/Write permissions must be set on the music directory so clients may write to it. <br />
<br />
Now mount the actual target share, {{ic|/mnt/music}} to the NFS share via the mount command:<br />
<br />
{{bc|# mount --bind /mnt/music /srv/nfs4/music}}<br />
<br />
To make it stick across server reboots, add the bind mount to {{ic|fstab}}:<br />
{{hc|/etc/fstab|<br />
/mnt/music /srv/nfs4/music none bind 0 0<br />
}}<br />
<br />
==== Exports ====<br />
Add directories to be shared and an ip address or hostname(s) of client machines that will be allowed to mount them in {{ic|exports}}:<br />
{{hc|/etc/exports|<nowiki><br />
/srv/nfs4/ 192.168.0.1/24(rw,no_subtree_check)<br />
/srv/nfs4/music 192.168.0.1/24(rw,no_subtree_check,nohide) # note the nohide option which is applied to mounted directories on the file system.<br />
</nowiki>}}<br />
<br />
Users need-not open the share to the entire subnet; one can specify a single IP address or hostname as well.<br />
<br />
See {{ic|man exports}} for detailed settings information.<br />
<br />
For more information about all available options see {{ic|man 5 exports}}.<br />
<br />
If you modify {{ic|/etc/exports}} while the server is running, you must reexport them for changes to take effect:<br />
{{bc|# exportfs -ra}}<br />
<br />
====Starting the server====<br />
<br />
The services for the NFS server are {{ic|rpc-idmapd.service}} and {{ic|rpc-mountd.service}}.<br />
<br />
Start them and configure them to start at boot. Read [[Daemons]] for more details.<br />
<br />
Note that these units require others, which are launched automatically by [[systemd]].<br />
<br />
===Client===<br />
Clients need {{Pkg|nfs-utils}} to connect, but no special setup is required when connecting to NFS 4 servers.<br />
<br />
====Mounting from Linux====<br />
Show the server's exported filesystems:<br />
{{bc|$ showmount -e servername}}<br />
<br />
Then just mount as normal: <br />
{{bc|# mount -t nfs4 servername:/srv/nfs4/music /mountpoint/on/client}}<br />
<br />
=====/etc/fstab Settings=====<br />
Using [[fstab]] is useful for a server which is always on, and the NFS shares are available whenever the client boots up. Edit {{ic|/etc/fstab}} file, and add an appropriate line reflecting the setup.<br />
{{hc|/etc/fstab|<nowiki><br />
servername:/music /mountpoint/on/client nfs4 rsize=8192,wsize=8192,timeo=14,intr 0 0<br />
</nowiki>}}<br />
<br />
{{Note|Additional mount options can be specified here. Consult the NFS man page for further information.}}<br />
Some additional mount options to consider are include:<br />
<br />
* {{ic|1=rsize=8192}} and {{ic|1=wsize=8192}}<br />
* {{ic|1=timeo=14}}<br />
* {{ic|1=intr}}<br />
<br />
The {{ic|rsize}} value is the number of bytes used when reading from the server. The {{ic|wsize}} value is the number of bytes used when writing to the server. The default for both is 1024, but using higher values such as 8192 can improve throughput. This is not universal. It is recommended to test after making this change.<br />
<br />
The {{ic|timeo}} value is the amount of time, in tenths of a second, to wait before resending a transmission after an RPC timeout. After the first timeout, the timeout value is doubled for each retry for a maximum of 60 seconds or until a major timeout occurs. If connecting to a slow server or over a busy network, better performance can be achieved by increasing this timeout value. <br />
<br />
The {{ic|intr}} option allows signals to interrupt the file operation if a major timeout occurs for a hard-mounted share.<br />
<br />
=====Using autofs=====<br />
Using [[autofs]] is useful when multiple machines want to connect via NFS; they could both be clients as well as servers. The reason this method is preferable over the earlier one is that if the server is switched off, the client will not throw errors about being unable to find NFS shares. See [[autofs#NFS Network mounts]] for details.<br />
<br />
==== Mounting from Windows ====<br />
{{Warning|Serious performance issues may occur (it randomly takes 30-60 seconds to display a folder, 2 MB/s file copy speed on gigabit LAN, ...) to which Microsoft does not have a solution yet.[https://social.technet.microsoft.com/Forums/en-CA/w7itpronetworking/thread/40cc01e3-65e4-4bb6-855e-cef1364a60ac]}}<br />
{{note|Only the Ultimate and Enterprise editions of Windows 7 and the Enterprise edition of Windows 8 include "Client for NFS"}}<br />
NFS shares can be mounted from windows if the "Client for NFS" service is actived (which it is not by default).<br />
To install the service go to "Programs and features" either through the control panel or by typing it in the search box from the start menu and click on "Turn Windows features on or off". Locate the "Services for NFS" and activate it as well as both subservices ("Administrative tools" and "Client for NFS").<br />
<br />
Some global options can be set by opening the "Services for Network File System" (locate it with the search box) and right clicking on the client->properties. <br />
<br />
{{Warning|Under Windows the share is addressed by its full path on the server, not just the path relative to the nfsroot! If in doubt run {{ic|showmount -e servername}} from '''cmd.exe'''}}<br />
<br />
==== Mounting from OS X ====<br />
{{note|OS X by default uses an insecure (>1024) port to mount a share.}}<br />
Either export the share with the {{ic|insecure}} flag, and mount using Finder:<br />
<br />
{{ic|Go}} > {{ic|Connect to Server}} > {{ic|nfs://servername/}}<br />
<br />
Or, mount the share using a secure port using the terminal:<br />
{{bc|# sudo mount -t nfs -o resvport servername:/srv/nfs4 /Volumes/servername/}}<br />
<br />
== Troubleshooting ==<br />
''There is a dedicated article [[NFS Troubleshooting]].''</div>Bjschumahttps://wiki.archlinux.org/index.php?title=MacBookPro8,x&diff=244286MacBookPro8,x2013-01-17T19:30:16Z<p>Bjschuma: Add my steps for getting Xorg to run on a MBP 8,2 with Grub2 EFI boot</p>
<hr />
<div>[[Category:Apple]]<br />
{{Article summary start}}<br />
{{Article summary text|Details the installation and configuration of Arch Linux on Apple's MacBook Pro 8,1/8,2/8,3}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|MacBook}}<br />
{{Article summary end}}<br />
<br />
discuss at https://bbs.archlinux.org/viewtopic.php?pid=1021706<br />
<br />
== Installation ==<br />
<br />
Use the latest Arch Installation Image from here: https://www.archlinux.org/download/<br />
<br />
=== EFI Boot ===<br />
<br />
Consult [[UEFI]] <br />
<br />
{{Warning|efibootmgr may brick your Mac firmware.}}<br />
<br />
radeon driver which only loads properly on Macs in BIOS emulation mode, problem description and possible solution [https://bugs.freedesktop.org/show_bug.cgi?id=26891 here].<br />
<br />
'''8,1'''<br />
<br />
Tested on macbook pro 8.1 . Forum thread: [https://bbs.archlinux.org/viewtopic.php?id=136833&p=1]<br />
<br />
Add following to Kernel Parameters. <br />
<br />
i915.i915_enable_rc6=1 i915.i915_enable_fbc=1 i915.lvds_downclock=1 usbcore.autosuspend=1 h<br />
<br />
'''8,2 and 8,3'''<br />
<br />
While using EFI Boot, you will find<br />
<br />
radeon 0000:01:00.0: >Invalid ROM contents<br />
i915 0000:00:02.0: Invalid ROM contents<br />
<br />
Which means you need disable KMS for amd and intel card. Add following to Kernel Parameters. <br />
<br />
i915.modeset=0 radeon.modeset=0<br />
<br />
newer versions of the Xorg Intel/i915 driver require KMS to work; without it the X server will fallback to framebuffer mode, with poor performance. The underlying issue is that the Intel KMS driver selects the wrong video output; to fix this try the following settings (tested on an 8,3/17" MBP):<br />
<br />
radeon.modeset=0 i915.modeset=1 i915.lvds_channel_mode=2<br />
<br />
This should give you Intel graphics output. Note that this requires kernel 3.5rc1 or higher; use linux-mainline from Aur if necessary. See [https://bugzilla.kernel.org/show_bug.cgi?id=42842 this bug] for more details.<br />
<br />
If you don't have KMS for intel driver, you need install 'xf86-video-fbdev'<br />
<br />
# pacman -S xf86-video-intel and xf86-video-fbdev<br />
<br />
If Xorg refuses to start with a "no screens found" message you may have to tell Grub2 to turn off the Radeon card and turn on the Intel card during boot. Edit /etc/grub.d/00_header and add the "outb" lines immediately after "set gfxmode=" (Tested on an 8,2 MBP):<br />
<br />
...<br />
set gfxmode=${GRUB_GFXMODE}<br />
outb 0x728 1<br />
outb 0x710 2<br />
outb 0x740 2<br />
outb 0x750 0<br />
load video<br />
...<br />
<br />
Then regenerate your grub.cfg:<br />
<br />
# grub-mkconfig -o /boot/grub/grub.cfg<br />
<br />
==== Using rEFInd and Kernel EFISTUB ====<br />
<br />
'''Install rEFInd'''<br />
<br />
Consult [http://www.rodsbooks.com/refind/installing.html Installing rEFInd]<br />
<br />
Boot into Mac OS X<br />
<br />
# mkdir -p /efi/refind<br />
# cp -r refind/* /efi/refind/<br />
# rm /efi/refind/refind_ia32.efi<br />
# mv /efi/refind/refind.conf-sample /efi/refind/refind.conf and adjust it<br />
# bless --setBoot --folder /efi/refind --file /efi/refind/refind_x64.efi<br />
<br />
'''Setting up EFISTUB'''<br />
<br />
Follow [[UEFI Bootloaders#Linux Kernel EFISTUB]]<br />
<br />
'''Add Kernel MODULES'''<br />
<br />
Without this, you will get 'root fs not found' error.<br />
<br />
Edit /etc/mkinitcpio.conf<br />
<br />
MODULES="..ahci libahci.."<br />
<br />
Then re-generate the boot img:<br />
<br />
# mkinitcpio -p linux<br />
<br />
=== BIOS Boot ===<br />
<br />
Boot into BIOS emulation mode. AMD card works, but intel card doesn't.<br />
<br />
Use refind to load grub-legacy.<br />
<br />
== Network == <br />
<br />
===Wireless:=== <br />
{{Note|need Kernel 3.3 or later}}<br />
<br />
Install {{aur|b43-firmware}} package from the [[AUR]]. <br />
<br />
Unload b43 and bcma modules and load b43 module<br />
<br />
{{bc|<br />
# rmmod b43 bcma<br />
# modprobe b43}}<br />
That's it. The wireless should work now.<br />
<br />
'''Ethernet''': works out-of-the-box<br />
<br />
'''Bluetooth''': Unkown<br />
<br />
== Keyboard & TouchPad == <br />
<br />
'''Keyboard''': <br />
<br />
default F1 key represents XF86MonBrightnessDown, if you want it represents to F1.<br />
<br />
echo 2 > /sys/module/hid_apple/parameters/fnmode<br />
# value 1: F1 is XF86MonBrightnessDown<br />
# value 2: F1 is F1, Fn + F1 is XF86MonBrightnessDown.<br />
<br />
and put that into /etc/rc.local<br />
<br />
'''Touchpad''':<br />
<br />
Two finger scrolling and left-click works out of the box. Unfortunately the right-click is not functional.<br />
<br />
'''14/09/2012 : right click (2 fingers) and middle click (3 fingers) works out of the box with KDE.'''<br />
<br />
To enable most of the multitouch touchpad features (even right and middle clik) use [https://github.com/BlueDragonX/xf86-input-mtrack mtrack], which is avaible in [https://aur.archlinux.org/packages.php?ID=48505 AUR]. The configuration is done via the /etc/X11/xorg.conf.d/10-mtrack.conf file. Check if the mtrack module is properly loaded in the /var/log/Xorg.0.log file. Sometimes xorg loads other drivers before, like eg. synpatics, and the mtrack driver is not used at all.<br />
<br />
For an MBP 8,3 I needed to use the following config (in /etc/X11/xorg.conf.d/10-mtrack.conf) to stop it picking up other input devices by mistake:<br />
<br />
Section "InputClass"<br />
Identifier "Multitouch Touchpad"<br />
Driver "mtrack"<br />
MatchDevicePath "/dev/input/event*"<br />
MatchProduct "bcm5974"<br />
MatchIsTouchpad "true"<br />
EndSection<br />
<br />
== Video & Screen ==<br />
'''13-inch'''<br />
<br />
Intel HD Graphics 3000: works with xf86-video-intel<br />
<br />
Adjust Brightness: works with {{pkg|xorg-xbacklight}}<br />
For example:<br />
<br />
xbacklight -inc 7 # increase brightness<br />
xbacklight -dec 7 # decrease brightness<br />
<br />
'''15-inch and 17-inch'''<br />
<br />
AMD Radeon HD 6490M: Unknown<br />
<br />
AMD Radeon HD 6750M: works with xf86-video-ati<br />
<br />
Adjust Brightness: install AUR package {{aur|apple-bl-gmux}} and reboot system.<br />
<br />
$ echo 34839 | sudo tee /sys/class/backlight/gmux_backlight/brightness<br />
<br />
== Sound ==<br />
<br />
'''8,1 and 8,2'''<br />
<br />
$ alsamixer # unmute 'Front Speaker' and 'Surround Speaker'<br />
<br />
'''8,3'''<br />
<br />
Using [[PulseAudio]] sound works out of the box. However some applications (e.g. [[Vlc]]) have intermittent crackling; appending 'tsched=0' to 'module-udev-detect' in /etc/pulse/default.pa fixes this.<br />
<br />
== Suspend & Hibernate == <br />
<br />
Consulte [[Suspend and Hibernate]].<br />
<br />
'''8,1'''<br />
<br />
For s2ram install [https://aur.archlinux.org/packages.php?ID=44473 uswsusp-git] and add to file /etc/pm/config.d/module following content:<br />
<br />
SUSPEND_MODULES="bcma b43" <br />
SLEEP_MODULE=uswsusp<br />
<br />
Without this, system hangs after the machine wakes up and tries to reconnect to the wireless network.<br />
<br />
'''8,2'''<br />
<br />
BIOS Boot: using linux >= 3.6.2, supend and resume works out-of-the-box.<br />
<br />
EFI Boot: resume may not work.<br />
<br />
'''8,3'''<br />
<br />
Using linux-mainline 3.6r2 from [[AUR]], supend and resume work out of the box, including wireless reconnection.<br />
<br />
== HFS+ ==<br />
<br />
HFS is mounted as Read-Only. By [http://support.apple.com/kb/ht2355 turning journaling off] in OS X, the HFS+ file system will be read/write under Linux.<br />
<br />
== Bluetooth ==<br />
<br />
I had problems pairing devices, nothing was detected with<br />
<br />
hcitool scan<br />
<br />
There seems to be a conflict between the bluetooth module and the b43 one (wifi), as written in [http://blog.tkassembled.com/188/macbook-pro-83-bluetooth-issues-on-linux/ this blog post]. The solution is to do the following:<br />
<br />
# rmmod b43<br />
pair your bluetooth device<br />
# modprobe b43<br />
<br />
=== Alternative solution ===<br />
<br />
Create {{ic|/etc/modprobe.d/b43.conf}} with the following content:<br />
{{bc|1=options b43 btcoex=0}}<br />
<br />
== Webcam ==<br />
<br />
In order to use your webcam you need to have permission to use /dev/video0. <br />
# gpasswd -a <username> video<br />
<br />
Test to see if it works<br />
$ mplayer tv:// -tv driver=v4l2:width=640:height=480:device=/dev/video0 -fps 15 -vf screenshot<br />
<br />
=== With linux-mainline ===<br />
<br />
As noted elsewhere in this document, some MBP features work best (or only) with the latest kernel; the usual way to install this is using the [https://aur.archlinux.org/packages.php?ID=50893 linux-mainline] AUR package. However, as of 3.6.rc3 the config for linux-mainline disables webcam support (due to changed defaults in kernel). [http://pastebin.com/WbYpPrg1 This patch] to the x86_64 config fixes this issue.<br />
<br />
== Others that works-out-of-the-box ==<br />
<br />
* Sensors<br />
<br />
== Troubleshooting ==<br />
<br />
'''Grub2-EFI boot: Intel invalid ROM contents'''<br />
<br />
If you see this error on boot and notice the screen output seemingly frozen, you need to disable KMS.<br />
<br />
Append the following to your /etc/grub/defaults LINUX line:<br />
<br />
i915.modeset=0 radeon.modeset=0<br />
<br />
However, newer versions of the Xorg Intel/i915 driver require KMS to work; without it the X server will fallback to framebuffer mode, with poor performance. The underlying issue is that the Intel KMS driver selects the wrong video output; to fix this try the following settings (tested on an 8,3/17" MBP):<br />
<br />
radeon.modeset=0 i915.modeset=1 i915.lvds_channel_mode=2<br />
<br />
This should give you Intel graphics output. Note that this requires kernel 3.5rc1 or higher; use linux-mainline from Aur if necessary. See [https://bugzilla.kernel.org/show_bug.cgi?id=42842 this bug] for more details.<br />
<br />
You may find you need to enable the Intel device; if using Grub, the following should enable it at boot time:<br />
<br />
set gfxpayload=keep<br />
# Switch gmux to IGD<br />
outb 0x728 1<br />
outb 0x710 2<br />
outb 0x740 2<br />
<br />
Alternatively, if you have OS X available you can use [http://codykrieger.com/gfxCardStatus gfxCardStatus] to switch to the Intel device before booting into Linux.<br />
<br />
'''Grub2-EFI boot: root fs not found'''<br />
<br />
On boot, grub2-efi may complain that no root fs is found. This is due to the ahci modules being improperly loaded. <br />
<br />
chroot into the installed Arch system. Then edit the /etc/mkinitcpio.conf MODULES array:<br />
<br />
MODULES="..ahci libahci.."<br />
<br />
Then re-generate the boot img:<br />
<br />
mkinitcpio -p linux</div>Bjschumahttps://wiki.archlinux.org/index.php?title=NFSv3&diff=210245NFSv32012-06-18T17:32:16Z<p>Bjschuma: </p>
<hr />
<div>[[Category:File systems]]<br />
[[Category:Networking]]<br />
[[cs:NFS]]<br />
[[es:NFS]]<br />
[[fr:NFS]]<br />
[[it:NFS]]<br />
[[ru:NFS]]<br />
[[zh-CN:NFS]]<br />
The goal of this article is to assist in setting up an nfs-server for sharing files over a network.<br />
<br />
*For NFSv4, see: [[NFSv4]]<br />
*nfs-utils has been upgraded since 2009-06-23, and NFS4 support is now implemented. Refer to the [http://www.archlinux.org/news/452/ news bulletin].<br />
*portmap has been replaced by rpcbind.<br />
<br />
==Required packages==<br />
Required packages for both the server and the client are minimal. You will only need to [[pacman|install]] the {{pkg|nfs-utils}} package from the [[Official Repositories|official repositories]]. Optionally, install the {{pkg|keyutils}} package to use the keyring based idmapper on the NFS client.<br />
<br />
==Setting up the server==<br />
You can now edit your configuration and then start the daemons.<br />
<br />
===Files===<br />
<br />
====/etc/exports====<br />
This file defines the various shares on the nfs server and their permissions. A few examples:<br />
/files *(ro,sync) # Read-only access to anyone<br />
/files 192.168.0.100(rw,sync) # Read-write access to a client on 192.168.0.100<br />
/files 192.168.1.1/24(rw,sync) # Read-write access to all clients from 192.168.1.1 to 192.168.1.255<br />
/bsd *(ro,sync,insecure) # BSD clients require insecure as otherwise connections will be rejected by the client<br />
<br />
If you make changes to /etc/exports after starting the daemons, you can make them effective by issuing the following command:<br />
# exportfs -r<br />
<br />
If you decide to make your NFS share public and writable, you can use the all_squash option in combination with anonuid and the anongid option.<br />
For example, to set the privileges for the user nobody in the group nobody, you can do the following:<br />
; Read-write access to a client on 192.168.0.100, with rw access for the user 99 with gid 99<br />
/files 192.168.0.100(rw,sync,all_squash,anonuid=99,anongid=99))<br />
<br />
This also means, that if you want write access to this directory, nobody.nobody must be the owner of the share directory:<br />
# chown -R nobody.nobody /files<br />
<br />
Full details on the exports file are provided by the exports man page.<br />
<br />
====/etc/conf.d/nfs-common.conf====<br />
{{Note|This used to be in /etc/conf.d/nfs which is replaced by "/etc/conf.d/nfs-common.conf" and "/etc/conf.d/nfs-server.conf".}}<br />
<br />
Edit this file to pass appropriate run-time options to nfsd, mountd, statd, and sm-notify. The default Arch NFS init scripts require the --no-notify option for statd, as follows:<br />
STATD_OPTS="--no-notify"<br />
Others may be left at the provided defaults, or changed according to your requirements. Please refer to the relevant man pages for full details.<br />
<br />
===Daemons===<br />
You can now start the server with the following commands:<br />
# rc.d start rpcbind (or: rc.d start portmap)<br />
# rc.d start nfs-common (or: rc.d start nfslock)<br />
# rc.d start nfs-server (or: rc.d start nfsd)<br />
<br />
Please note that they must be started in that order. To start the server at boot time, add these daemons to the DAEMONS array in {{ic|/etc/rc.conf}}. It may be necessary to start the daemons as root / using sudo when you start them from the terminal.<br />
<br />
{{Note|One or more of the daemons may not start if they are backgrounded in your {{ic|/etc/rc.conf}}.}}<br />
<br />
=== systemd services ===<br />
# systemctl enable rpcbind.service rpc-mountd.service exportfs.service<br />
# echo nfsd > /etc/modules-load.d/nfsd.conf<br />
<br />
==Setting up the client==<br />
<br />
===Files===<br />
<br />
====/etc/conf.d/nfs-common.conf====<br />
Edit this file to pass appropriate run-time options to statd - the remaining options are for server use only. Do ''not'' use the --no-notify option on the client side, unless you are fully aware of the consequences of doing so.<br />
<br />
Please refer to the statd man page for full details.<br />
<br />
====/etc/request-key.conf====<br />
Kernels after 2.6.37 support using request-key to find and cache idmapper entries. Using request-key allows multiple idmap requests to be placed at a single time, making it significantly more scalable than the legacy code.<br />
<br />
Please refer to the nfsidmap page for full details.<br />
<br />
===Daemons===<br />
Start the rpcbind and nfs-common daemons:<br />
rc.d start rpcbind (or: rc.d start portmap)<br />
rc.d start nfs-common (or: rc.d start nfslock)<br />
<br />
Please note that they must be started in that order.<br />
<br />
To start the daemons at boot time, add them to the DAEMONS array in /etc/rc.conf.<br />
<br />
===systemd services===<br />
# systemctl enable rpcbind.service rpc-statd.service<br />
<br />
===Mounting===<br />
Show the server's exported filesystems:<br />
showmount -e server<br />
<br />
Then just mount as normal:<br />
mount server:/files /files<br />
<br />
Unlike CIFS shares or [[rsync]], NFS exports must be called by the full path on the server; example, if /home/fred/music is defined in /etc/exports on server ELROND, you must call:<br />
mount ELROND:/home/fred/music /mnt/point<br />
instead of just using:<br />
mount ELROND:music /mnt/point<br />
or you will get ''mount.nfs: access denied by server while mounting''<br />
<br />
{{Note|If you see the following message then you probably did not start the daemons from the [[#Daemons|previous section]] or something went wrong while starting them.<br />
{{bc|<nowiki><br />
mount: wrong fs type, bad option, bad superblock on 192.168.1.99:/media/raid5-4tb,<br />
missing codepage or helper program, or other error<br />
(for several filesystems (e.g. nfs, cifs) you might<br />
need a /sbin/mount.<type> helper program)<br />
In some cases useful info is found in syslog - try<br />
dmesg | tail or so<br />
</nowiki>}}<br />
}}<br />
<br />
===Auto-mount on boot===<br />
If you want to mount on boot, make sure network, rpcbind (portmap), nfs-common (nfslock) and netfs are in the DAEMONS array in /etc/rc.conf. Make sure the order is this one. It is better not to put any '@' in front of them (although you could safely use @netfs); for instance:<br />
DAEMONS=(... network rpcbind nfs-common @netfs ...)<br />
or<br />
DAEMONS=(... network portmap nfslock @netfs ...)<br />
<br />
Add an appropriate line in /etc/fstab, for example:<br />
server:/files /files nfs defaults 0 0<br />
<br />
If you wish to specify a packet size for read and write packets, specify them in your fstab entry. The values listed below are the defaults if none are specified:<br />
server:/files /files nfs rsize=32768,wsize=32768 0 0<br />
<br />
Read the nfs man page for further information, including all available mount options.<br />
<br />
==Troubleshooting==<br />
<br />
===Unreliable performance, slow data transfer, and/or high load when using NFS and gigabit===<br />
====Server Threads====<br />
If your workload involves lots of small reads and writes, there may not be enough threads running on the server to handle the quantity of queries. To check if this is the case, run the following command on one or more of the clients:<br />
<br />
{{bc|<br />
# nfsstat -rc<br />
Client rpc stats:<br />
calls retrans authrefrsh<br />
113482 0 113484<br />
}}<br />
<br />
If the {{ic|retrans}} column contains a number larger than 0, the server is failing to respond to some NFS requests, and the number of threads should be increased.<br />
<br />
To increase the number of threads on the server, edit the file {{ic|/etc/conf.d/nfs-server.conf}} and change the value of the {{ic|NFSD_COUNT}} variable. The default number of threads is 8. Try doubling this number until {{ic|retrans}} remains consistently at zero. Don't be afraid of increasing the number quite substantially. 256 threads may be quite reasonable, depending on the workload. You will need to restart the NFS server daemon each time you modify the configuration file. Bear in mind that the client statistics will only be reset to zero when the client is rebooted.<br />
<br />
Eventually, the bottleneck will cease to be the number of threads, and will likely become the CPU. It's clear when this is the case because the {{ic|retrans}} values are non-zero, but you can see {{ic|nfsd}} threads on the server doing no work. (Use ''htop'', and disable the hiding of kernel threads.)<br />
<br />
====Async====<br />
Verify that the async flag is used in {{ic|/etc/exports}}<br />
Example:<br />
<br />
/nfs4exports 192.168.0.0/24(ro,fsid=0,no_subtree_check,async)<br />
/nfs4exports/data 192.168.0.0/24(rw,no_subtree_check,async,nohide)<br />
/nfs4exports/backup 192.168.0.0/24(rw,no_subtree_check,async,nohide)<br />
<br />
{{Warning|Bear in mind that this could cause data inconsistencies if the NFS server crashes while the client is writing to it. The client may believe that the write succeeded when in fact it did not. If data integrity is important to your setup, do not use the {{ic|async}} option.}}<br />
<br />
====Packetsize====<br />
This is a result of the default packetsize used by NFS, which causes significant fragmentation on gigabit networks. You can modify this behavior by the rsize and wsize mount parameters. Using rsize=32768,wsize=32768 should suffice. Please note that this problem does not occur on 100Mb networks, due to the lower packet transfer speed.<br />
<br />
Default value for NFS4 is 32768. Maximum is 65536. Increase from default in increments of 1024 until maximum transfer rate is achieved.<br />
<br />
===Portmap daemon fails to start at boot===<br />
Make sure you place portmap ''before'' netfs in the daemons array in /etc/rc.conf.<br />
<br />
===Nfsd fails to start with "nfssvc: No such device"===<br />
Make sure the nfs and nfsd modules are loaded in the kernel.<br />
<br />
===rpcbind fails to start with no error when attempting to start via console===<br />
Try starting the daemon using root/sudo.<br />
sudo rc.d start rpcbind<br />
<br />
===Nfsd seems to work, but I cannot connect from MacOS X clients===<br />
When trying to connect from a MacOS X client, you will see that everything is ok at logs, but MacOS X refuses to mount your NFS share. You have to add {{ic|insecure}} option to your share and re-run {{ic|exportfs -r}}.<br />
<br />
===mount.nfs: Operation not permitted===<br />
After updating to nfs-utils 1.2.1-2, mounting NFS shares stopped working. Henceforth, nfs-utils uses NFSv4 per default instead of NFSv3. The problem can be solved by using either mount option {{ic|1='vers=3'}} or {{ic|1='nfsvers=3'}} on the command line: <br />
# mount.nfs <remote target> <directory> -o ...,vers=3,...<br />
# mount.nfs <remote target> <directory> -o ...,nfsvers=3,...<br />
or in {{ic|/etc/fstab}}:<br />
<remote target> <directory> nfs ...,vers=3,... 0 0<br />
<remote target> <directory> nfs ...,nfsvers=3,... 0 0<br />
<br />
===Ownership of mounted shares is 4294967294:4294967294===<br />
The following two values in /etc/conf.d/nfs-common.conf (on the client) need to be set:<br />
NEED_STATD="no"<br />
NEED_IDMAPD="yes"<br />
<br />
== Tips and tricks ==<br />
<br />
=== Configure NFS fixed ports ===<br />
<br />
If you have a port-based firewall, you might want to set up a fixed ports. For rpc.statd and rpc.mountd you should set following settings in {{ic|/etc/conf.d/nfs-common}} and {{ic|/etc/conf.d/nfs-server}} (ports can be different):<br />
{{hc|/etc/conf.d/nfs-common|2=STATD_OPTS="-p 4000 -o 4003"}}<br />
<br />
{{hc|/etc/conf.d/nfs-server|2=MOUNTD_OPTS="--no-nfs-version 2 -p 4002"}}<br />
<br />
{{hc|/etc/modprobe.d/lockd.conf|2=# Static ports for NFS lockd<br />
options lockd nlm_udpport=4001 nlm_tcpport=4001}}<br />
<br />
Then you need restart nfs daemons and reload lockd module:<br />
{{bc|<nowiki># modprobe -r lockd <br />
# modprobe lockd <br />
# rc.d restart nfs-common nfs-server</nowiki>}}<br />
<br />
After restart nfs daemons and reload modules you can check used ports with following command:<br />
{{hc|$ rpcinfo -p|rpcinfo -p<br />
program vers proto port service<br />
100000 4 tcp 111 portmapper<br />
100000 3 tcp 111 portmapper<br />
100000 2 tcp 111 portmapper<br />
100000 4 udp 111 portmapper<br />
100000 3 udp 111 portmapper<br />
100000 2 udp 111 portmapper<br />
100024 1 udp 4000 status<br />
100024 1 tcp 4000 status<br />
100021 1 udp 4001 nlockmgr<br />
100021 3 udp 4001 nlockmgr<br />
100021 4 udp 4001 nlockmgr<br />
100021 1 tcp 4001 nlockmgr<br />
100021 3 tcp 4001 nlockmgr<br />
100021 4 tcp 4001 nlockmgr<br />
100003 2 tcp 2049 nfs<br />
100003 3 tcp 2049 nfs<br />
100003 4 tcp 2049 nfs<br />
100003 2 udp 2049 nfs<br />
100003 3 udp 2049 nfs<br />
100003 4 udp 2049 nfs<br />
100005 3 udp 4002 mountd<br />
100005 3 tcp 4002 mountd}}<br />
<br />
Then, you need to open the ports 111-2049-4000-4001-4002-4003 tcp and udp.<br />
<br />
==Links and references==<br />
* See also [[Avahi]], a Zeroconf implementation which allows automatic discovery of NFS shares.<br />
* HOWTO: [[Diskless network boot NFS root]]<br />
* [http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.prftungd/doc/prftungd/nfs_perf.htm Very helpful]<br />
* If you are setting up the Archlinux NFS server for use by Windows clients through Microsoft's SFU, you will save a lot of time and hair-scratching by looking at [http://bbs.archlinux.org/viewtopic.php?pid=523934#p523934 this forum post] first !<br />
* [http://blogs.msdn.com/sfu/archive/2008/04/14/all-well-almost-about-client-for-nfs-configuration-and-performance.aspx Microsoft Services for Unix NFS Client info]<br />
* [http://blogs.msdn.com/sfu/archive/2007/05/01/unix-interoperability-and-windows-vista.aspx Unix interoperability and Windows Vista] Prerequisites to connect to NFS with Vista</div>Bjschumahttps://wiki.archlinux.org/index.php?title=NFSv3&diff=210244NFSv32012-06-18T17:31:28Z<p>Bjschuma: </p>
<hr />
<div>[[Category:File systems]]<br />
[[Category:Networking]]<br />
[[cs:NFS]]<br />
[[es:NFS]]<br />
[[fr:NFS]]<br />
[[it:NFS]]<br />
[[ru:NFS]]<br />
[[zh-CN:NFS]]<br />
The goal of this article is to assist in setting up an nfs-server for sharing files over a network.<br />
<br />
*For NFSv4, see: [[NFSv4]]<br />
*nfs-utils has been upgraded since 2009-06-23, and NFS4 support is now implemented. Refer to the [http://www.archlinux.org/news/452/ news bulletin].<br />
*portmap has been replaced by rpcbind.<br />
<br />
==Required packages==<br />
Required packages for both the server and the client are minimal. You will only need to [[pacman|install]] the {{pkg|nfs-utils}} package from the [[Official Repositories|official repositories]]. Optionally, install the {{pkg|keyutils}} package to use the keyring based idmapper on the NFS client.<br />
<br />
==Setting up the server==<br />
You can now edit your configuration and then start the daemons.<br />
<br />
===Files===<br />
<br />
====/etc/exports====<br />
This file defines the various shares on the nfs server and their permissions. A few examples:<br />
/files *(ro,sync) # Read-only access to anyone<br />
/files 192.168.0.100(rw,sync) # Read-write access to a client on 192.168.0.100<br />
/files 192.168.1.1/24(rw,sync) # Read-write access to all clients from 192.168.1.1 to 192.168.1.255<br />
/bsd *(ro,sync,insecure) # BSD clients require insecure as otherwise connections will be rejected by the client<br />
<br />
If you make changes to /etc/exports after starting the daemons, you can make them effective by issuing the following command:<br />
# exportfs -r<br />
<br />
If you decide to make your NFS share public and writable, you can use the all_squash option in combination with anonuid and the anongid option.<br />
For example, to set the privileges for the user nobody in the group nobody, you can do the following:<br />
; Read-write access to a client on 192.168.0.100, with rw access for the user 99 with gid 99<br />
/files 192.168.0.100(rw,sync,all_squash,anonuid=99,anongid=99))<br />
<br />
This also means, that if you want write access to this directory, nobody.nobody must be the owner of the share directory:<br />
# chown -R nobody.nobody /files<br />
<br />
Full details on the exports file are provided by the exports man page.<br />
<br />
====/etc/conf.d/nfs-common.conf====<br />
{{Note|This used to be in /etc/conf.d/nfs which is replaced by "/etc/conf.d/nfs-common.conf" and "/etc/conf.d/nfs-server.conf".}}<br />
<br />
Edit this file to pass appropriate run-time options to nfsd, mountd, statd, and sm-notify. The default Arch NFS init scripts require the --no-notify option for statd, as follows:<br />
STATD_OPTS="--no-notify"<br />
Others may be left at the provided defaults, or changed according to your requirements. Please refer to the relevant man pages for full details.<br />
<br />
===Daemons===<br />
You can now start the server with the following commands:<br />
# rc.d start rpcbind (or: rc.d start portmap)<br />
# rc.d start nfs-common (or: rc.d start nfslock)<br />
# rc.d start nfs-server (or: rc.d start nfsd)<br />
<br />
Please note that they must be started in that order. To start the server at boot time, add these daemons to the DAEMONS array in {{ic|/etc/rc.conf}}. It may be necessary to start the daemons as root / using sudo when you start them from the terminal.<br />
<br />
{{Note|One or more of the daemons may not start if they are backgrounded in your {{ic|/etc/rc.conf}}.}}<br />
<br />
=== systemd services ===<br />
# systemctl enable rpcbind.service rpc-mountd.service exportfs.service<br />
# echo nfsd > /etc/modules-load.d/nfsd.conf<br />
<br />
==Setting up the client==<br />
<br />
===Files===<br />
<br />
====/etc/conf.d/nfs-common.conf====<br />
Edit this file to pass appropriate run-time options to statd - the remaining options are for server use only. Do ''not'' use the --no-notify option on the client side, unless you are fully aware of the consequences of doing so.<br />
<br />
Please refer to the statd man page for full details.<br />
<br />
===/etc/request-key.conf===<br />
Kernels after 2.6.37 support using request-key to find and cache idmapper entries. Using request-key allows multiple idmap requests to be placed at a single time, making it significantly more scalable than the legacy code.<br />
<br />
Please refer to the nfsidmap page for full details.<br />
<br />
===Daemons===<br />
Start the rpcbind and nfs-common daemons:<br />
rc.d start rpcbind (or: rc.d start portmap)<br />
rc.d start nfs-common (or: rc.d start nfslock)<br />
<br />
Please note that they must be started in that order.<br />
<br />
To start the daemons at boot time, add them to the DAEMONS array in /etc/rc.conf.<br />
<br />
===systemd services===<br />
# systemctl enable rpcbind.service rpc-statd.service<br />
<br />
===Mounting===<br />
Show the server's exported filesystems:<br />
showmount -e server<br />
<br />
Then just mount as normal:<br />
mount server:/files /files<br />
<br />
Unlike CIFS shares or [[rsync]], NFS exports must be called by the full path on the server; example, if /home/fred/music is defined in /etc/exports on server ELROND, you must call:<br />
mount ELROND:/home/fred/music /mnt/point<br />
instead of just using:<br />
mount ELROND:music /mnt/point<br />
or you will get ''mount.nfs: access denied by server while mounting''<br />
<br />
{{Note|If you see the following message then you probably did not start the daemons from the [[#Daemons|previous section]] or something went wrong while starting them.<br />
{{bc|<nowiki><br />
mount: wrong fs type, bad option, bad superblock on 192.168.1.99:/media/raid5-4tb,<br />
missing codepage or helper program, or other error<br />
(for several filesystems (e.g. nfs, cifs) you might<br />
need a /sbin/mount.<type> helper program)<br />
In some cases useful info is found in syslog - try<br />
dmesg | tail or so<br />
</nowiki>}}<br />
}}<br />
<br />
===Auto-mount on boot===<br />
If you want to mount on boot, make sure network, rpcbind (portmap), nfs-common (nfslock) and netfs are in the DAEMONS array in /etc/rc.conf. Make sure the order is this one. It is better not to put any '@' in front of them (although you could safely use @netfs); for instance:<br />
DAEMONS=(... network rpcbind nfs-common @netfs ...)<br />
or<br />
DAEMONS=(... network portmap nfslock @netfs ...)<br />
<br />
Add an appropriate line in /etc/fstab, for example:<br />
server:/files /files nfs defaults 0 0<br />
<br />
If you wish to specify a packet size for read and write packets, specify them in your fstab entry. The values listed below are the defaults if none are specified:<br />
server:/files /files nfs rsize=32768,wsize=32768 0 0<br />
<br />
Read the nfs man page for further information, including all available mount options.<br />
<br />
==Troubleshooting==<br />
<br />
===Unreliable performance, slow data transfer, and/or high load when using NFS and gigabit===<br />
====Server Threads====<br />
If your workload involves lots of small reads and writes, there may not be enough threads running on the server to handle the quantity of queries. To check if this is the case, run the following command on one or more of the clients:<br />
<br />
{{bc|<br />
# nfsstat -rc<br />
Client rpc stats:<br />
calls retrans authrefrsh<br />
113482 0 113484<br />
}}<br />
<br />
If the {{ic|retrans}} column contains a number larger than 0, the server is failing to respond to some NFS requests, and the number of threads should be increased.<br />
<br />
To increase the number of threads on the server, edit the file {{ic|/etc/conf.d/nfs-server.conf}} and change the value of the {{ic|NFSD_COUNT}} variable. The default number of threads is 8. Try doubling this number until {{ic|retrans}} remains consistently at zero. Don't be afraid of increasing the number quite substantially. 256 threads may be quite reasonable, depending on the workload. You will need to restart the NFS server daemon each time you modify the configuration file. Bear in mind that the client statistics will only be reset to zero when the client is rebooted.<br />
<br />
Eventually, the bottleneck will cease to be the number of threads, and will likely become the CPU. It's clear when this is the case because the {{ic|retrans}} values are non-zero, but you can see {{ic|nfsd}} threads on the server doing no work. (Use ''htop'', and disable the hiding of kernel threads.)<br />
<br />
====Async====<br />
Verify that the async flag is used in {{ic|/etc/exports}}<br />
Example:<br />
<br />
/nfs4exports 192.168.0.0/24(ro,fsid=0,no_subtree_check,async)<br />
/nfs4exports/data 192.168.0.0/24(rw,no_subtree_check,async,nohide)<br />
/nfs4exports/backup 192.168.0.0/24(rw,no_subtree_check,async,nohide)<br />
<br />
{{Warning|Bear in mind that this could cause data inconsistencies if the NFS server crashes while the client is writing to it. The client may believe that the write succeeded when in fact it did not. If data integrity is important to your setup, do not use the {{ic|async}} option.}}<br />
<br />
====Packetsize====<br />
This is a result of the default packetsize used by NFS, which causes significant fragmentation on gigabit networks. You can modify this behavior by the rsize and wsize mount parameters. Using rsize=32768,wsize=32768 should suffice. Please note that this problem does not occur on 100Mb networks, due to the lower packet transfer speed.<br />
<br />
Default value for NFS4 is 32768. Maximum is 65536. Increase from default in increments of 1024 until maximum transfer rate is achieved.<br />
<br />
===Portmap daemon fails to start at boot===<br />
Make sure you place portmap ''before'' netfs in the daemons array in /etc/rc.conf.<br />
<br />
===Nfsd fails to start with "nfssvc: No such device"===<br />
Make sure the nfs and nfsd modules are loaded in the kernel.<br />
<br />
===rpcbind fails to start with no error when attempting to start via console===<br />
Try starting the daemon using root/sudo.<br />
sudo rc.d start rpcbind<br />
<br />
===Nfsd seems to work, but I cannot connect from MacOS X clients===<br />
When trying to connect from a MacOS X client, you will see that everything is ok at logs, but MacOS X refuses to mount your NFS share. You have to add {{ic|insecure}} option to your share and re-run {{ic|exportfs -r}}.<br />
<br />
===mount.nfs: Operation not permitted===<br />
After updating to nfs-utils 1.2.1-2, mounting NFS shares stopped working. Henceforth, nfs-utils uses NFSv4 per default instead of NFSv3. The problem can be solved by using either mount option {{ic|1='vers=3'}} or {{ic|1='nfsvers=3'}} on the command line: <br />
# mount.nfs <remote target> <directory> -o ...,vers=3,...<br />
# mount.nfs <remote target> <directory> -o ...,nfsvers=3,...<br />
or in {{ic|/etc/fstab}}:<br />
<remote target> <directory> nfs ...,vers=3,... 0 0<br />
<remote target> <directory> nfs ...,nfsvers=3,... 0 0<br />
<br />
===Ownership of mounted shares is 4294967294:4294967294===<br />
The following two values in /etc/conf.d/nfs-common.conf (on the client) need to be set:<br />
NEED_STATD="no"<br />
NEED_IDMAPD="yes"<br />
<br />
== Tips and tricks ==<br />
<br />
=== Configure NFS fixed ports ===<br />
<br />
If you have a port-based firewall, you might want to set up a fixed ports. For rpc.statd and rpc.mountd you should set following settings in {{ic|/etc/conf.d/nfs-common}} and {{ic|/etc/conf.d/nfs-server}} (ports can be different):<br />
{{hc|/etc/conf.d/nfs-common|2=STATD_OPTS="-p 4000 -o 4003"}}<br />
<br />
{{hc|/etc/conf.d/nfs-server|2=MOUNTD_OPTS="--no-nfs-version 2 -p 4002"}}<br />
<br />
{{hc|/etc/modprobe.d/lockd.conf|2=# Static ports for NFS lockd<br />
options lockd nlm_udpport=4001 nlm_tcpport=4001}}<br />
<br />
Then you need restart nfs daemons and reload lockd module:<br />
{{bc|<nowiki># modprobe -r lockd <br />
# modprobe lockd <br />
# rc.d restart nfs-common nfs-server</nowiki>}}<br />
<br />
After restart nfs daemons and reload modules you can check used ports with following command:<br />
{{hc|$ rpcinfo -p|rpcinfo -p<br />
program vers proto port service<br />
100000 4 tcp 111 portmapper<br />
100000 3 tcp 111 portmapper<br />
100000 2 tcp 111 portmapper<br />
100000 4 udp 111 portmapper<br />
100000 3 udp 111 portmapper<br />
100000 2 udp 111 portmapper<br />
100024 1 udp 4000 status<br />
100024 1 tcp 4000 status<br />
100021 1 udp 4001 nlockmgr<br />
100021 3 udp 4001 nlockmgr<br />
100021 4 udp 4001 nlockmgr<br />
100021 1 tcp 4001 nlockmgr<br />
100021 3 tcp 4001 nlockmgr<br />
100021 4 tcp 4001 nlockmgr<br />
100003 2 tcp 2049 nfs<br />
100003 3 tcp 2049 nfs<br />
100003 4 tcp 2049 nfs<br />
100003 2 udp 2049 nfs<br />
100003 3 udp 2049 nfs<br />
100003 4 udp 2049 nfs<br />
100005 3 udp 4002 mountd<br />
100005 3 tcp 4002 mountd}}<br />
<br />
Then, you need to open the ports 111-2049-4000-4001-4002-4003 tcp and udp.<br />
<br />
==Links and references==<br />
* See also [[Avahi]], a Zeroconf implementation which allows automatic discovery of NFS shares.<br />
* HOWTO: [[Diskless network boot NFS root]]<br />
* [http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.prftungd/doc/prftungd/nfs_perf.htm Very helpful]<br />
* If you are setting up the Archlinux NFS server for use by Windows clients through Microsoft's SFU, you will save a lot of time and hair-scratching by looking at [http://bbs.archlinux.org/viewtopic.php?pid=523934#p523934 this forum post] first !<br />
* [http://blogs.msdn.com/sfu/archive/2008/04/14/all-well-almost-about-client-for-nfs-configuration-and-performance.aspx Microsoft Services for Unix NFS Client info]<br />
* [http://blogs.msdn.com/sfu/archive/2007/05/01/unix-interoperability-and-windows-vista.aspx Unix interoperability and Windows Vista] Prerequisites to connect to NFS with Vista</div>Bjschumahttps://wiki.archlinux.org/index.php?title=NFSv3&diff=129062NFSv32011-01-26T18:50:16Z<p>Bjschuma: </p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n|NFS}}<br />
<br />
The goal of this article is to assist in setting up an nfs-server for sharing files over a network.<br />
<br />
*For NFSv4, see: [[NFSv4]]<br />
*nfs-utils has been upgraded since 2009-06-23, and NFS4 support is now implemented. Refer to the [http://www.archlinux.org/news/452/ news bulletin].<br />
*portmap has been replaced by rpcbind.<br />
<br />
==Required packages==<br />
Required packages for both the server and the client are minimal. You will only need to install:<br />
# pacman -S nfs-utils rpcbind #instead of rpcbind, you can also install portmap which was replaced<br />
<br />
==Setting up the server==<br />
You can now edit your configuration and then start the daemons.<br />
<br />
===Files===<br />
<br />
====/etc/exports====<br />
This file defines the various shares on the nfs server and their permissions. A few examples:<br />
/files *(ro,sync) # Read-only access to anyone<br />
/files 192.168.0.100(rw,sync) # Read-write access to a client on 192.168.0.100<br />
/files 192.168.1.1/24(rw,sync) # Read-write access to all clients from 192.168.1.1 to 192.168.1.255<br />
<br />
If you make changes to /etc/exports after starting the daemons, you can make them effective by issuing the following command:<br />
# exportfs -r<br />
<br />
If you decide to make your NFS share public and writable, you can use the all_squash option in combination with anonuid and the anongid option.<br />
For example, to set the privileges for the user nobody in the group nobody, you can do the following:<br />
; Read-write access to a client on 192.168.0.100, with rw access for the user 99 with gid 99<br />
/files 192.168.0.100(rw,sync,all_squash,anonuid=99,anongid=99))<br />
<br />
This also means, that if you want write access to this directory, nobody.nobody must be the owner of the share directory:<br />
# chown -R nobody.nobody /files<br />
<br />
Full details on the exports file are provided by the exports man page.<br />
<br />
====/etc/conf.d/nfs-common.conf====<br />
{{Note|This used to be in /etc/conf.d/nfs which is replaced by "/etc/conf.d/nfs-common.conf" and "/etc/conf.d/nfs-server.conf".}}<br />
<br />
Edit this file to pass appropriate run-time options to nfsd, mountd, statd, and sm-notify. The default Arch NFS init scripts require the --no-notify option for statd, as follows:<br />
STATD_OPTS="--no-notify"<br />
Others may be left at the provided defaults, or changed according to your requirements. Please refer to the relevant man pages for full details.<br />
<br />
====/etc/hosts.allow====<br />
To allow network access to the nfs server you should edit /etc/hosts.allow. The following example opens these services to anyone:<br />
nfsd: ALL<br />
rpcbind: ALL<br />
mountd:ALL<br />
<br />
This is a very insecure way of allowing host access. To get better control over who is allowed to access the daemons, hosts.deny should be everyone, and hosts.allow should specifically allow certain people. In this example, 192.168.0.101 should be the IP address of the person(s) allowed to access it. The numbers after the '/' is the netmask:<br />
nfsd: 192.168.0.101/255.255.255.255<br />
rpcbind: 192.168.0.101/255.255.255.255<br />
mountd: 192.168.0.101/255.255.255.255<br />
<br />
This examples enables access for anyone on that network:<br />
nfsd: 192.168.0.0/255.255.255.0<br />
rpcbind: 192.168.0.0/255.255.255.0<br />
mountd: 192.168.0.0/255.255.255.0<br />
<br />
For finer control, read the hosts_access(5) man page.<br />
<br />
===Daemons===<br />
You can now start the server with the following commands:<br />
# /etc/rc.d/rpcbind start (or: /etc/rc.d/portmap start)<br />
# /etc/rc.d/nfs-common start (or: /etc/rc.d/nfslock start)<br />
# /etc/rc.d/nfs-server start (or: /etc/rc.d/nfsd start)<br />
<br />
Please note that they must be started in that order. To start the server at boot time, add these daemons to the DAEMONS array in /etc/rc.conf.<br />
<br />
==Setting up the client==<br />
<br />
===Files===<br />
<br />
====/etc/conf.d/nfs-common.conf====<br />
Edit this file to pass appropriate run-time options to statd - the remaining options are for server use only. Do ''not'' use the --no-notify option on the client side, unless you are fully aware of the consequences of doing so.<br />
<br />
Please refer to the statd man page for full details.<br />
<br />
====/etc/hosts.allow====<br />
You will need to allow rpcbind for the server's ip:<br />
rpcbind: 192.168.0.100/255.255.255.255<br />
<br />
===Daemons===<br />
Start the rpcbind and nfs-common daemons:<br />
/etc/rc.d/rpcbind start (or: /etc/rc.d/portmap start)<br />
/etc/rc.d/nfs-common start (or: /etc/rc.d/nfslock start)<br />
<br />
Please note that they must be started in that order ''or'' start only ''nfs-common'', as ''rpcbind'' will be started as a dependency.<br />
<br />
To start the daemons at boot time, add them to the DAEMONS array in /etc/rc.conf.<br />
<br />
Then just mount as normal:<br />
mount server:/files /files<br />
<br />
Unlike CIFS shares or [[rsync]], NFS exports must be called by the full path on the server; example, if /home/fred/music is defined in /etc/exports on server ELROND, you must call:<br />
mount ELROND:/home/fred/music /mnt/point<br />
instead of just using:<br />
mount ELROND:music /mnt/point<br />
or you will get ''mount.nfs: access denied by server while mounting''<br />
<br />
===Auto-mount on boot===<br />
If you want to mount on boot, make sure network, rpcbind (portmap), nfs-common (nfslock) and netfs are in the DAEMONS array in /etc/rc.conf. Make sure the order is this one. It is better not to put any '@' in front of them (although you could safely use @netfs); for instance:<br />
DAEMONS=(... network rpcbind nfs-common @netfs ...)<br />
or<br />
DAEMONS=(... network portmap nfslock @netfs ...)<br />
<br />
Add an appropriate line in /etc/fstab, for example:<br />
server:/files /files nfs defaults 0 0<br />
<br />
If you wish to specify a packet size for read and write packets, specify them in your fstab entry. The values listed below are the defaults if none are specified:<br />
server:/files /files nfs rsize=32768,wsize=32768 0 0<br />
<br />
Read the nfs man page for further information, including all available mount options.<br />
<br />
==Troubleshooting==<br />
<br />
===Unreliable performance, slow data transfer, and/or high load when using NFS and gigabit===<br />
====Async====<br />
Verify that the async flag is used in {{Filename|/etc/exports}}<br />
Example:<br />
<br />
/nfs4exports 192.168.0.0/24(ro,fsid=0,no_subtree_check,async)<br />
/nfs4exports/data 192.168.0.0/24(rw,no_subtree_check,async,nohide)<br />
/nfs4exports/backup 192.168.0.0/24(rw,no_subtree_check,async,nohide)<br />
<br />
====Packetsize====<br />
This is a result of the default packetsize used by NFS, which causes significant fragmentation on gigabit networks. You can modify this behavior by the rsize and wsize mount parameters. Using rsize=32768,wsize=32768 should suffice. Please note that this problem does not occur on 100Mb networks, due to the lower packet transfer speed.<br />
<br />
Default value for NFS4 is 32768. Maximum is 65536. Increase from default in increments of 1024 until maximum transfer rate is achieved.<br />
<br />
===Portmap daemon fails to start at boot===<br />
Make sure you place portmap ''before'' netfs in the daemons array in /etc/rc.conf.<br />
<br />
===Nfsd fails to start with "nfssvc: No such device"===<br />
Make sure the nfs and nfsd modules are loaded in the kernel.<br />
<br />
===Nfsd seems to work, but I cannot connect from MacOS X clients===<br />
When trying to connect from a MacOS X client, you will see that everything is ok at logs, but MacOS X refuses to mount your NFS share. You have to add {{Codeline|insecure}} option to your share and re-run {{Codeline|exportfs -r}}.<br />
<br />
===mount.nfs: Operation not permitted===<br />
After updating to nfs-utils 1.2.1-2, mounting NFS shares stopped working. Henceforth, nfs-utils uses NFSv4 per default instead of NFSv3. The problem can be solved by using either mount option <code>'vers=3'</code> or <code>'nfsvers=3'</code> on the command line: <br />
# mount.nfs <remote target> <directory> -o ...,vers=3,...<br />
# mount.nfs <remote target> <directory> -o ...,nfsvers=3,...<br />
or in <code>/etc/fstab</code>:<br />
<remote target> <directory> nfs ...,vers=3,... 0 0<br />
<remote target> <directory> nfs ...,nfsvers=3,... 0 0<br />
<br />
===Ownership of mounted shares is 4294967294:4294967294===<br />
The following two values in /etc/conf.d/nfs-common.conf (on the client) need to be set:<br />
NEED_STATD="no"<br />
NEED_IDMAPD="yes"<br />
<br />
==Links and references==<br />
* See also [[Avahi]], a Zeroconf implementation which allows automatic discovery of NFS shares.<br />
* HOWTO: [[Diskless network boot NFS root]]<br />
* [http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.prftungd/doc/prftungd/nfs_perf.htm Very helpful]<br />
* If you are setting up the Archlinux NFS server for use by Windows clients through Microsoft's SFU, you will save a lot of time and hair-scratching by looking at [http://bbs.archlinux.org/viewtopic.php?pid=523934#p523934 this forum post] first !<br />
* [http://blogs.msdn.com/sfu/archive/2008/04/14/all-well-almost-about-client-for-nfs-configuration-and-performance.aspx Microsoft Services for Unix NFS Client info]<br />
* [http://blogs.msdn.com/sfu/archive/2007/05/01/unix-interoperability-and-windows-vista.aspx Unix interoperability and Windows Vista] Prerequisites to connect to NFS with Vista</div>Bjschuma