1833452 Members
3219 Online
110052 Solutions
New Discussion

Size of NFS File

 
Pete Randall
Outstanding Contributor

Size of NFS File

Two 11.11 systems, similar patch levels, both looking at the same file exported from a Linux box. Running bdf reports identical FS sizes, both allocated and used. Running ls -l or du reports entirely different sizes.

On one machine it comes up with just over 1GB:
-rw-rw-rw- 1 informix informix 103709016064 Mar 20 10:11 ontape.unl

The other reports far less:
-rw-rw-rw- 1 informix informix 629800960 Mar 20 10:11 ontape.unl

I'm chalking it up to null spaces in the file. One system is bright enough to recognize that they are null so it doesn't report that space and the other system isn't so bright. My DBA bought that "explanation" but I'd like to confirm that it's even reasonable.

Thoughts?


Pete

Happy First Day of Spring!

Pete
11 REPLIES 11
Patrick Wallek
Honored Contributor

Re: Size of NFS File

103,709,016,064 bytes /1024 / 1024 / 1024 = 96.5 GB (Way more than 1 GB, unless there's a typo somewhere)

629,800,960 bytes / 1024 / 1024 / 1024 = 0.58 GB

I'm not sure why the 2 11.11 systems would show different sizes. That doesn't make a whole lot of sense to me.

What does the Linux server show for the size?
James R. Ferguson
Acclaimed Contributor

Re: Size of NFS File

Hi Pete:

Differences in 'ls' versus 'du' point to sparse files as you stated.

If you 'cp' a sparse file, for instance, the "holes" are allocated growing the file size as reported.

Regards!

...JRF...
Patrick Wallek
Honored Contributor

Re: Size of NFS File

Another question --

What NFS versions on HP-UX and Linux?
Pete Randall
Outstanding Contributor

Re: Size of NFS File

Always one of my favorite questions: NFS versions. How is one supposed to tell?

And no, that is not a typo on the size, Patrick.


Pete

Pete
T G Manikandan
Honored Contributor

Re: Size of NFS File

/usr/sbin/rpcinfo -p
T G Manikandan
Honored Contributor

Re: Size of NFS File

nfsstat -m
on the client will show the mounted filesystems and their versions.
Pete Randall
Outstanding Contributor

Re: Size of NFS File

On the 95GB system:
# rpcinfo -p |grep nfs
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
100003 2 tcp 2049 nfs
100003 3 tcp 2049 nfs
# nfsstat -m
/nfs/hyper4/big from hyper4:/big (Addr 130.1.1.170)
Flags: vers=3,proto=tcp,auth=unix,hard,intr,link,symlink,rsize=32768,wsize=32
768,retrans=5

On the "small" system:
# rpcinfo -p |grep nfs
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
100003 2 tcp 2049 nfs
100003 3 tcp 2049 nfs
# nfsstat -m
The file isn't there anymore, so I get nothing!

And the size was supposed to be right around 100GB.


Pete

Pete
Dennis Handly
Acclaimed Contributor

Re: Size of NFS File

What does "ll -e" show for the size of the sparse file?
Matti_Kurkela
Honored Contributor

Re: Size of NFS File

NFS v2 has an upper limit of 4 GB, i.e. the allowable sizes are from 0 to (4 GB - 1).

If the top bits of the binary value of 103709016064 are cut off so that the value fits within the 4 GB limit, we get...

103709016064 AND (4 * 1024^3 - 1) = 629800960

... which is *exactly* what the other machine shows.

Based on this evidence, I would assume that the other server has been configured to mount the filesystem using NFSv2.

MK
MK
Pete Randall
Outstanding Contributor

Re: Size of NFS File

Since my ever-so-patient DBA blew away the file before I could even finish answering your questions, it's all moot now.

Thanks for trying, though!


Pete

Pete
Dennis Handly
Acclaimed Contributor

Re: Size of NFS File

>MK: 103709016064 AND (4 * 1024^3 - 1) = 629800960

With ksh you can do:
echo $((103709016064 & 16#ffffffff))
629800960