Well, looks like you are messing several things together. So ...
Holy I think you have set out exactly how I want the system to be. The 7 volumes are 7 HDD's with ZFS file system.
So you have one ZFS volume over 7 devices? Is it RAIDZ-1, RAIDZ-2 or what kind of "raid" you have? If you have one "raid" across all HDDs, you should not care about volumes anymore but create datasets and grant necessary permissions on each of them. So in your case it should be 7 datasets. Name does not matter that much, but it should be somehow clear.
After you have datasets configured (you may or may not set some quotas/reserved space), you will need to set up permissions for each of them. The basic configuration could be done via GUI, further "tuning" from CLI in case of need.
I have created the users and groups but to set the ownership and permissions does the shell commands have to be like this?
chown -R user2:group2 /path/to/volume2 ------How does user1 have ownership and permission?
chmod -R 770 /path/to/volume2
Via this, you will set things as follows
user2 will be owner of everything (this is set via chown command)
user2 will have "rwx" permission on everything since he will be owner and permission for
owner (first bit in "yyy") is set to "7" (== read, write, execute)
user1 will have "rwx" permission
only if he is a member of group2 since permission for
group (second bit in "yyy") is set also to "7"
Any another user which is NOT member of group2 will NOT have any rights since permission for
others (third bit in "yyy") is set to "0" (== no rights at all)
I want:
user1 (Me) to have read/write/execute permissions to all volumes since I am the owner of everything
user2 to have read/write/execute permission to volume2
user3 to have read/write/execute permission to volume3
user4 to have read/write/execute permission to volume4
It is how i wrote above. I don't know how much you are familiar with *nix permissions, but you should have at least some basics since you have unix-based NAS :]
Filesystem permissions is using
Octal Notation. So you have eight states and each of them stands for specific permission for owner, group or "others".
Octal notation
| Permissions
| bits set (read, write, execute)
|
0
| none
| 000
|
1
| execute
| 001
|
2
| write
| 010
|
3
| write + execute
| 011
|
4
| read
| 100
|
5
| read + execute
| 101
|
6
| read + write
| 110
|
7
| read + write + execute
| 111
|
As you may see, the basic values are 0, 1, 2 and 4 with this, you may set any combination of permission by sum values.
1+2 = 3 ... write + execute
2+4 = 6 ... read + write
1+4 = 5 ... read + execute
1+2+4 = 7 ... read + write + execute
... etc.
Based on this point, you may set permissons for owner, group and "others"
Just for example:
drwxr-xr-- Holy admingrp scripts/
d - stands for "directory"
r - stands for "read"
w - stands for "write"
x - stands for "execute"
rwx - permission for OWNER (==
Holy),
read,
write,
execute permissions
r-x - permission for GROUP == any user who is member of group
admingrp (except Holy) will have
read and
execute permission
r-- - permission for any other user who is not owner nor member of group will have only
read rights to this directory
(There are also some special values/flags, for more info see
chmod wiki :] )
In your example you have user1 set to each group and for all volumes or were you showing me user1 having ownership and permission to all 7 volumes? If so then do I set the other three users to volumes via CIFS sharing?
In my example, user1 is owner of everything on each volume (dataset, since you are on ZFS), permission of owner is set to "7", so user1 will have read/write/execute permission for any dir/file. User2 is member of group2, for which the ermission is also
rwx.
user1 must be also member of group2 because if not, he will not have any rights for file created by user2. user2 will be the owner, so user1 will act as "stranger" for this file if not member of group2.
So, from my point of view, you should do following (naming bellow is just general):
1] Create user1, user2, user3, user4. If you leave "
Create a new primary group for the user" ticked, system will create new group for each user with the same name (group user1, group user2, .. etc)
2] Add user1 into each group of user2,3,4
Under Groups just edit "members" for each group and add user1.
3] Create 7 datasets (dataset1, dataset2, ... dataset7)
4] For dataset1, dataset5, dataset6, dataset7 set following permission
5] For dataset2 set following
Do this also for dataset3 and dataset4 while altering
owner group to group3, group4
6] Create CIFS share for each dataset2,3,4 and tick "
Inherit Permissions", this will preserve permissions for all newly created folders/files.
If you want to force ownership of newly created files/dirs by another user, you may also tick "
Inherit Owner". In this case, if user2 upload file to dataset2, ownership will be changed to user1. He will still have
rwx rights since he is a member of the group.
7] For user1, you may to set CIFS share for whole volume, so you may map all datasets as one disk instead of 7.
8] Copy files under user1 into each dataset and test that rest of the users have correct permissions
Phew ... i hope i did not mess up something :]
Holy