2

I'm setting up a homeserver using Greyhole and Samba.

excerpt

Greyhole - An application that uses Samba to create a storage pool of all your available hard drives (whatever their size, however they're connected), and allows you to create redundant copies of the files you store, in order to prevent data loss when part of your hardware fails.

The harddrive is mounted into /mnt/hdd0, /mnt/hdd0/gh is added into the pool and /mnt/hdd0/shares contains the Samba shares.

I'm able to connect to the server and create files and folders. However, after Greyhole created the symlink and copied them into the pool, I can neither edit nor delete files. Windows just throws "Permission denied."

  • The symlinks have full permissions and are owned by root:root.
  • The files, they are referring to, are owned by the user, who created them and have rwxr--r-- permissions.
  • The subfolders of "gh" and "shares" have rwx.rwx---

This is the smb.conf:

[global]
   workgroup = WORKGROUP
   server string = Samba Server
   security = user
   encrypt passwords = true
   log file = /var/log/samba/%m.log

[TV]
   path = /mnt/hdd0/shares/TV
   comment = Recorded TV Shows
   available = yes
   browseable = yes
   writeable = yes
   dfree command = /usr/bin/greyhole-dfree
   vfs objects = greyhole

What do I need to change, to get write-access to the files? And how do I change the group of the created files to i.e. sambashare (a group all my samba users are in)?

Edit: if i stop greyhole and create a new file, i can edit it. I suppose, GH is the problem.

5
  • Did you read the warnings section here? wiki.amahi.org/index.php/Greyhole
    – slm
    Nov 10, 2013 at 14:09
  • I did. Does this include the chmod command on directories? I don't use amahi btw.
    – dr0n3
    Nov 10, 2013 at 14:14
  • Yeah I know, I found that warning, there isn't much to go on for this particular Q. I'm not sure how to help you. There are a number of moving pieces to this setup, and I don't have GH setup. I never heard of it until this morning either. What does the Samba logs say when you try and perform the access? You obviously need more info to proceed but I've used Samba for 15+ years and this issue sounds like it's more to do w/ GH. In order to assist your further we're gonna need more info I'm afraid.
    – slm
    Nov 10, 2013 at 14:23
  • How does Windows enter into this? Is the problem that you cannot delete when connecting from a Windows machine? Does it work from a Linux machine?
    – terdon
    Nov 10, 2013 at 14:24
  • Samba and GH are running on Ubuntu Server 12.04, client is a Win8.1 Computer. I'm browsing the shares through the explorer (\\<localip>\<sharename>). the problem is indeed, that i cannot delete files. however i can create them. folders work just fine. samba and gh logs are empty.
    – dr0n3
    Nov 10, 2013 at 14:34

2 Answers 2

1

The symlink owner and permissions are irrelevant. It's the target file permissions that matter to Samba (and parent folders permissions).

Since you can create files on your shares, the permissions in /mnt/hdd0/shares are for sure OK.

And when Greyhole move the files into /mnt/hdd0/gh, it will reproduce the file owner and permissions of the original file, so the new file in /mnt/hdd0/gh/ShareName/* will have the correct permissions.

This leaves the folders that Greyhole didn't create itself as a possible source of issues. Namely, the /mnt/hdd0/gh folder itself at least (plus any folder that was already there to begin with, if you didn't start with an empty folder.

To fix:

sudo find /mnt/hdd0/gh -type d -exec chmod 755 "{}" \;
sudo find /mnt/hdd0/gh -type f -exec chmod 644 "{}" \;
sudo chown -R your_user:sambashare /mnt/hdd0/gh

If this doesn't resolve your problem, please provide more information about a specific file you have the problem with. For example, create a new file in the root of your TV share, and show the output of ls -la /mnt/hdd0/gh/TV (at least the parts about your test file, and about . and ..).


And to force new files and folders to be group-owned by sambashare, use the group sticky-bit for folders:

sudo find /mnt/hdd0/gh -type d -exec chmod g+s "{}" \;

That will force all new files and folders to use the same group as the existing folders, and since you changed the group-owner to sambashare above, all new files will have the group-owner you want.

0

This looks much like a permissions issue, your content should be writable to the samba user, not just to the owner of the files.

I think you should try to create an ACL so that all the new files would be automatically added to the sambashare group.

This answer might be useful for getting that done: https://stackoverflow.com/a/6550059

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .