To allow other members to read and write on a group disk

Note: This article is about group disks (/gs/hsX/), do not run the following sample in your home directory.

Users are not allowed to change the owner of their files. Therefore, please change the group permissions so that it can be read and written. The point is,

  • Change permissions for all files and directories below the directory, not just the top-level directory.
  • Add read (R) as well as write (W) permissions to the file. If you don't have a write (w), you can't erase it later.
  • The directory should contain not only read (r) but also write (w) and execute (x). You can't access the directory without the execution (x).
     

 Some example commands are shown below. Depending on the original permissions of the file, some errors may occur, in which case, try re-running the command until the output no longer changes.

Find your own directories under /gs/hsX/tgX-XXXXXX/ and make them readable and writable by group members.

find 

/gs/hsX/tgX-XXXXXX/

-type d -user $USER ! -perm -2770 -print0 | xargs -r0 chmod -v ug+rwx,g+s

Find your own files under /gs/hsX/tgX-XXXXXX/ and make them readable and writable by group members.

find 

/gs/hsX/tgX-XXXXXX/

-type f -user $USER ! -perm -660 -print0 | xargs -r0 chmod -v ug+rw

Find your own files under /gs/hsX/tgX-XXXXXX/ and match the ownership group to the TSUBAME group.

find 

/gs/hsX/tgX-XXXXXX/

-user $USER ! -group (TSUBAME group name) -print0 | xargs -r0 chgrp -v (TSUBAME group name)

 

We have prepared a script that automatically executes the above commands. Please note that we do not guarantee the operation of this script, and you use it at your own risk.

module load takeovertool
cd /gs/hsX/tgX-XXXXXX
fixperm