Não é possível rm -rf .nfs0000000008547f6500007f62 arquivo no servidor linux

1

Quando faço um

rm -rf directory

Diz uma mensagem como:

rm: can't delete directory/.nfs0000000008547f6500007f62
ressource occupied 

e eu não sei porque.

    
por Mantisse 28.06.2016 / 08:44

1 resposta

3

Seu sistema provavelmente está usando o NFS. A implementação do cliente NFS cria esses diretórios quando um arquivo é removido, mas ainda em uso por um aplicativo.

De link :

A. Unix applications often open a scratch file and then unlink it. They do this so that the file is not visible in the file system name space to any other applications, and so that the system will automatically clean up (delete) the file when the application exits. This is known as "delete on last close", and is a tradition among Unix applications.

Because of the design of the NFS protocol, there is no way for a file to be deleted from the name space but still remain in use by an application. Thus NFS clients have to emulate this using what already exists in the protocol. If an open file is unlinked, an NFS client renames it to a special name that looks like ".nfsXXXXX". This "hides" the file while it remains in use. This is known as a "silly rename." Note that NFS servers have nothing to do with this behavior.

After all applications on a client have closed the silly-renamed file, the client automatically finishes the unlink by deleting the file on the server. Generally this is effective, but if the client crashes before the file is removed, it will leave the .nfsXXXXX file. If you are sure that the applications using these files are no longer running, it is safe to delete these files manually.

The NFS version 4 protocol is stateful, and could actually support delete-on-last-close. Unfortunately there isn't an easy way to do this and remain backwards-compatible with version 2 and 3 accessors.

Se você reiniciar os aplicativos ou o servidor, poderá excluir esses arquivos (porque eles não estarão mais em uso), a menos que novos sejam criados nesse meio tempo.

    
por 28.06.2016 / 09:08