1748093 Members
5858 Online
108758 Solutions
New Discussion

Re: CHMOD

 
kunjuttan
Super Advisor

CHMOD

Hi,

 

    I just created a new filesystem.I want to give full permission to all the files and directories creating inside this FS.How to achieve this.I tried with chmod -R 777 <FS>.But its not working.Please help me out...

5 REPLIES 5
James R. Ferguson
Acclaimed Contributor

Re: CHMOD

Hi:

 

"But its not working" doesn't tell us a thing!  What are you attempting to do (or see)?  Where you root when you did the 'chmod'?  What isn't the way you expect it to be?

 

...JRF...

kunjuttan
Super Advisor

Re: CHMOD

thanks for the update..

i mean to say is chmod is wrking.....but if I create a new file inside this FS it is not having full permission.I want to create lot of files inside and all should be having full permission.

Pete Randall
Outstanding Contributor

Re: CHMOD

File creation is governed by the user's umask setting and 777 is not attainable with umask.


Pete
James R. Ferguson
Acclaimed Contributor

Re: CHMOD

Hi (again):
@kunjuttan wrote:

 

thanks for the update..

i mean to say is chmod is wrking.....but if I create a new file inside this FS it is not having full permission.I want to create lot of files inside and all should be having full permission.


I assume that you want to be able to create files and have their permissions=777.  This isn't going to be possible with the standard tools (like the shell).

 

When a file is created with 'open()' standard software supplies a 'mode' argument of octal 666 for files.  This is built into the code and you can't change this unless you have access to the source.  The effect of your 'umask' is to "subtract" from this value.  Hence, a 'umask' of zero allows files thus created to have the "most open" permissions of 666.

 

To add execute permissons you are going to have to 'chmod' those files you want.

 

Regards!

 

...JRF...

Dennis Handly
Acclaimed Contributor

Re: CHMOD

>chmod -R 777 <FS>

 

This is a very dangerous command.  You do NOT want to add execute permission to non-executable files.

And do NOT use this on any existing system filesystems.

You should make several passes using find to select various file types and use the "+" symbolic permission operator:

find <FS> -type d -exec chmod a+x +  # The last "+" is for find -exec performance

chmod -R a+rw <FS>