[Samba] Writing to shares directly

fixed onefix at waste.org
Fri Oct 3 16:31:43 GMT 2008


Thank you for your reply.

We are using Samba to create a redundant file system for failover between
two servers. I am wondering if this is even a recommended use for Samba.

For example:

app01
------
/data/shares/app01 (local)
/data/shares/app02 (remote)

app02
-----
/data/shares/app01 (remote)
/data/shares/app02 (local)

So we have written our apps to write to both shares - if one goes down,
this isn't a bad thing as it will read from the local share.

Thank you

Ogden

On Fri, 3 Oct 2008, Rubin Bennett wrote:

> On Fri, 2008-10-03 at 09:46 -0500, Ogden wrote:
> > Within a Samba configuration, is it not advisable to create files on the
> > directory on the local machines themselves? Out setup is like so:
> >
> > Server 1 (where the files reside):
> >
> > /data/shares/app01
> >
> > Server 2 (mounts the above drive):
> > /data/mounts/app01
> >
> >
> > If, on Server 1, I create a file:
> >
> > # echo test > /data/shares/app01/test
> >
> > The file is created, but on Server 2, I cannot seem to edit the file as I
> > get the permission denied warning.
> >
> > However, if I mount the /data/shares/app01 directory on Server 1 and write
> > to that directory, I can write to the files from other machines fine.
> >
> It's not necessarily bad practice, but you have to use care when using
> multiple access methods to the Samba shared directory because Unix
> filesystem permissions trump Samba perms.
>
> Example:if you create a file as root (like you did above), then you have
> to make sure it's writable as the samba user who accesses the share.
>
> I.e. if /data/shares/app01/test is 755 and owned by root:root then only
> members of the root group would be able to write to that file.
>
> If you're creating files as root that you expect to write to as another
> user, you should expect to adjust ownership and/ or permissions on the
> files you create.
>
> Rubin
>
> > Within smbstatus, it says the file is  RDONLY    and oplock is NONE when
> > I write to the directory itself and not the mount.
> >
> > I'm wondering if I set things up alright and whether it is bad practice to
> > write to the directory directly?
> >
> > Thank you
> >
> > Ogden
> >
>


More information about the samba mailing list