The server and client are both using Ubuntu 16.04. I have setup both Samba and NFS on the server. I have installed both cifs-utils and the nfs utils on the client. When I run `df -h` on the server I get the following output: terrance@terrance-ubuntu:~$ ssh 10.0.0.220 'df -h' /dev/md1p1 15T 7.4T 6.4T 54% /media/storage Then I go and set up both mounts on my client for testing: terrance@terrance-ubuntu:~$ df -h 10.0.0.220:/media/storage 15T 7.4T 6.4T 54% /media/NAS //10.0.0.220/storage 15T 8.1T 6.4T 57% /cifs/server The first one listed above is the NFS mount. As a test last night I copied an 18GB file to my server and the CIFS mount reported now 8.4T used. When I deleted the file it went back to 8.1T used. There is no way 18GB = 300GB. What is the reason for the discrepancy in the used size calculations for the CIFS mount? Thank you!
Just tested in 18.04 with the same issue. apt-cache policy cifs-utils cifs-utils: Installed: 2:6.8-1 Candidate: 2:6.8-1 Version table: *** 2:6.8-1 500 500 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 Packages 100 /var/lib/dpkg/status
Just checked with Ubuntu 20.04 LTS and it too has the exact same issue even with a newer version: apt-cache policy cifs-utils cifs-utils: Installed: 2:6.9-1ubuntu0.1 Candidate: 2:6.9-1ubuntu0.1 Version table: *** 2:6.9-1ubuntu0.1 500 500 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages 100 /var/lib/dpkg/status 2:6.9-1 500 500 http://us.archive.ubuntu.com/ubuntu focal/main amd64 Packages
Still occurring in Ubuntu 22.04 LTS smbd --version Version 4.15.9-Ubuntu apt-cache policy cifs-utils cifs-utils: Installed: 2:6.14-1ubuntu0.1 Candidate: 2:6.14-1ubuntu0.1
Hi Terrance. Can you provide a network trace of the timeframe when you do a "df -h" please? This way we can check if: - the server sends unexpected info and the client just pass it on as-is to userspace - the server sends expected info, but the client modifies it somehow - the server sends unexpected info and the client modifies it to something else even Thanks!
Hi Enzo! What command output are you looking for? I don't think I am familiar with doing a network trace of the timeframe for df. Can you please tell me a command that I can run so that I can get you that output?
You can do something like this, with tcpdump package installed: <in terminal 1> > $ sudo mount.cifs <...mount options...> //10.0.0.220/storage /cifs/server <in terminal 2> > $ sudo tcpdump -i eth0 -s 0 -w wrong-df.pcap port 445 (of course, replace "eth0" with the network interface that connects to 10.0.0.220) <back to terminal 1> > $ df -h <go back to terminal 2> > press ctrl-c to terminate tcpdump capture Then you attach the new file "wrong-df.pcap" here please, along with the size shown by "df -h" in terminal 1, and the size you expected to see. A "df -h" output from the server side at the same time you see the discrepancy would be nice as well.
Created attachment 17506 [details] Incorrect Space when using Samba share being reported File containing incorrect Space when using Samba share being reported
Top line is the Samba mounted share and the bottom line is the exact same share mounted on NFS. Filesystem Size Used Avail Use% Mounted on {..} //10.0.0.220/storage 15T 9.1T 5.5T 63% /media/Samba 10.0.0.220:/media/storage 15T 8.3T 5.5T 61% /media/NAS
Sorry, NFS share is correct. terrance@terrance-ubuntu:~$ ssh 10.0.0.220 'df -h' Filesystem Size Used Avail Use% Mounted on tmpfs 368M 3.3M 364M 1% /run /dev/md0 455G 320G 112G 75% / tmpfs 1.8G 16K 1.8G 1% /dev/shm tmpfs 5.0M 4.0K 5.0M 1% /run/lock /dev/md1p1 15T 8.3T 5.5T 61% /media/storage tmpfs 368M 120K 367M 1% /run/user/1000