Unable to Change File Permissions Even as Root

拈花ヽ惹草 提交于 2019-12-11 08:17:21

问题


I'm having a serious problem with an application I'm working on and I'm hoping someone here can help. The application has a feature that allows users to upload images to a folder on the production server. Users were reporting that the upload was not working properly, and when I dug into it further I noticed that the permissions were wrong. The underlying issue of why the permissions are off is something I will figure out later; right now I need to fix the permissions for the data that is already there.

I thought it would be a matter of simply ssh ing into the production server and using chown and chmod to fix the permissions. However, when I tried to run the commands I got the error 'Operation not permitted' even when I executed the command with sudo. I tired using su and running the commands as root. Same result. Some more digging and I saw some reference to people having this issue with 'immutable' files. I tried using lsattr to check the attributes of those files and now I'm getting the error 'Inappropriate ioctl for device While reading flags'.

I'm at my wits end here. I have no idea what else I can do to try to fix this. Any help would be much appreciated.

Update Here is the file system info output when I run a df -T command:

df: `/opt/www/optics (deleted)': No such file or directory
Filesystem                                             Type     1K-blocks    Used Available Use% Mounted on
rootfs                                                 rootfs    12384432 4143772   7611572  36% /
udev                                                   devtmpfs     10240       0     10240   0% /dev
tmpfs                                                  tmpfs       411284    1832    409452   1% /run
/dev/disk/by-uuid/7026ddf7-4c30-4bf7-9787-a8c80bf247ab ext4      12384432 4143772   7611572  36% /
tmpfs                                                  tmpfs         5120       0      5120   0% /run/lock
tmpfs                                                  tmpfs      1661420       0   1661420   0% /run/shm
/dev/xvdb                                              ext4     132111844 8593200 116807760   7% /opt

I'm also not sure what the first line of the output means:

df: `/opt/www/optics (deleted)': No such file or directory

That directory definitely exists. I can cd into it and view the contents. All the same, that IS the parent directory of the folder where the images are getting saved to so I would think it must be related in some way. Mabey someone who knows more about the 'df' command could shed some light?

来源:https://stackoverflow.com/questions/37712331/unable-to-change-file-permissions-even-as-root

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!