smbclient disk space on volumes larger than 1 TB

Guntram Blohm gbl at bso2001.com
Wed May 25 14:31:39 MDT 2011


First, sorry for posting to this list without being subscribed - i hope 
this is the right place to post, though.

I am trying to monitor allocation on a remote share by using smbclient, 
sending a 'dir' command, and parsing the 'XXX blocks of size XXX. XXX 
blocks available' line at the end. The problem is, smbclient uses the 
(very old) cli_diskattr family of calls, which return a maximum of 65536 
blocks of size 16777216, which amounts to 1 TB of disk space. If the 
share is larger, this result is just wrong.

The source for libsmb/clifsinfo.c already contains a 
cli_get_fs_full_size_info function, that uses a newer call that can 
return the full disk space even for larger shares. So would it be 
possible to make the client/client.c do_dskattr function use 
cli_get_fs_full_size_info instead of cli_dskattr? (I did that in my 
version, and it seems to work, but since i don't want to claim the 
ability to forsee all implications, and the patch is trivial anyway, i 
decided not to submit it unless asked).

Guntram



More information about the samba-technical mailing list