LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-25-2004, 03:51 AM   #1
minhnv
LQ Newbie
 
Registered: Nov 2004
Posts: 13

Rep: Reputation: 0
can't delete file !


Hi all,
I'm a RH user ,
I try to move some file from my hdd,
but there'are some errors :

Code:
[root@redserv opt]# chattr -i -R WEB
[root@redserv opt]# rm -Rf WEB
rm: cannot remove directory `WEB/chroot/bin': Operation not permitted
rm: cannot remove directory `WEB/chroot/include': Operation not permitted
rm: cannot chdir from `WEB/chroot/etc/.' to `passwd': Not a directory
rm: cannot chdir from `WEB/chroot/etc/.' to `group': Not a directory
rm: cannot chdir from `WEB/chroot/etc/.' to `resolv.conf': Not a directory
rm: cannot chdir from `WEB/chroot/etc/.' to `hosts': Not a directory
rm: cannot chdir from `WEB/chroot/etc/.' to `nsswitch.conf': Not a directory
rm: cannot chdir from `WEB/chroot/etc/.' to `protocols': Not a directory
rm: cannot remove directory `WEB/scripts': Operation not permitted
rm: cannot remove directory `WEB/bin': Operation not permitted
PLS help me ,
thanks.
 
Old 11-25-2004, 04:04 AM   #2
Hcman
Member
 
Registered: Jan 2003
Location: Holland
Distribution: OpenBSD 3.6 - Arch Linux 0.7
Posts: 210

Rep: Reputation: 30
Who owns it and what are the permissions?
Run ls -l and see what that gives.

You can then change the owner/permissions with chown and chmod. After setting those you should be able to delete the files.

Arjan
 
Old 11-25-2004, 04:24 AM   #3
minhnv
LQ Newbie
 
Registered: Nov 2004
Posts: 13

Original Poster
Rep: Reputation: 0
I login as root

Hi Hcman ,
I login as root ,
and when i run # ls -l
Quote:
[root@redserv etc]# ls -l
total 24
-rw-r--r-- 1 root root 0 Nov 25 17:12 asd
-rw-r--r-- 1 root root 14 Nov 24 16:08 group
-rw-r--r-- 1 root root 237 Nov 24 16:08 hosts
-rw-r--r-- 1 root root 1686 Nov 24 16:08 nsswitch.conf
-rw-r--r-- 1 root root 0 Nov 24 16:08 passwd
-rw-r--r-- 1 root root 5834 Nov 24 16:08 protocols
-rw-r--r-- 1 root root 25 Nov 24 16:08 resolv.conf
[root@redserv etc]#
PLS show me why!
thanks,
 
Old 11-25-2004, 04:36 AM   #4
Hcman
Member
 
Registered: Jan 2003
Location: Holland
Distribution: OpenBSD 3.6 - Arch Linux 0.7
Posts: 210

Rep: Reputation: 30
This is the etc/ dir listing; you need it for your /opt/WEB dir.

Code:
ls -l /opt/web/
Then look into chmod and chown (man chmod, man chown for more info).

Arjan
 
Old 11-25-2004, 04:43 AM   #5
minhnv
LQ Newbie
 
Registered: Nov 2004
Posts: 13

Original Poster
Rep: Reputation: 0
Hi Hcman,
result of command #ls -l /opt/WEB/ l
Code:
[root@redserv WEB]# ls -l /opt/WEB/
total 12
drwxr-xr-x    2 root     root         4096 Nov 25 15:29 bin
drwxr-xr-x    5 root     root         4096 Nov 25 15:17 chroot
drwxr-xr-x    2 root     root         4096 Nov 25 15:17 scripts
[root@redserv WEB]#
pls help me ,
thanks
 
Old 11-25-2004, 04:45 AM   #6
minhnv
LQ Newbie
 
Registered: Nov 2004
Posts: 13

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by Hcman
This is the etc/ dir listing; you need it for your /opt/WEB dir.

Code:
ls -l /opt/web/
Then look into chmod and chown (man chmod, man chown for more info).

Arjan
maybe harddisk errors ?
what do u think?
 
Old 11-25-2004, 04:53 AM   #7
Hcman
Member
 
Registered: Jan 2003
Location: Holland
Distribution: OpenBSD 3.6 - Arch Linux 0.7
Posts: 210

Rep: Reputation: 30
HD errors are possible but that is such an unsatisfying answer don't you think? :-)

Try removing the subdirs individually or the files within the subdirs.

Arjan
 
Old 11-25-2004, 04:58 AM   #8
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Could you look at the 'ls -la /WEB' listing. Are there hidden files in the directories?
Also, look at output of
lsof | grep WEB | grep -v grep
This will list the processes that may have some files open.
 
Old 11-25-2004, 07:59 PM   #9
minhnv
LQ Newbie
 
Registered: Nov 2004
Posts: 13

Original Poster
Rep: Reputation: 0
thanks all,
i do that but i still can't delete them,
I'll try again ,
thanks
 
Old 11-25-2004, 08:05 PM   #10
minhnv
LQ Newbie
 
Registered: Nov 2004
Posts: 13

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by Hcman
HD errors are possible but that is such an unsatisfying answer don't you think? :-)
Arjan
I think so ,
Quote:
Originally posted by Hcman
Try removing the subdirs individually or the files within the subdirs.
I do it but i still can't delete files ----> HD errors
thanks for your help ,
 
  


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
How do you delete a file?? The Pentium Guy Debian 7 11-01-2004 09:30 AM
Can't delete a file elfoozo Linux - General 6 10-31-2004 06:33 PM
How to delete a file Meatball1337 Linux - Software 1 10-04-2004 09:05 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
Delete contents of the file, but not file? mikeshn Linux - General 9 05-28-2003 06:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:32 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