Como remover um arquivo que pode ser visto, mas nenhum programa parece tocar?

2

Estou tentando remover alguns backups obsoletos e, no fundo, encontrei um arquivo 'cifs3bee' que não consigo remover. (E como não consigo removê-lo, ele está impedindo a remoção de toda a árvore de diretórios que leva a ele.) Se eu executar ls -l , obtenho:

total 1
-rwxr-xr-x 1 jgw87 root 307 Oct 30  2014 cifs3bee

E se eu executar file cifs3bee às vezes recebo:

cifs3bee: writable, regular file, no read permission

mas às vezes eu recebo:

cifs3bee: ERROR: cannot open 'cifs3bee' (No such file or directory)

que é basicamente o mesmo erro que eu sempre obtenho se eu executo rm, chmod, lsattr, less, ou praticamente qualquer outro comando nele (mesmo se eu sudo para root). Eu até tentei ' echo "x" > cifs3bee ' e ainda recebo um erro No such file or directory , mesmo que ls continue a mostrar o arquivo e ' rm -rf ' no diretório pai falhe dizendo que o diretório não está vazio.

O que está acontecendo aqui e alguém sabe como lidar com isso? Eu nem sei como esse arquivo entrou no meu backup, já que o nome não corresponde ao padrão que eu configurei para quais arquivos capturar.

Edit: Desculpe, esqueci as especificações do sistema. Este sou eu executando o Linux Mint 17, trabalhando em um servidor remoto do Windows montado via Samba. (Eu não sei as especificações do servidor.)

Editar: eu corri strace head cifs3bee , com a seguinte saída:

