Operating System - Linux
1753795 Members
7027 Online
108799 Solutions
New Discussion юеВ

Problems to rm one file (?--------- )

 
SOLVED
Go to solution
Carme Torca
Super Advisor

Problems to rm one file (?--------- )

Hi,

I want to rm one file, but it is not possible.

# ls -lrta
?--------- 32767 root 38680 0 Jul 15 1965 DeplMMjlhcI

When I do:
rm DeplMMjlhcI

rm: remove weird file `DeplMMjlhcI'? y
rm: cannot remove `DeplMMjlhcI': Operation not permitted

I have tried to change it with chmod, but it doesn't want.
What could I do?

Thanks a lot of!
Carmen.
Users are not too bad ;-)
8 REPLIES 8
Peter Godron
Honored Contributor

Re: Problems to rm one file (?--------- )

Carmen,
try quoting the filename.
rm 'DeplMMjlhcI'

ls -a to check for non-printable characters in filename

rm -i and step through the files

WARNING:
This will remove all files of 0 size in directory AND SUBDIRECTORIES:
find . -size 0c -exec rm {} \;


Find the nodeid of the file and remove it that way.


Carme Torca
Super Advisor

Re: Problems to rm one file (?--------- )

Hi,
It doesn't works ok.

-------- 32767 root 7704 0 Aug 12 1965 DeplMbQeENi

# rm DeplMMjlhcI
rm: remove weird file `DeplMMjlhcI'? y
rm: cannot remove `DeplMMjlhcI': Operation not permitted

# ls -i
98340 bbc 229444 DeplMF0MGiA 229436 err4CjsrA 229434 ovpa_pkg.xml
229445 DeplMbQeENi 229443 DeplMMjlhcI 229431 outKXvpjh 229435 tmpovpa_pkg.xml

# find . -size 0c -exec rm {} \;
rm: cannot remove `./DeplMMjlhcI': Operation not permitted
rm: cannot remove `./DeplMF0MGiA': Operation not permitted
rm: cannot remove `./DeplMbQeENi': Operation not permitted

# find . -inum 229443 -exec rm {} \;
rm: cannot remove `./DeplMMjlhcI': Operation not permitted

What could I do?

Thanks!
Carmen.
Users are not too bad ;-)
Hemmetter
Esteemed Contributor

Re: Problems to rm one file (?--------- )

Hi Carmen,

What filesystem is that file located on?
Local,nfs,cifs?

What are the permissions of the directory?

rgds
HGH



Alexander Chuzhoy
Honored Contributor
Solution

Re: Problems to rm one file (?--------- )

Did you try to reboot and fsck the file system (assuming it's a local file system).
Also post the output of `lsattr DeplMMjlhcI`.

Carme Torca
Super Advisor

Re: Problems to rm one file (?--------- )

Hi,

The directory is temp/ and its depens on /var

# pwd
/var/opt/OV/installation/temp

# ls -lrta
total 28
drwxrwsr-x 4 root bin 4096 Sep 18 19:46 incoming
dr-xr-sr-x 19 bin bin 4096 Sep 18 19:48 ..
drwxrwsr-x 3 root bin 4096 Sep 18 19:49 packages
drwxr-xr-x 2 root bin 4096 Sep 18 19:49 inventory
drwxrwsr-x 7 bin bin 4096 Nov 20 11:35 .
drwxr-sr-x 2 root bin 4096 Jan 9 11:04 temp2
drwxrwxr-x 3 root bin 4096 Jan 9 13:13 temp

# ls -lrta temp
total 5291020984
?--------- 32767 root 38680 0 Jul 15 1965 DeplMMjlhcI
?--------- 32767 root 7192 0 Jul 23 1965 DeplMF0MGiA
?--------- 32767 root 7704 0 Aug 12 1965 DeplMbQeENi
-rw-rw-r-- 1 root bin 1756 Sep 18 19:46 tmpovpa_pkg.xml
-rw-rw-r-- 1 root bin 1772 Sep 18 19:46 ovpa_pkg.xml
drwxrwsr-x 7 bin bin 4096 Nov 20 11:35 ..
drwxr-sr-x 3 root bin 4096 Nov 20 11:39 bbc
drwxrwxr-x 3 root bin 4096 Jan 9 13:13 .

# df -k .
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda5 2063504 192448 1766236 10% /var

Thanks,
Users are not too bad ;-)
Carme Torca
Super Advisor

Re: Problems to rm one file (?--------- )

Hi,
I can't reboot the server.

?--------- 32767 root 38680 0 Jul 15 1965 DeplMMjlhcI
?--------- 32767 root 7192 0 Jul 23 1965 DeplMF0MGiA
?--------- 32767 root 7704 0 Aug 12 1965 DeplMbQeENi
-rw-rw-r-- 1 root bin 1756 Sep 18 19:46 tmpovpa_pkg.xml
-rw-rw-r-- 1 root bin 1772 Sep 18 19:46 ovpa_pkg.xml
drwxrwsr-x 7 bin bin 4096 Nov 20 11:35 ..
drwxr-sr-x 3 root bin 4096 Nov 20 11:39 bbc
drwxrwxr-x 3 root bin 4096

# df -k .
# lsattr -v DeplMMjlhcI
lsattr: No such file or directory while trying to stat DeplMMjlhcI

Users are not too bad ;-)
Alpha977
Valued Contributor

Re: Problems to rm one file (?--------- )

Hello Carme,

there are some process using this file?
Try to remove in another run-level.

Try also to remove with an external net tool, like WinSCP3, FileZilla or with a Linux-LiveCD (like knoppix).
Hemmetter
Esteemed Contributor

Re: Problems to rm one file (?--------- )

Hola Carmen,

That "file?" has an exorbitant link-count of 32767 it may be a directory with lots of subdirs but more probably a filesystem error.
Are there some hints in /var/log/messages?

can you do a:
# find /var -inum 229445 -exec ls -li {} \+

Finally i think the best is to get a downtime for reboot and fsck in single-user-mode.

rgds
HGH