3

I'm running centos7... have 4 x 3tb hdd's, so I installed zfs as it looks like the best solution. I installed and setup via root, but the local user can't seem to write files / folders. And google won't yield any results as to why it wouldn't let different users have write permissions? So my question is, how can I give the local user permission to write files on the pool?

1
  • 2
    You need to provide more information. Show some file permissions, paths and errors. Please update you question with adequate information.
    – Peter
    Commented Jul 22, 2017 at 8:36

1 Answer 1

6

It's the same as any other mountable filesystem. If you want users to be able to write to it then either chown/chgrp/chmod the mountpoint (after it has been mounted).

Better yet, create a subdirectory and give them write access to that.

Or, since this is ZFS, create them a zfs filesystem instead of just a sub-directory and grant access to that rather than to the entire pool.

e.g. if your zpool is called 'tank', you might do something like this:

zfs create tank/data
chgrp users /tank/data
chmod g+rwsx /tank/data

That will give all members of group 'users' read, write, and execute permissions on that directory. the setgid bit will makes sure that all files & subdirectories created below /tank/data will be group 'users'.

If you want a more specific or detailed answer than that, you'll have to provide more information.

2
  • Thanx for the reply, I was away from my machine at the weekend - so I was googling the hell out of it with no avail... I'm a noob to linux as I setup a server for fileshares etc but have never dealt with groups etc. The owner and group for the file system is root, I changed the user group and added the permissions but still can't touch a file from the clip as user (not root). Does selinux get in the way of this at all or do I need to change the owner to the user as opposed to root?
    – Drew
    Commented Jul 24, 2017 at 14:19
  • impossible to say what the problem is without more information. please edit your question and paste the text (NOT an image) of your terminal session, showing at least the output of ls -ld /path/to/your/zfs-filesystem (or stat ... instead of ls -ld ...) and what happens when you try to write to or create a file. the output of, e.g., zfs get all tank/data may also be useful.
    – cas
    Commented Jul 25, 2017 at 5:02

You must log in to answer this question.

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