Something Samba - can't rename random folders.

Hi everyone,

First of all, I am new to the forums so I would like to say hello! My name is Niels and I am from the Netherlands. Currently I am learning FreeBSD as my first *NIX type of OS. The reason I went for FreeBSD is pretty simple; the book I got is great to read (No Starch Press - Absolute FreeBSD)!! Oh, and ZFS seemed so much easier to learn than LVM (I want a scalable storage pool) :p :p

I have practised for a while now and made the BIG step to buy a new computer case to build in some left over parts en create my own server. My skill in FreeBSD is still pretty low though.

Now that I have my own dedicated home server I want to install stuff onto it. So here is what I got:

Code:
uname -a
FreeBSD area50 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan  3 07:46:30 UTC 2012     
root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64

I have a user account, userx, who is a member of the userx, wheel and samba groups.

In my server I use 2x 1tb hdd in a ZFS mirror pool mounted as /zdata. Also, I use 2x 2tb in a ZFS "straight" pool, mounted as /ztank.

These mounts both belong to userx:samba. Access rights are: u=rwx, g=rwx, o=[none]. So as far as I can work out I can do anything in these folders with my userx account, as well as with any account that is a member of the samba group.

I set up Samba (version 3.6 from ports) as follows:

Code:
[global]
workgroup = WORKGROUP
netbios name = AREA50
security = share
guest account = [I]userx[/I]
local master = yes
os level = 35

[Data]
path = /zdata
guest ok = yes
writable = yes
create mask = 760
directory mask = 770

[Tank]
path = /ztank
guest ok = yes
writable = yes
create mask = 760
directory mask = 770

This seems to work, I can just browse from any PC on the network and write/delete/modify file on the Samba server. I am happy! - files created from windows workstations get -rwxrw---- and dirs get drwxrwx---. Just as I wanted, I am more happy!

Then the next hurdle, install sabnzbd+. After some experimenting I got that to work the way I wanted also.. great. The install made a user _sabnzbd and group _sabnzbd. I decided in the sabnzbd.ini that it should run as _sabnzbd and group samba. I reasoned that _sabnzbd had to be member of the samba group, so that I could point sabnzbd to download and extract to any of the ZFS shares.

So now I have:
Group samba with members userx,_sabnzbd.

I can also download, repair and extract with sabnzbd+ with no problems at all. I configured it to maintain the rwxrwx--- and rwxrw---- permissions.

But now comes the tricky bit. When it's finished downloading, I move my files to another folder. I also wish to rename the downloaded stuff, so I can keep a clean library. The downloads go to /ztank/Downloads.

The moving of the files and folders seems really inconsistent. Some folders I can move to their final directory (usually from /zdata/Downloads to /zdata/Video/Films). And some I can't. This goes for the renaming and deleting also.

The things I have tried:
- double check all groups and permissions, also used by Samba and Sabnzbd;
- restarting, stopping the samba and sabnzbd in several combinations to see whether either on had files locked;
- change network cable;
- install Ubuntu in a virtualbox and see if that gave any problems;
- chown all to userx:userx;
- chown all to userx:samba;
- Google searches;
- Play with oplocks in Samba;

Nothing seemed to work!

I even thought about quitting the whole Samba thing and use FTP, but that would kind of feel like losing ;)

I really hope someone can help me out or point me in the right direction because I'm starting to run empty on ideas. I've been struggling for over 5 hours straight am starting to get kind of fed up now (and with Samba as a whole for a week).
 
Sorry, I forgot to add that the error I am getting when I try to modify the files and folders is something like
Code:
cannot move folder because it is already opened by another program
It's the error I am getting from my Windows machine.
 
I know this post is rather old now, but I have solved all my Samba problems. I can't remember how I solved this particular problem but I still want to share a few things that I learned while playing with Samba, hoping other people might be helped:

- In the Samba rc script I entered a delay of 10 seconds. I don't know the exact reason but iirc somewhere I read that some network cards need a little bit of "warmup time". This prevents me from having to restart the Samba service manually, right after a reboot, in order to get Samba to work properly.

- Take parent folder permissions in consideration. These might prevent reading/writing in or to a child folder. Even though the permissions in the child folder seem right.

Hopefully these points prove useful on other people's checklists :)(
 
Back
Top