LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-28-2013, 04:50 AM   #1
Vodkaholic1983
Member
 
Registered: May 2010
Distribution: Windows / Debian
Posts: 163

Rep: Reputation: 0
Can't delete as root?


Howdy

I can't seem to delete a bunch of files and folders as root

Code:
root@xbmc-System-Product-Name:~# rm -r /home/media/downtherabbithole
rm: cannot remove `/home/media/downtherabbithole/fcgi-bin/php5.fcgi': Operation not permitted
 
Old 05-28-2013, 04:52 AM   #2
linosaurusroot
Member
 
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 982
Blog Entries: 2

Rep: Reputation: 244Reputation: 244Reputation: 244
"lsattr" could these be marked as immutable or append-only?

Are they on local disk (not NFS or similar)?
 
Old 05-28-2013, 04:54 AM   #3
Vodkaholic1983
Member
 
Registered: May 2010
Distribution: Windows / Debian
Posts: 163

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by linosaurusroot View Post
"lsattr" could these be marked as immutable or append-only?

Are they on local disk (not NFS or similar)?
There are on a ext4 raid (am new to linux btw :P)
 
Old 05-28-2013, 04:56 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
What is the output of the following commands:
Code:
lsattr /home/media/downtherabbithole

# and

ls -lZ /home/media/downtherabbithole
 
Old 05-28-2013, 05:03 AM   #5
Vodkaholic1983
Member
 
Registered: May 2010
Distribution: Windows / Debian
Posts: 163

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by druuna View Post
What is the output of the following commands:
Code:
lsattr /home/media/downtherabbithole

# and

ls -lZ /home/media/downtherabbithole
Hey thanks this is the output

Code:
root@xbmc-System-Product-Name:~# lsattr /home/media/downtherabbithole
-------------e-- /home/media/downtherabbithole/fcgi-bin
root@xbmc-System-Product-Name:~# ls -lZ /home/media/downtherabbithole
total 4
drwxr-xr-x 2 1001 1001 ? 4096 May 23 23:35 fcgi-bin
 
Old 05-28-2013, 05:21 AM   #6
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
That looks OK (although there doesn't seem to be a user and group associated with uid/gid 1001. Not a show stopper.).

What about the file that's giving you problems:
Code:
lsattr /home/media/downtherabbithole/fcgi-bin/php5.fcgi

# and

ls -lZ /home/media/downtherabbithole/fcgi-bin/php5.fcgi
If the output is similar to your previous reply, check /home/media/downtherabbithole/fcgi-bin as well.
 
1 members found this post helpful.
Old 05-28-2013, 05:24 AM   #7
Vodkaholic1983
Member
 
Registered: May 2010
Distribution: Windows / Debian
Posts: 163

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by druuna View Post
That looks OK (although there doesn't seem to be a user and group associated with uid/gid 1001. Not a show stopper.).

What about the file that's giving you problems:
Code:
lsattr /home/media/downtherabbithole/fcgi-bin/php5.fcgi

# and

ls -lZ /home/media/downtherabbithole/fcgi-bin/php5.fcgi
If the output is similar to your previous reply, check /home/media/downtherabbithole/fcgi-bin as well.
It was once used on a debain set up but I moved to xbmcbuntu

Code:
root@xbmc-System-Product-Name:~# lsattr /home/media/downtherabbithole/fcgi-bin/php5.fcgi
----i--------e-- /home/media/downtherabbithole/fcgi-bin/php5.fcgi
root@xbmc-System-Product-Name:~# ls -lZ /home/media/downtherabbithole/fcgi-bin/php5.fcgi
-rwxr-xr-x 1 1001 1001 ? 219 May 23 23:35 /home/media/downtherabbithole/fcgi-bin/php5.fcgi
Code:
root@xbmc-System-Product-Name:~# lsattr /home/media/downtherabbithole/fcgi-bin
----i--------e-- /home/media/downtherabbithole/fcgi-bin/php5.fcgi
root@xbmc-System-Product-Name:~# ls -lZ /home/media/downtherabbithole/fcgi-bin
total 4
-rwxr-xr-x 1 1001 1001 ? 219 May 23 23:35 php5.fcgi

Last edited by Vodkaholic1983; 05-28-2013 at 05:25 AM.
 
Old 05-28-2013, 05:28 AM   #8
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Quote:
Originally Posted by Vodkaholic1983 View Post
Code:
root@xbmc-System-Product-Name:~# lsattr /home/media/downtherabbithole/fcgi-bin
----i--------e-- /home/media/downtherabbithole/fcgi-bin/php5.fcgi
The file is immutable (cannot be changed, removed etc).

As root user do the following:
Code:
chattr -i /home/media/downtherabbithole/fcgi-bin/php5.fcgi
Now you should be able to delete/change the file.
 
2 members found this post helpful.
Old 05-28-2013, 05:30 AM   #9
Vodkaholic1983
Member
 
Registered: May 2010
Distribution: Windows / Debian
Posts: 163

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by druuna View Post
The file is immutable (cannot be changed, removed etc).

As root user do the following:
Code:
chattr -i /home/media/downtherabbithole/fcgi-bin/php5.fcgi
Now you should be able to delete/change the file.
Awesome thanks! is there a way to do this to all the files in a folder say /home/media/ ?

As there is alot of sites with have the same problem

edit that no problem all done now thanks again!

Last edited by Vodkaholic1983; 05-28-2013 at 05:33 AM.
 
Old 05-28-2013, 05:35 AM   #10
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Quote:
Originally Posted by Vodkaholic1983 View Post
is there a way to do this to all the files in a folder say /home/media/ ?
You first need to check if this and possibly other file attributes are set and why (there might be a good reason for it).

If you are sure this needs to be done you can use chattr recursively (this example removes the i flag):
Code:
chattr -R -i /home/media/
Do have a look at the chattr and lsattr man pages!

Quote:
As there is alot of sites with have the same problem
This isn't site related, but related to files (and/or directories) on your machine.
 
1 members found this post helpful.
Old 05-28-2013, 05:38 AM   #11
Vodkaholic1983
Member
 
Registered: May 2010
Distribution: Windows / Debian
Posts: 163

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by druuna View Post
You first need to check if this and possibly other file attributes are set and why (there might be a good reason for it).

If you are sure this needs to be done you can use chattr recursively (this example removes the i flag):
Code:
chattr -i -R /home/media/
Do have a look at the chattr and lsattr man pages!

This isn't site related, but related to files (and/or directories) on your machine.
It was done via virtualmin (which used to run /home on this raid setup)

everyone of the old website's had it's own php.ini etc... it's just the way virtualmin runs.
Cheers again Druuna
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't Delete Files - even as root! DJOtaku Linux - General 5 04-03-2008 09:48 PM
Files that root can't delete? mijohnst Solaris / OpenSolaris 5 03-20-2008 10:04 PM
Delete root mail nepcw Red Hat 5 07-18-2004 01:01 PM
Delete as Root mtoedtli2 Linux - Newbie 3 07-14-2004 03:06 PM
Tried to delete file as root but it says I don't have permission to delete it! beejayzed Mandriva 23 03-12-2004 02:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration