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
Welcome to
LinuxQuestions.org , a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free.
Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please
contact us . If you need to reset your password,
click here .
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a
virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month.
Click here for more info.
05-28-2013, 04:50 AM
#1
Member
Registered: May 2010
Distribution: Windows / Debian
Posts: 163
Rep:
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
05-28-2013, 04:52 AM
#2
Member
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 982
"lsattr" could these be marked as immutable or append-only?
Are they on local disk (not NFS or similar)?
05-28-2013, 04:54 AM
#3
Member
Registered: May 2010
Distribution: Windows / Debian
Posts: 163
Original Poster
Rep:
Quote:
Originally Posted by
linosaurusroot
"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)
05-28-2013, 04:56 AM
#4
LQ Veteran
Registered: Sep 2003
Posts: 10,532
What is the output of the following commands:
Code:
lsattr /home/media/downtherabbithole
# and
ls -lZ /home/media/downtherabbithole
05-28-2013, 05:03 AM
#5
Member
Registered: May 2010
Distribution: Windows / Debian
Posts: 163
Original Poster
Rep:
Quote:
Originally Posted by
druuna
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
05-28-2013, 05:21 AM
#6
LQ Veteran
Registered: Sep 2003
Posts: 10,532
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.
05-28-2013, 05:24 AM
#7
Member
Registered: May 2010
Distribution: Windows / Debian
Posts: 163
Original Poster
Rep:
Quote:
Originally Posted by
druuna
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 .
05-28-2013, 05:28 AM
#8
LQ Veteran
Registered: Sep 2003
Posts: 10,532
Quote:
Originally Posted by
Vodkaholic1983
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.
05-28-2013, 05:30 AM
#9
Member
Registered: May 2010
Distribution: Windows / Debian
Posts: 163
Original Poster
Rep:
Quote:
Originally Posted by
druuna
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 .
05-28-2013, 05:35 AM
#10
LQ Veteran
Registered: Sep 2003
Posts: 10,532
Quote:
Originally Posted by
Vodkaholic1983
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.
05-28-2013, 05:38 AM
#11
Member
Registered: May 2010
Distribution: Windows / Debian
Posts: 163
Original Poster
Rep:
Quote:
Originally Posted by
druuna
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
All times are GMT -5. The time now is 07:37 PM .
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know .
Latest Threads
LQ News