IBM Support

IBM AIX: NFS mount file write failure

Question & Answer


Question

Why NFS mount file writes >=2g fail with error?

Answer

Writing file >=2g to NFS mount fails with error even when ulimits for file and data are set to unlimited.
Server:
# cat /etc/exports
/datafs -sec=sys,rw
Client:
# mount tcp30:/datafs /NFS-mount-write
# ls -l /tmpDir
-rw-r--r--    1 root     system   2147483648 Mar 14 23:07 2g-file
# cp /tmpDir/2g-file /NFS-mount-write/
cp : 0653-447 Requested a write of 131072 bytes, but wrote only 1.

File size on NFS server shows less than 2g:
Server:
# ls -l /datafs
-rw-r--r--    1 nobody   nobody   2147352576 Mar 14 23:32 2g-file

The NFS v2 uses signed 32-bit offset. Maximum file size supported is 2GB.
Whereas NFS v3 and v4 use 64-bit offset allowing access to file sizes greater than 2G.
To resolve the error, check for NFS2 mounts, unmount and remount as NFS v3 or v4 mount:
# mount
  node       mounted        mounted over    vfs       date        options
-------- ---------------  ---------------  ------ ------------ ---------------
.....
tcp30    /datafs           /NFS-mount-write  nfs    Mar 14 08:50 vers=2
.....
# unmount /NFS-mount-write
Remount as v3 or v4
# mount -o vers=3 tcp30:/datafs /NFS-mount-write
NFS v2 mounts are possible when the:

1. Directory export is set to use NFS v2 protocol:
   /etc/exports:
   /datafs -vers=2,sec=sys,rw
2. Directory is exported without specifying the NFS protocol version, and client mounts the export as v2 protocol:
    Server:
    /etc/exports
    /datafs -sec=sys,rw
    Client:
   # mount -o vers=2 tcp30:/datafs /NFS-mount-write
3. Client mounts the exported directory without specifying protocol version for v3 or unspecified NFS version directory export:
   # mount tcp30:/datafs /NFS-mount-write
When the NFS export is mounted on client without specifying the protocol version with "vers", first,  NFS v3 is tried and if any issues, NFS v2 is tried.  If successful, NFS export is mounted as version 2 protocol.  If unsuccessful,  further attempts continue with transport protocol "udp" instead of "tcp".

To prevent NFS v2 mounts, make sure NFS directory is exported as and client mounts as v3 or v4 protocol. If any issues, this ensures, repeated trials to mount are made using the specified NFS version until it either succeeds or fails.
 

SUPPORT:

If additional assistance is required after completing all of the instructions provided in this document, please follow the step-by-step instructions below to contact IBM to open a case for software under warranty or with an active and valid support contract.  The technical support specialist assigned to your case will confirm that you have completed these steps.

a.  Document and/or take screen shots of all symptoms, errors, and/or messages that might have occurred

b.  Capture any logs or data relevant to the situation.

c.  Contact IBM to open a case:

   -For electronic support, please visit the IBM Support Community:
     https://www.ibm.com/mysupport
   -If you require telephone support, please visit the web page:
      https://www.ibm.com/planetwide/

d.  Provide a good description of your issue and reference this technote

e.  Upload all of the details and data to your case

   -You can attach files to your case in the IBM Support Community
   -Or Upload data to IBM testcase server analysis:

    http://www.ibm.com/support/docview.wss?uid=ibm10733581

f.  Click here to submit feedback for this document.

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG10","label":"AIX"},"Component":"","Platform":[{"code":"PF002","label":"AIX"}],"Version":"All Versions","Edition":"","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}}]

Document Information

Modified date:
19 March 2021

UID

ibm16434119