execve("/usr/bin/head", ["head", "cifs3bee"], [/* 69 vars */]) = 0
brk(0)                                  = 0x11f0000
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f8ccbe8f000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/usr/local/cuda-5.0/lib/tls/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/local/cuda-5.0/lib/tls/x86_64", 0x7fff275aa470) = -1 ENOENT (No such file or directory)
open("/usr/local/cuda-5.0/lib/tls/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/local/cuda-5.0/lib/tls", 0x7fff275aa470) = -1 ENOENT (No such file or directory)
open("/usr/local/cuda-5.0/lib/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/local/cuda-5.0/lib/x86_64", 0x7fff275aa470) = -1 ENOENT (No such file or directory)
open("/usr/local/cuda-5.0/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/local/cuda-5.0/lib", 0x7fff275aa470) = -1 ENOENT (No such file or directory)
open("/home/jgw87/Software/root/lib/tls/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/home/jgw87/Software/root/lib/tls/x86_64", 0x7fff275aa470) = -1 ENOENT (No such file or directory)
open("/home/jgw87/Software/root/lib/tls/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/home/jgw87/Software/root/lib/tls", 0x7fff275aa470) = -1 ENOENT (No such file or directory)
open("/home/jgw87/Software/root/lib/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/home/jgw87/Software/root/lib/x86_64", 0x7fff275aa470) = -1 ENOENT (No such file or directory)
open("/home/jgw87/Software/root/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/home/jgw87/Software/root/lib", {st_mode=S_IFDIR|0770, st_size=32768, ...}) = 0
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=168641, ...}) = 0
mmap(NULL, 168641, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f8ccbe65000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "7ELF
total 1
-rwxr-xr-x 1 jgw87 root 307 Oct 30  2014 cifs3bee
cifs3bee: writable, regular file, no read permission
cifs3bee: ERROR: cannot open 'cifs3bee' (No such file or directory)
execve("/usr/bin/head", ["head", "cifs3bee"], [/* 69 vars */]) = 0
brk(0)                                  = 0x11f0000
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f8ccbe8f000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/usr/local/cuda-5.0/lib/tls/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/local/cuda-5.0/lib/tls/x86_64", 0x7fff275aa470) = -1 ENOENT (No such file or directory)
open("/usr/local/cuda-5.0/lib/tls/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/local/cuda-5.0/lib/tls", 0x7fff275aa470) = -1 ENOENT (No such file or directory)
open("/usr/local/cuda-5.0/lib/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/local/cuda-5.0/lib/x86_64", 0x7fff275aa470) = -1 ENOENT (No such file or directory)
open("/usr/local/cuda-5.0/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/local/cuda-5.0/lib", 0x7fff275aa470) = -1 ENOENT (No such file or directory)
open("/home/jgw87/Software/root/lib/tls/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/home/jgw87/Software/root/lib/tls/x86_64", 0x7fff275aa470) = -1 ENOENT (No such file or directory)
open("/home/jgw87/Software/root/lib/tls/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/home/jgw87/Software/root/lib/tls", 0x7fff275aa470) = -1 ENOENT (No such file or directory)
open("/home/jgw87/Software/root/lib/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/home/jgw87/Software/root/lib/x86_64", 0x7fff275aa470) = -1 ENOENT (No such file or directory)
open("/home/jgw87/Software/root/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/home/jgw87/Software/root/lib", {st_mode=S_IFDIR|0770, st_size=32768, ...}) = 0
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=168641, ...}) = 0
mmap(NULL, 168641, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f8ccbe65000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "7ELF%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%>%pre%%pre%%pre%%pre%0%pre%%pre%%pre%%pre%%pre%"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1840928, ...}) = 0
mmap(NULL, 3949248, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f8ccb8aa000
mprotect(0x7f8ccba65000, 2093056, PROT_NONE) = 0
mmap(0x7f8ccbc64000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1ba000) = 0x7f8ccbc64000
mmap(0x7f8ccbc6a000, 17088, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f8ccbc6a000
close(3)                                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f8ccbe64000
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f8ccbe62000
arch_prctl(ARCH_SET_FS, 0x7f8ccbe62740) = 0
mprotect(0x7f8ccbc64000, 16384, PROT_READ) = 0
mprotect(0x608000, 4096, PROT_READ)     = 0
mprotect(0x7f8ccbe91000, 4096, PROT_READ) = 0
munmap(0x7f8ccbe65000, 168641)          = 0
brk(0)                                  = 0x11f0000
brk(0x1211000)                          = 0x1211000
open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=2919792, ...}) = 0
mmap(NULL, 2919792, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f8ccb5e1000
close(3)                                = 0
open("cifs3bee", O_RDONLY)              = -1 ENOENT (No such file or directory)
open("/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=2570, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f8ccbe8e000
read(3, "# Locale name alias data base.\n#"..., 4096) = 2570
read(3, "", 4096)                       = 0
close(3)                                = 0
munmap(0x7f8ccbe8e000, 4096)            = 0
open("/usr/share/locale/en_US.UTF-8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en_US.utf8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en_US/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en.UTF-8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en.utf8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en_US.UTF-8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en_US.utf8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en_US/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en.UTF-8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en.utf8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en/LC_MESSAGES/coreutils.mo", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=619, ...}) = 0
mmap(NULL, 619, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f8ccbe8e000
close(3)                                = 0
open("/usr/lib/charset.alias", O_RDONLY|O_NOFOLLOW) = -1 ENOENT (No such file or directory)
write(2, "head: ", 6head: )                   = 6
write(2, "cannot open 200cifs3bee201 for r"..., 38cannot open ‘cifs3bee’ for reading) = 38
open("/usr/share/locale/en_US.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en_US.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en_US.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en_US.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
write(2, ": No such file or directory", 27: No such file or directory) = 27
write(2, "\n", 1
)                       = 1
close(1)                                = 0
close(2)                                = 0
exit_group(1)                           = ?
+++ exited with 1 +++
%pre%%pre%%pre%%pre%%pre%%pre%>%pre%%pre%%pre%%pre%0%pre%%pre%%pre%%pre%%pre%"..., 832) = 832 fstat(3, {st_mode=S_IFREG|0755, st_size=1840928, ...}) = 0 mmap(NULL, 3949248, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f8ccb8aa000 mprotect(0x7f8ccba65000, 2093056, PROT_NONE) = 0 mmap(0x7f8ccbc64000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1ba000) = 0x7f8ccbc64000 mmap(0x7f8ccbc6a000, 17088, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f8ccbc6a000 close(3) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f8ccbe64000 mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f8ccbe62000 arch_prctl(ARCH_SET_FS, 0x7f8ccbe62740) = 0 mprotect(0x7f8ccbc64000, 16384, PROT_READ) = 0 mprotect(0x608000, 4096, PROT_READ) = 0 mprotect(0x7f8ccbe91000, 4096, PROT_READ) = 0 munmap(0x7f8ccbe65000, 168641) = 0 brk(0) = 0x11f0000 brk(0x1211000) = 0x1211000 open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=2919792, ...}) = 0 mmap(NULL, 2919792, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f8ccb5e1000 close(3) = 0 open("cifs3bee", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=2570, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f8ccbe8e000 read(3, "# Locale name alias data base.\n#"..., 4096) = 2570 read(3, "", 4096) = 0 close(3) = 0 munmap(0x7f8ccbe8e000, 4096) = 0 open("/usr/share/locale/en_US.UTF-8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale/en_US.utf8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale/en_US/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale/en.UTF-8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale/en.utf8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale/en/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale-langpack/en_US.UTF-8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale-langpack/en_US.utf8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale-langpack/en_US/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale-langpack/en.UTF-8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale-langpack/en.utf8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale-langpack/en/LC_MESSAGES/coreutils.mo", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=619, ...}) = 0 mmap(NULL, 619, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f8ccbe8e000 close(3) = 0 open("/usr/lib/charset.alias", O_RDONLY|O_NOFOLLOW) = -1 ENOENT (No such file or directory) write(2, "head: ", 6head: ) = 6 write(2, "cannot open 200cifs3bee201 for r"..., 38cannot open ‘cifs3bee’ for reading) = 38 open("/usr/share/locale/en_US.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale/en_US.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale/en.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale/en.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale-langpack/en_US.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale-langpack/en_US.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale-langpack/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale-langpack/en.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale-langpack/en.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale-langpack/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory) write(2, ": No such file or directory", 27: No such file or directory) = 27 write(2, "\n", 1 ) = 1 close(1) = 0 close(2) = 0 exit_group(1) = ? +++ exited with 1 +++

Infelizmente, não sei interpretar isso. Alguma ajuda?

    
por Jason 15.07.2015 / 15:42

2 respostas

2

Primeiro, gostaria de saber se você pode ter um espaço (s) à direita no nome do arquivo. Teste digitando ls "cifs e depois a guia para concluir automaticamente (supondo que você esteja em uma caixa do Linux, o que é uma grande suposição, é claro). Se isso não der certo, tente remover o arquivo pelo seu inode .

Boa explicação de como fazer isso aqui: excluir / remover arquivos com o inode número

Destaques do processo incluem: Primeiro, obtenha o inode do arquivo: ls -il

Depois, com o inode na mão, tente remover o arquivo:

find . -inum [inode-number] -exec rm -i {} \;</b>
    
por 15.07.2015 / 15:54
1

Você ainda pode me converter no arquivo em torno de sua partição. Tente afastá-lo. Mas parece que é um erro de disco ou sistema de arquivos. O próximo passo que eu faria seria fsck.

Além disso, tente 'strace echo "abcd" > file 'e descobre qual syscall realmente gera o erro como "no such file or directory" porque se não existir deve ser criado, então algo não existe como o interpretador bash ou diretório pai ou echo não é echo mas sim alias.

Outra possibilidade de que algo remova / restaure o arquivo para que você não tenha muita sorte e seja removido ao mesmo tempo recriado.

Outra possibilidade é que algo específico para o sistema de arquivos como os outros caras apontam corretamente que a presença de 'cifs' no nome do arquivo aponta para essa possibilidade.

    
por 15.07.2015 / 15:54

Tags