cancel
Showing results for 
Search instead for 
Did you mean: 

Problem of chmod

yangk
Frequent Advisor

Problem of chmod

Hi All,

 

I have encountered a problem of chmod.

Here is details about what i did:

 

 

# mount -F lofs -Q -e -o ro /home/test_sbin/  /home/test_usr/

mount: mounted /home/test_sbin on /home/test_usr

# cd /home/test_usr/

# ls

file  test    

# chmod 777 test

chmod: can't change test: Read-only file system

# chmod 777 file

# ls -al

total 0

-rwxrwxrwx   1 root       sys              0 Jul  4 23:01 file

drwxrwxrwx   2 root       sys             96 Jul  4 23:02 test

 

But it seems that the chmod on the file can work fine, So what is the reason?

 

My system is  B.11.31.1103 and IA64 platform.

 

Thanks in advance!

 

kevin

5 REPLIES
V. Nyga
Honored Contributor

Re: Problem of chmod

Hi,

you only listed 'ls -al' once, so we don't know if any 'chmod' worked. All permissions are set to 777.
>mount -F lofs -Q -e -o ro <-you've set the option to read-only
so 'chmod' should not 'work fine'.

V.
*** Say 'Thanks' with Kudos ***
Bill Hassell
Honored Contributor

Re: Problem of chmod

The error message is quite clear. You cannot modify a read-only filesystem.

And in general, chmod 777 is a bad idea for any file or directory where the data must be protected. 777 is OK on something temporary like /tmp and /var/tmp (although many sysadmins will use 1777 to limit accidents and other problems with open permissions). 777 means that every user on the system can change the contents of that file or directory.



Bill Hassell, sysadmin
Dennis Handly
Acclaimed Contributor

Re: Problem of chmod

>But it seems that the chmod on the file can work fine, So what is the reason?

 

Read the WARNINGS under:

http://h20000.www2.hp.com/bc/docs/support/SupportManual/c02264550/c02264550.pdf

For LOFS file systems which are mounted read-only, if the underlying file system is mounted writable,
certain write operations on the LOFS will succeed. Thus LOFS should not be relied upon to provide a
strictly write-only alternative image of a read-write file system.

 

You should be making your changes in /home/test_sbin/.

yangk
Frequent Advisor

Re: Problem of chmod

Ok, i see the man page of the mount_lofs. Thanks!

Dennis Handly
Acclaimed Contributor

Re: Problem of chmod

>I see the man page of the mount_lofs. Thanks!

 

If you are happy with your answers, please assign kudos.