[CentOS] Mounting SMB shares for samba home dirs

Tue Jul 26 06:26:40 UTC 2005
Nick Bryant <nick at everywhereinternet.com>

> On Tue, 2005-07-26 at 14:06 +1000, Nick Bryant wrote:
> > Hi,
> >
> > I currently use Samba server as a PDC on a centos 3.5 box for a bunch of
> XP
> > clients which works perfectly.</centos plug>
> >
> > I want to mount a share on a NAS box we have kicking about and use that
> > share to put all the users home dirs in. Sadly my NAS box is a Windows
> 2003
> > server appliance (although, to be fair - it does the job).
> >
> > So I create a share on the NAS box, create a user on the Samba server
> who I
> > then assign write permissions on the newly created share (yes, the NAS
> is a
> > domain member) and then put the NAS share's details into the Samba
> server's
> > /etc/fstab like so:
> >
> > \\nasboxen\newshare /mnt/userhomes smbfs
> auto,credentials=/etc/samba/afile
> > 0 0
> >
> > mount -a /mnt/syd01-test/
> >
> > and it mounts perfectly:
> >
> > [root at lemon mnt]# mount
> > [snip]
> > //nasboxen/newshare on /mnt/userhomes type smbfs (0)
> >
> > Now the problem comes when I want to put a userdir in there because when
> I
> > try and set the ownership:
> >
> > [root at lemon mnt]# chown nick testing
> > chown: changing ownership of `testing': Operation not permitted
> >
> > I presume this is because it's a smb filesystem and it doesn't support
> unix
> > ownership flags. So the question is... can it be done?
> ----
> You can't have user permissions on 'foreign' file systems - all files
> and folders are owned by whomever mounts it.
> 

That explains the error then :)

> You can download for free - Microsoft's SFU (Services for Unix) and
> create NFS exports from the NAS Appliance and mount them on the
> Linux/Unix system and share them but be prepared for some latency (I
> sort of gave up on this concept myself). You could also create a 'DFS'
> tree that has the 'base' on the Linux server and the subtrees on the NAS
> appliance.

Ok did this. Got NFS working on it... problem is that even though it doesn't
bork with an error it still won't let me change the ownership. I think I
know why but I don't know how to do a no_root_squash export on a W2k3 box of
doom, and I won't go there on this list.

> 
> Of course there is no reason that you can't direct Samba to create
> Windows Users 'HOMES' share directly on/from the NAS appliance itself
> and that is likely the best/fastest way to do it. Since the NAS Server
> is 'joined' to the domain, it will have all the user accounts and can
> happily deal with the ACL's for the home share.

It seems a little more complex but sounds like it would be the way forwards.
Do you have any more info on exactly how about you create a user with a
non-local fs home dir?

> 
> With Samba 3.0.x and LDAP or tdbsam backend, you can specify a unique
> home and profile directory for each user and put them on different
> servers if you wish.
> 

It's running on samba 3 with tdb backend...

Cheers,

Nick