Operating System - Tru64 Unix
1753569 Members
6163 Online
108796 Solutions
New Discussion юеВ

Re: Inherit group from parent directory

 
Steven Whatley
Occasional Advisor

Inherit group from parent directory

We have a scratch disk called /wrk on a Tru64 5.1B system formatted as advfs v4 that is group and world writable:

drwsrwxrwx 954 root system 40960 Jun 4 13:26 /wrk

If a user creates a file or directory directly under /wrk, its owner (UID) is the user's uid but the group name (gid) is still system:

-rw------- 1 me system 0 Jun 4 13:27 test.txt

How do I set up the permissions on /wrk so that my group name is used instead of system?

-rw------- 1 me grp1 0 Jun 4 13:27 test.txt

The reason I ask is because our users archive their files onto a storage array. We use the group name to determine how much space each group is using. As it is now, if a user copies his/uer files to the storage array the group name is still system.

I know we can tell the users to do a chgrp on new directories under /wrk but we would have to constantly police the users to make sure the policy is followed. There must be an easier way.

Any info will be appreciated.

Thanks,
Steven
9 REPLIES 9
Michael Schulte zur Sur
Honored Contributor

Re: Inherit group from parent directory

Hi,

there is one problem. You have only one group, you set /wrk to but probably many groups, the users belong to.
You might try this from time to time.
find /wrk -user "userx" -exec chgrp grp1 "{}" ";"

hth,

Michael
Abdul Rahiman
Esteemed Contributor

Re: Inherit group from parent directory

Miachae's solution is one way of getting around the problem.
But here is another solution, if /wrk is a filesystem, mount it with "nogrpid" option.

eg:
# mount -o nogrpid /wrk

man mount for more info.
No unix, no fun
Ralf Puchner
Honored Contributor

Re: Inherit group from parent directory

nogrpid has no effect on non nfs filesystems as I know....

But why not learn some basics and use vfs: sys_v_mode=1 (have a look into the admin guide, section BDS vs. SYSV behavior) or still use ACL's to solve your problem.
Help() { FirstReadManual(urgently); Go_to_it;; }
Abdul Rahiman
Esteemed Contributor

Re: Inherit group from parent directory

Ralph,
According to man pages, nogrpid works for UFS and AdvFS.
I just tested it too, it works. :-)

regds,
Abdul.
No unix, no fun
Steven Whatley
Occasional Advisor

Re: Inherit group from parent directory

Ralf, Yes, /wrk is a file system. The nogrpid option looks like the ticket. We will give it a try.

Thanks,
Steven
Michael Schulte zur Sur
Honored Contributor

Re: Inherit group from parent directory

Steven,

Ralf was referring to nfs filesystem.

greetings,

Michael
Yong_7
Frequent Advisor

Re: Inherit group from parent directory

Hi steven,

if you do not have too MANY groups, how about create file set for each group under wrk_domain, then it's easy to tell how much space is used for each file set.

just a idea. also you can set limit too.

Cheers !

YJ
Abdul Rahiman
Esteemed Contributor

Re: Inherit group from parent directory

Steven,
Would appreciate if you could assign points to the replies as a way of thanking and indicating how the responses helped you in resolving the problem.

thanks,
Abdul.
No unix, no fun
Steven Whatley
Occasional Advisor

Re: Inherit group from parent directory

Don't worry, I will assign points. Due to restrictions since thwese are poroduction boxes, I can't apply the fix until Monday. After that, I will assign points.

Thanks,
Steven