I've encountered a puzzling issue with small files on an NFS4 mount. Under 65 bytes they show as using zero data in certain scenarios. This produces apprently empty looking files in (for example) du
output.
# du -csh foo*
4.0K foo # 65 bytes
0 foo2 # 64 bytes
0 foo3 # 0 bytes
4.0K total
The behaviour doesn't seem to belong to du
, as stat
shows something similar (as does ls -ls
).
# stat foo* | grep -E "File|Size"
File: ‘foo’
Size: 65 Blocks: 8 IO Block: 65536 regular file
File: ‘foo2’
Size: 64 Blocks: 0 IO Block: 65536 regular file
File: ‘foo3’
Size: 0 Blocks: 0 IO Block: 65536 regular empty file
Using the following nfs package
nfs-utils-1.3.0-0.68.el7.2.x86_64
Mounted thus:
1.2.3.18:/test on /home/user/mnt type nfs4 (rw,relatime,vers=4.0,rsize=65536,wsize=65536,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=1.2.3.116,local_lock=none,addr=1.2.3.18)
It's not causing a problem as such, but the behaviour was unexpected.
stat foo2
? – Stephen Kitt Aug 09 '22 at 12:03