[Samba] Calculating file size.

jra at dp.samba.org jra at dp.samba.org
Fri Feb 14 05:19:56 GMT 2003


On Thu, Feb 13, 2003 at 08:55:29PM -0800, Jason C. Leach wrote:
> hi,
> 
> Here's an interesting one...
> 
> If I view the files on my Samba server, the file size is reported
> differently depending on if I'm looking from WinXX or Win2k.
> 
> That is, if I do a 'properties' on a file with Windows ME for instance, I
> see 'Size' and 'Size on Disk' numbers that seem reasonable.  Size on Disk is
> slightly larger which seems reasonable.  But if I look from Win2k, the Size
> on Disk is huge!  A 30KB file will show up that way in the Size entry, but
> be 1MB in the Size on Disk entry.  I wondered if this could be because
> Windows thinks samba is an NTFS server, but I note that even looking at
> local files in Win2K on FAT32 shows this sort of discrepancy.
> 
> I had never noticed this until today when a list member asked me about why
> his tape backups of the samba shares were filling the tape soooo quickly.  I
> don't have the problem running the same tape drive from ME, but he's using
> 2k and going through tape like there's no tomorrow.  So I'm guessing that
> the tape software is using the 'Size on Disk' information as it calculates
> what space is left on the tape.
> 
> Can anyone shed light on this and suggest a solution?

Actully, this is my fault. Samba lies on a WNT/W2K "size on disk"
query because someone at a NAS company noticed the WNT/2k use more
efficient read transfers (I think it was) if this size is large.
The tape backup software can't actually read this extra data so
I don't know why it's using the "size on disk" to allocate blocks.

You can change this be modifying the value in include/local.h

/* Allocation roundup. */
#define SMB_ROUNDUP_ALLOCATION_SIZE 0x100000

to a smaller value and recompiling. It hasn't caused trouble enough
to become a runtime parameter.

Jeremy.


More information about the samba mailing list