Why would file be created with 0 byte size in a NFS share?
Applies to
- ONTAP 9
- NFS
Answer
- When a file is shown as 0 byte in size this is likely due to a copy operation that has been interrupted
- 0 byte files can be seen after an NDMP restore
- An NDMP restore is a data recovery process that uses the Network Data Management Protocol (NDMP) to move data directly from backup storage to NAS devices
- NFS Client Hangs/Timeouts - If the NFS client hangs during a large file transfer, the file entry may exist, but the data never finishes writing, resulting in a 0-byte file
- Clients creating the files may not have the relevant permissions:
- The file is created with permissions 777, but a subsequent SETATTR call to change the file permissions to 755 fails with an NFS3ERR_PERM error
- CREATE Call: Client sends a CREATE call with permissions 777, and the file is created successfully
- SETATTR Call: Client sends a SETATTR call to set the file permissions to 755, which fails with an error
- File Exists Check: Client checks if the file exists, and it does
- File Update: Client updates the file's mtime
- File Write: Client writes to the file
- Ensure that the client has the necessary permissions to change file attributes
- Verify that the SETATTR call is correctly formatted and that the client has the required permissions to modify the file's attributes
- Capacity issues - check with volume show to ensure there is enough capacity on the required volumes
