[Samba] Samba to NFS gateway; incorrect mounted space shown on clients
cknadle at aeroflex.com
Tue Apr 16 08:42:04 GMT 2002
Greetings - and hats off to the Samba coders. ;-) You guys are awesome.
Likewise I would like to thank the entire open source community for
your hard work, generosity, and for their tolerance. :-/
For those in a rush to want to know what the interesting problem
is, skip down to the heading "The Problem:" at the end of the e-mail.
Then come back and read the rest if you're interested.
(Yes, I know I'm verbose - as the saying goes, if I had time I'd write
a shorter letter.)
What we're doing:
We've got a machine running Samba 2.2.3a which is acting both as a PDC for
XP machines _as well as_ acting as an SMB <--> NFS gateway.
(I.E. Windows file sharing of nfs automounted directories).
Yes, we've gotten that all working. No, it wasn't easy.
It's a RedHat 7.2 machine running a stock kernel, but has been updated
with Samba 2.2.3a.
In brief, the network diagram looks something like this:
(Note: this diagram was made in a console text editor)
UNIX NFS machines Samba machine Windows clients
nfs1 -------\ /----- client1
nfs2 ---------\ /------- client2
\-------- Samba -------/
nfs_automounter -/ eth0 eth1 \-------- client3
nfs3 --------/ \------ client4
nfs4 ------/ \---- client5
Why we did this:
1. We were dumb and started using Windows XP for clients, not
realizing that the nfs client programs that we bought did not
support Windows XP. Upon further investigation, none of the
nfs clients support automounting, which sucks.
2. We're cheap. We run a tight budget, and we just don't have the
funds available to buy nfs clients at $120 a pop for all the
3. Integration considerations. We wanted a single way to deal with
all the Windows clients regardless of OS type. Right now we've
got many different nfs clients being used (Solstice, WRQ, and
Hummingbird) and none of them do everything on all versions of
4. Ease of install. With this Samba solution, there is no need to
install any software on each client to get access to file shares.
5. Peace of mind. It's free software, there are no licenses to have
to worry about.
6. Support. Yes I said support. Of the commercial vendors we deal
with, we have many that won't bother to return a phone call until
a week or so later. By then we've either worked it out for
ourselves or we got somebody we knew to do help.
The open source community has more often than not been our
solution for supporting our problems _anyway_. ;-)
- The user's home directories are mounted through nfs automount, and
that seems to work (for the most part), even though the actual location
of the nfs share may be on one of 5 machines, yet it appears that all
users are under /home.
- The Samba machine is able to be a Primary Domain Controller, even
for XP machines. Unfortunately we're probably not going to use
this capacity due to the requirement for automatic failover to a
BDC. In addition, we're not really using the PDC for authentication
purposes anyway, so it might not matter in our case.
The main thing we're getting out of the PDC is the ability to run a
script upon login to track installed software on PC's.
- We've set up two interfaces on the Samba machine with a firewall to
try to separate smb requests from nfs requests, which seems to be
- The box has got software root raid with the ability to boot up on
both drives. Installing grub on both drives to allow for bootup
on both drives was a bit tricky.
- We set up a cool text "dashboard" which uses splitvt to split the
terminal window up _three_ ways (ran splitvt, in the upper window
ran splitvt again.) The bottom window runs top, the uppermost
window runs sar to show network bandwidth information, the middle
window shows raid status.
We used the 'open' command to run the script in an unused tty at
boot time without a login.
- The Samba machine seems to report the incorrect amount of free space to
Windows clients on some NFS shares, but reports correctly on others.
I.E. Windows clients mount "drives" using the "net use" command, and
when the free space is checked, some of the mounts show 20 MB of
total space, with 512 bytes available.
The file shares still work, however. Various file manager programs
(such as the Windows Commander) prompt the user with error messages
concerning the free space available, but if the user requests to
"try anyway", file sharing will function.
This problem, while mostly a matter of annoyance, is a point of
contention due to the fact that the plan was to use this Samba
machine as the single solution to all the nfs shares. As such it is
a requirement to work out all of these issues before I will feel
comfortable touting it as "THE complete solution" for our nfs shares -
but I will be able to say that if I can fix this last problem.
>> What we've learned so far:
- The first nfs file sharing box (nfs1)'s shares never show up having
the incorrect amount of free space. (225 GB total space) However,
all of the shares from the other nfs servers show 20 MB total free
space, with 512 bytes available.
The fact that the same amount of total and free space is available
on file shares from two different nfs servers seems to be a clue,
but I'm not sure what to do with it (yet).
- On the Samba machine, the mounted free space appears to be correct.
I.E. The nfs automounted file shares always show the correct free
space on the Samba machine, but not necessarily on the Windows
clients. This is what is leading me to suspect that the space
misreporting might be an issue at the Samba machine itself, although
right now the focus of the investigation is actually pointed at the
various nfs servers and their configurations to verify that that is
not the main contributor of the problem.
- Likewise the NIS server is being looked at to verify that it has no
involvement in the issue.
- The nfs servers are all Solaris boxes, of different versions. The
nfs server which does not have the space reporting problem is actually
the _oldest_ version of Solaris of the bunch. ;-)
If anyone has any information concerning this issue it would be greatly
Likewise, if anyone would like any information concerning the setup of
the box (any config files, scripts, etc) they are considered open source
and I will make them available.
Vice President, LILUG
vice-president at lilug.org
kb2iqn at freerelay.com
cknadle at aeroflex.com
More information about the samba