modify permissions and change ownership to Files/Folder in s3fs directory
t works for files but not for folders. The folders has sub folders and files.
s3fs#phase1 /tmp/abc fuse__netdev,allow_other,url=https://awspoc.xxx.xxx.xxx,no_check_certificate,nomultipart,nonempty,dbglevel=info 0 0
[root@k0001809 abc]# ls -la |grep "OAIsys"
d--------- 1 root root 0 May 9 14:08 OAIsys
[root@k0001809 abc]# chown -R -v n5f356:zabbix OAIsys
changed ownership of OAIsys/BENCHMARK/OUTPUT' to n5f356:zabbix changed ownership ofOAIsys/BENCHMARK/WORK' to n5f356:zabbix
changed ownership of OAIsys/BENCHMARK' to n5f356:zabbix changed ownership ofOAIsys' to n5f356:zabbix
[root@k0001809 abc]# chmod 775 OAIsys
[root@k0001809 abc]# ls -la |grep "OAIsys"
d--------- 1 root root 0 May 9 14:08 OAIsys
I am trying to change the ownership and permission for the s3fs mount folder OAIsys but couldn't. Is that not feasible?
Same implies for Files too
[root@k0001809 abc]# chown -R -v n5f356:zabbix tar1
chown: changing ownership of tar1': Input/output error failed to change ownership oftar1' to n5f356:zabbix
Responses
S3 has its own way of handling file owners and permissions, and it does not exactly match the way Unix/Linux filesystems handle them. Specifically, in S3 it is possible create files and directories with no owner/permission information at all. The chown/chmod commands can be used to change the owner/permission information, but it's not necessarily the same thing as adding the owner/permission information to a filesystem object that previously has none. There are multiple ways for s3fs to handle this, and you need to use the s3fs mount options to choose the way that is most appropriate for your use.
https://github.com/s3fs-fuse/s3fs-fuse/wiki/FAQ
says:
Q: No permission for directories and files
A: s3fs supports files and directories which are uploaded by other S3 tools(ex. s3cmd/s3 console). Those tools upload the object to > S3 without x-amz-meta-(mode,mtime,uid,gid) HTTP headers. s3fs uses these meta http headers for looking like filesystems, but s3fs can not know the meta data for file because there is no meta data. Thus s3fs displaies "d---------" and "---------" for those file(directory) permission. There are several ways to solve. One is that you can give permission to files and directories by chmod command, or can set x-amz-meta- headers for files by other tools. Alternatively, you can use umask, gid and uid option for s3fs. A: you can use complement_stat option. It gives the file/directory the permissions as appropriate as possible.
Looks like you could use the umask, gid and uid options to assign ownerships and permissions for the entire s3fs mount, like you could do on VFAT filesystems. Or you could add the complement_stat mount option, mount the filesystem again, and then try assigning the permissions.
S3 doesn't technically have directories - it's a flat structure. The "folders" they offer are really just organizational tags/attributes. While you can use those like folders when using GUIs, they're mostly imaginary. The x-amz-meta headers used by s3 are arbitrary - and if something else updates the stored object , are easily trashed.
Overall, with the fragility of interfaces like s3fs, if you need more traditionally filesystem-like access to S3, you might be better off using EFS.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
