Root and non-root user not able to delete the file | Unix Linux Forums | UNIX for Advanced & Expert Users

  Go Back    


UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

Root and non-root user not able to delete the file

UNIX for Advanced & Expert Users


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 03-14-2013
sukhdip sukhdip is offline
Registered User
 
Join Date: Sep 2011
Last Activity: 23 July 2014, 2:29 AM EDT
Posts: 51
Thanks: 2
Thanked 0 Times in 0 Posts
Root and non-root user not able to delete the file

Hi!! one strange problem occurred with my RHEL 5 box.
i'm having logs folder with ownership of non-root user. Created some files with root user under logs folder.
here is the scene:

Code:
-rw-r----- 1 root root  1048227 Feb 28 12:34 SystemOut_13.02.28_12.34.10.log
-rw-r----- 1 root root   415920 Mar 14 16:41 SystemOut.log
-rw-r----- 1 root root 20902127 Mar  2 22:15 trace_13.03.02_22.25.53.log
-rw-r----- 1 root root  2579956 Mar 14 16:41 trace.log

I'm not able to delete the files with both users.
Below error is coming up
Quote:
rm: cannot remove `SystemOut_13.02.28_12.34.10.log': Read-only file system
I tried lsattr and chattr, below the output of both:

Code:
------------- /opt/IBM/WebSphere/AppServer/profiles/xyz/logs/server1/


Code:
chattr: Read-only file system while setting flags on /opt/IBM/WebSphere/AppServer/profiles/xyz/logs/server1/

Chown and chmod not able to work. Again Read-only file system error is coming up.
Help needed also want to understand the reasons.

Immediate help will be appreciated.
Thanks.
Sponsored Links
    #2  
Old 03-14-2013
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 26 November 2014, 5:04 PM EST
Location: Saskatchewan
Posts: 19,943
Thanks: 848
Thanked 3,420 Times in 3,205 Posts
'read only filesystem' means it cannot write to that partition in any way, including things like chmod and chown which alter inodes. If the partition wasn't mounted readonly in the first place, it probably got set read-only because of a disk error -- the kernel will disallow any further writes to the damaged disk. Check your dmesg for disk errors.
Sponsored Links
    #3  
Old 03-14-2013
Don Cragun's Avatar
Don Cragun Don Cragun is online now Forum Staff  
Moderator
 
Join Date: Jul 2012
Last Activity: 27 November 2014, 12:27 AM EST
Location: San Jose, CA, USA
Posts: 5,099
Thanks: 196
Thanked 1,706 Times in 1,449 Posts
The files you're trying to modify are located on a filesystem that was mounted read-only. No changes can be made to files on a read-only filesystem. That is what read-only means; no writes allowed.

If you need to change those files, you need to unmount that filesystem and remount it with the read-only attribute unset.
    #4  
Old 03-14-2013
verdepollo's Avatar
verdepollo verdepollo is offline
Registered User
 
Join Date: Mar 2010
Last Activity: 7 November 2014, 1:54 AM EST
Location: Mexico
Posts: 725
Thanks: 11
Thanked 106 Times in 102 Posts
Aside form the most common "issues" like a partition being explicitly mounted read-only or a faulty disk array, there's been a widely known bug in RHEL 5 -more specifically in its kernel- where a filesystem might go read-only with no apparent reason.

It has been extensively documented (and fixed) both by RedHat and by VMWare as it mostly affects RHEL servers running under a hypervisor:

https://bugzilla.redhat.com/show_bug.cgi?id=494927
VMware KB: Linux based file systems become read-only

Either upgrade your kernel to a newer version or use the quick and dirty (and temporary) approach of rebooting the machine.

...of course not before trying mount -o remount <your_filesystem>
Sponsored Links
    #5  
Old 03-15-2013
sukhdip sukhdip is offline
Registered User
 
Join Date: Sep 2011
Last Activity: 23 July 2014, 2:29 AM EDT
Posts: 51
Thanks: 2
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by verdepollo View Post
Aside form the most common "issues" like a partition being explicitly mounted read-only or a faulty disk array, there's been a widely known bug in RHEL 5 -more specifically in its kernel- where a filesystem might go read-only with no apparent reason.

It has been extensively documented (and fixed) both by RedHat and by VMWare as it mostly affects RHEL servers running under a hypervisor:

https://bugzilla.redhat.com/show_bug.cgi?id=494927
VMware KB: Linux based file systems become read-only

Either upgrade your kernel to a newer version or use the quick and dirty (and temporary) approach of rebooting the machine.

...of course not before trying mount -o remount <your_filesystem>
Thanks alot for ur ans .. letme try and i will post the results.

---------- Post updated at 12:12 AM ---------- Previous update was at 12:01 AM ----------

one thing more i want to add. that after restarting the system. few more files are being created by both root and non-root automatically. those files are deletable by root.
If the file system is read only. how still these files are being created or i can delete??
Can anyone please tell is it happening due to bug or some other reason stands for it?
Sponsored Links
    #6  
Old 03-15-2013
verdepollo's Avatar
verdepollo verdepollo is offline
Registered User
 
Join Date: Mar 2010
Last Activity: 7 November 2014, 1:54 AM EST
Location: Mexico
Posts: 725
Thanks: 11
Thanked 106 Times in 102 Posts
Quote:
Originally Posted by sukhdip View Post
one thing more i want to add. that after restarting the system. few more files are being created by both root and non-root automatically. those files are deletable by root.
If the file system is read only. how still these files are being created or i can delete??
After you reboot the system, the filesystem is no longer in read-only mode so anyone with sufficient privileges is able to write to it. That's why you rebooted in the first place, isn't it?
Sponsored Links
    #7  
Old 03-15-2013
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 26 November 2014, 5:04 PM EST
Location: Saskatchewan
Posts: 19,943
Thanks: 848
Thanked 3,420 Times in 3,205 Posts
Quote:
Originally Posted by sukhdip View Post
If the file system is read only. how still these files are being created or i can delete?
If your system can boot it almost certainly didn't start read-only. Many things wouldn't work right.

A filesystem may drop into read-only mode after it's mounted, because of disk errors; in the bugs above, it also dropped into read-only mode because of niggling things like a few retries, or corruption inside the kernel itself.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Migration of system having UFS root FS with zones root to ZFS root FS sb200 Solaris 2 06-27-2012 03:35 PM
Sudo to delegate permission from non-root user to another non-root user canar UNIX for Dummies Questions & Answers 1 04-06-2012 06:59 PM
Unable to create or delete a directory in /usr with root user Pshah Solaris 4 07-06-2011 07:05 AM
user able to delete directory owned by root mpheine UNIX for Dummies Questions & Answers 2 04-13-2011 07:28 PM
How to allow access to some commands having root privleges to be run bu non root user suryashikha UNIX for Dummies Questions & Answers 5 10-30-2009 06:46 AM



All times are GMT -4. The time now is 01:28 AM.