Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 May 1996 14:37:18 -0700 (MST)
From:      Terry Lambert <terry@lambert.org>
To:        brian@MediaCity.com
Cc:        freebsd-questions@FreeBSD.org
Subject:   Re: SAMBA and fs >2.0GB?
Message-ID:  <199605102137.OAA02812@phaeton.artisoft.com>
In-Reply-To: <199605101944.MAA05974@MediaCity.com> from "Brian Litzinger" at May 10, 96 12:44:24 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> I have a 4.3GB filesystem exported to via SAMBA to a Win95 machine.
> The filesystem is currently empty.
> 
> When I use the MS Windows Explorer is says 1.9GB free, rather than
> 4 like I would expect.
> 
> Did I do something wrong, or did I exceed some limit.

Microsoft did something wrong.


There is a Win32 interface for returning up to 32 bits of 512b blocks
for the "available space".

Windows 95 (*STUPIDLY*) uses the INT 21 interface for the disk
"Property" tab for "General".

This means they are limited to reporting a 24 bit value for C/H/S,
which is then remultiplied out to show the space.

This is even more critically dumb, since a transfer of 0 bytes is
legal (in fact required: a 0 byte write is how DOS truncates files).

This means that the 64k cluster size is illegal, so they are limited
to 32k clusters (or they would be one byte shy of a full transfer
of 64k if they tried to use 64k clusters).

This puts a limit of 1 additional bit, which is 2G of space (which would
be there anyway -- the control panel and the "DIR" code both use
signed artihmatic -- dumb, dumb, dumb, dumb).

Why did they do this?  At least part of it is that their programmers
got lazy... using the INT 21 interface was easier than the Win32.
The other part of it has to be that this promotes sales of NT.  8-|.

Drives mapped to NetWare volumes report the same thing (NetWare is
also DOS centric, instead of fixing the reporting in the requester
so at least the whole client could be fixed at once without impacting
the server).

Basically, you will see 2G reported as "free space" for any amount
of space, 2G or larger, until you start filling it to the point that
less than 2G is available.  Then it will report the true amount (and
eventually start lying about the amout of used space, when it tops
2G).


Also unfortuantely, the "fake up the 24 bit value" API to simulate
the INT 21 on network and protected mode disk drivers isn't automatically
truncated and factored for you.  This means that the server software
has to intentionally under report it because the overreport of 24 bits
won't be filtered at the Ring 0 -> Ring 3 INT 21 code thunk... like
it would be if it had been written by anyone other than a student hire
(even a good student hire wouldn't have screwed up this way, IMO).

So the short answer is that Win95 is incapable of reporting more than
2G accurately.


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199605102137.OAA02812>