[MOVED] Can't delete file No such file or directory

Latest response

[Note: The Groups area will soon be archived. This topic has been moved to the new community discussion area, so head over and check it out.]

 

Hi , one of my machine is a nfs client to a netapp storage where I store all the web content.

 

There are some files that I'm not able to delete from the NFS client, that have a weird signature for example one of these file is named 

denytest.htmlÃ

When i try to remove this file with the command rm -i denytest.htmlà I get this error "No such file or directory".

I tried several different solutions including deleting the file from the inode number.

Wha is very baffling is that if I run the command touch denytest.htmlà and then  ls -il the directory I see more files like this popping in the directory :

466918 -rw-r--r--. 1 galkin eeb-web 118 Aug 17 11:33 denytest.html
780684 -rw-r--r--. 1 root   root      0 Aug 17 11:25 denytest.htmlÃ?
780685 -rw-r--r--. 1 root   root      0 Aug 17 11:33 denytest.htmlÃ?Â?
780686 -rw-r--r--. 1 root   root      0 Aug 17 11:33 denytest.htmlÃ? 

466919 -rw-r--r--. 1 user some-grp 116 Oct 12  2010 denytest.html 

466918 -rw-r--r--. 1 user some-grp 118 Aug 17 11:33 denytest.html

780685 -rw-r--r--. 1 root   root      0 Aug 17 11:33 denytest.htmlÃ?Â?

780684 -rw-r--r--. 1 root   root      0 Aug 17 11:25 denytest.htmlÃ?

780686 -rw-r--r--. 1 root   root      0 Aug 17 11:33 denytest.htmlÃ? 

780685 -rw-r--r--. 1 root   root      0 Aug 17 11:33 denytest.htmlÃ?Â?

If i touch the same file I get more files like the one above:.

If I try to remove the file again with the command rm -i denytest.htmlÃ? I actually get the prompt : remove regular file denytest.htmlà'? and after I see yes I see no errors but whe I ls -l the file is still there, but with a different signature:

?????????? ? ? denytest.html 

I run all sorts of fsck on the mount and the filesystem seems ok no errors . 

I suspect that this has something to do with UTF-8 when webmasters update the web content or these files are the rusult of a porting from a MacOs X system and there is some type of incompatibility.

In any case I'm not able to remove these file from the system neither the directory where this file is included. The only thing I'm able to do is to copy the entire dir to another dir and when I do this the file in question is not copied over the new directory I get an error saying "No such file or directory". 

I need to remove this file from the system and I have other 20 files like this any suggestions would be very welcomed .

Thanks

Marcello

Responses

Marcello,

 

Have you tried

rm -i denytest.html*

and answered with (y/n)

 

Kind regards,

 

Jan Gerrit Kootstra

 

Hi Jan, 

 

Like I said in my post ,

 

If I try to remove the file again with the command rm -i denytest.htmlÃ? I actually get the prompt : remove regular file denytest.htmlà'and after I see yes I see no errors but whe I ls -l the file is still there, but with a different signature:

?????????? ? ? denytest.html 

 

Regards

Marcello

Would the share in question happen to be one that was both CIFS and NFS?  It's been a while since I was a storage admin, but I recall that we had attempted to set up some shares that had multiple protocols (and intended clients i.e. Linux, Windows, OSX) and it was a complete mess.  It sounds like you may have a share that had been written to with a Windows system which you are attempting to access via a Linux client.

This doc briefly talks about the phenomenon (search on the word "strange")

https://communities.netapp.com/servlet/JiveServlet/previewBody/1170-102-2-1257/

Hi James,

Thankmyou for,your insight.

This particular share is and only NFS exclusively for NFS linux client.
Altough, it might be that the first time I moved the files I did it from an Xserve NFS client. I never had multiprotocol enabled on this share CiFS/NFS.

Regards
Marcello

No worries Marcello - I wish I had an answer that could tell you exactly what to do.  That document did seem to highlight some of the OSX things to consider.  There are a few settings on the share itself that I can no longer recall regarding file naming standards (UTF vs Unicode - again, it's been a while since I have set any of this stuff up).

Do you still have a Mac client that can access the share and does it see the same "oddities" in file names?  I don't have any experience with Xserve, unfortunately.

I hope this helps and doesn't send you off in the wrong direction.

Also I run the command strace rm -f denytest.html and this is the output I got :

 

execve("/bin/rm", ["rm", "-f", "denytest.html\303\202"], [/* 22 vars */]) = 0
brk(0)                                  = 0x1b64000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f04049ab000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=45540, ...}) = 0
mmap(NULL, 45540, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f040499f000
close(3)                                = 0
open("/lib64/libc.so.6", O_RDONLY)      = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360\355\301\230>\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1922152, ...}) = 0
mmap(0x3e98c00000, 3745960, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3e98c00000
mprotect(0x3e98d8a000, 2093056, PROT_NONE) = 0
mmap(0x3e98f89000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x189000) = 0x3e98f89000
mmap(0x3e98f8e000, 18600, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x3e98f8e000
close(3)                                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f040499e000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f040499d000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f040499c000
arch_prctl(ARCH_SET_FS, 0x7f040499d700) = 0
mprotect(0x3e98f89000, 16384, PROT_READ) = 0
mprotect(0x3e98a1f000, 4096, PROT_READ) = 0
munmap(0x7f040499f000, 45540)           = 0
brk(0)                                  = 0x1b64000
brk(0x1b85000)                          = 0x1b85000
open("/usr/lib/locale/locale-archive", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=99158576, ...}) = 0
mmap(NULL, 99158576, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f03feb0b000
close(3)                                = 0
ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B9600 opost isig icanon echo ...}) = 0
newfstatat(AT_FDCWD, "denytest.html\303\202", {st_mode=S_IFREG|0644, st_size=0, ...}, AT_SYMLINK_NOFOLLOW) = 0
unlinkat(AT_FDCWD, "denytest.html\303\202", 0) = 0
close(0)                                = 0
close(1)                                = 0
close(2)                                = 0
exit_group(0)                           = ?
 
 
Marcello

Hi James,

Thank you to your lead I was able to remove the file in question by allowing the netapp nfs share to a xserve withmac os x .

From the xserve I mounted the NFS share and like you said before the files where shwoing with a different symbol .

In any cas the command rm -i denytest.html? worked and removed the file.

Thank you very muche for your insight.

 

Marcello

Good to hear it.  It was an enjoyable to help with this one ;-)

As the Groups area will be set to read-only soon, I've moved this across to the new Discussions area. You can continue this thread here: https://access.redhat.com/site/discussions/461023

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.