[LUNI] newbie question on file sharing

Ramin K ramin-list at badapple.net
Mon Feb 26 11:32:35 CST 2007


Carey Tyler Schug wrote:
> It's time I set up a file server so I can make a coordinated effort a 
> making backups.  I have two part time windows machine (and maybe more in 
> the future), and I don't want to install anything on Windows to do this, 
> so I believe I need Samba.
> 
> All clients will be accessing the same directory.  Should the Linux 
> machines use a client to Samba, or should I set up a separate native *ix 
> file sharing?  A quick search turned up smbclient to do this, but I 
> thought there used to be something with an entirely different name.
> 
> The question is would it be a problem to have two filesharing daemons 
> accessing the same directory on the file server host?  And does the 
> local machine need to access via the filesharing daemon, or can it go 
> directly to the disk?
> This is on my local network, and non-critical data, so there might be 
> some justification for sending passwords encrypted, but I'd rather not 
> have the overhead of encrypting all file data, some of the machines may 
> have CPUs as low as 266 Mhz or so.
> 
> I also have some true unix machines, (Solaris, AIX, HPux, SGI) and it 
> would be nice if they could participate too, which would probably 
> require using native *ix NFS, as custom clients may not be available and 
> I don't want to have to install them on many machines anyway.
> 

I highly suggest excising from your mind any thoughts on making CIFS and 
NFS play nicely with each other. It will not happen unless you force all 
access to the same UID/GID on both servers and even that may not work in 
your environment. However you can have them in the same directory structure.

On the fileshare you might have this

/var/backups/
/var/backups/windows/$hostname/
/var/backups/linux/$hostname/
/var/backups/aix/$hostname/

and so forth.

Then in your smb.conf I'd set the share to look something like this

[windows]
         comment = storage
         path = /var/backups/windows
         browseable = no
         public = no
         writable = yes
         create mask = 0775
         directory mask = 0775
         force user = backup
         force group = backup

The above forces a single user and sets permissions. You can remove this 
or set to other values. It's all pretty straightforward.

You can do the same for /var/backups/linux etc or in NFS do the 
following in you /etc/exports

/var/backups/linux/ 
10.10.10.0/255.255.255.0(async,all_squash,anonuid=65534,anongid=65534,rw)

This does almost the same thing, forcing all access to a single UID/GID, 
but does not touch permissions. However some implementations of NFS do 
not support all squash or have issues with a Linux servers idea of 
all_squash. You may not have any issues, but I've run into some strange 
issues with NFS server/client mismatches recently so it's something to 
keep in mind.

That's roughly how I would do things with limited information about your 
setup or goals.

Ramin


More information about the luni mailing list