メインコンテンツまでスキップ

nfsxxxx ファイルとは何ですか。また、どのようにして削除しますか。

Views:
5,589
Visibility:
Public
Votes:
5
Category:
ontap-9
Specialty:
nas
Last Updated:

環境

NFS

回答

  • .nfsXXXXクライアントで現在開かれているファイルがそのクライアントによって削除されると、のような命名規則を持つファイルがNFSクライアントによって作成されます
  • クライアントは .nfsXXXX 、他のクライアント/プロセスがファイルを使用しないようにするファイルの名前を変更します
  • 名前を変更するクライアントは、クライアントプロセスがファイルを閉じた後で、そのファイルを削除する必要があります。この削除は'クライアントがdsiconninn接続されているか'再起動されているか'または削除を問題 するプロセスが終了している場合には実行されないことがあります
  • これらのファイルはONTAP プロセスで生成されるのではなく、クライアントの要求に応じて作成されます
  • .nfsxxxx ファイルを使用してNFSクライアントとNFSプロセスを検索すると、非常に時間がかかることがあります
  • この場合は、ファイルが含まれているNFS共有にアクセスしている可能性のあるすべてのNFSクライアントですべてのプロセスを確認する必要があります
  • lsof.nfsxxxx などのユーティリティを使用して、ファイルを使用してプロセスを決定できます
  • .nfsXXXX ファイルが作成されないようにするには、ファイルが開いているときにファイルを削除しないでください
  • .nfsxxxx ファイルが使用されていないと判断された場合は、削除されることがあります。削除によって .nfsxxxx 新しいファイルが生成された場合、そのNFSクライアント上のプロセスでファイルが開かれています
  • .nfsxxxx ファイルの作成と削除のデモ:
  1. NFSクライアントで、マウントされたNFS共有内にファイルを作成し、tailコマンドを使用して開きます
    • ctrl-z プロセスをで中断するか、新しい端末を開いて、残りのデモを完了します

      shell# echo test > foo
      shell# tail -f foo
      test
      ^Z
      [1]+ Stopped tail -f foo

       
  2. foo ファイルを削除して、NFSクライアントで .nfsxxxx ファイルを作成します

    shell# rm foo
    shell# ls -A
    .nfs5ACF

     
  3. 以降の rm コマンドでは、NFSクライアントがファイルの名前をもう一度変更するだけであることがわかります

    shell# rm .nfs5ACF
    shell# ls -A
    .nfs6ACF

     
  4. lsofまたはfuserを使用してファイルを開くプロセスを探します

    shell# lsof ./.nfs6ACF
    COMMAND   PID USER   FD   TYPE DEVICE  SIZE NODE NAME
    tail   25725 root   3r   REG   8,1 27603 6647 .nfs6ACF

    shell# fuser .nfs6ACF
    .nfs6ACF 25725o

  5. 最後に'ファイルを開いたままのプロセスを終了し .nfsxxx 'ファイルが削除されたことを確認します

    shell# kill 25725
    shell# ls -al
    total x
    drwxr-sr-x  2 root src   400 Mar 29 15:39 .
    drwxrwsr-x 36 root src   3336 Mar 21 09:37 ..

追加情報

クライアントがファイルを開いている場合に ONTAP から確認できるかどうかは、使用するプロトコルによって異なります。

  • NFSv3 :通常、 NFSv3 はステートレスであるためロックはありません。
  • NFSv4.0 または 4.1 :クライアントでファイルが開いてnfsv4nfsv4.1 いる場合は、またはロックが設定されます。

cluster2::> vserver locks show -vserver svm1 -volume unix -path /unix/.nfs000000000000006000000009
Vserver: svm1
Volume   Object Path         LIF      Protocol  Lock Type   Client
-------- ------------------------- ----------- --------- ----------- ----------
unix    /unix/.nfs000000000000006000000009
                  svm1_cifs_nfs_lif1
                        nfsv4    share-level 10.64.24.10
         Sharelock Mode: write-deny_none

  • クライアント IP を特定できるのは、ファイルに対して NFSv4 または NFSv4.1 のロックが存在する場合のみです。
  • ロックが存在しない場合、 NFSv3 クライアントがファイルを使用しているかどうかを表示できるコマンドはありません。

: 9.8 より前のリリースの ONTAP で NFSv4 および NFSv4.1 タイプのロックのクライアント IP を取得するには、追加の診断モードコマンドが必要です。

Please contact NetApp Technical Support or log into the NetApp Support Site to create a case. Reference this article for assistance with the solution. 

  • The solution requires Diagnostic-level recovery. 
  • The use of Diagnostic commands and recovery steps is potentially disruptive and should only be used with guidance from NetApp Support. 

 

NetApp provides no representations or warranties regarding the accuracy or reliability or serviceability of any information or recommendations provided in this publication or with respect to any results that may be obtained by the use of the information or observance of any recommendations provided herein. The information in this document is distributed AS IS and the use of this information or the implementation of any recommendations or techniques herein is a customer's responsibility and depends on the customer's ability to evaluate and integrate them into the customer's operational environment. This document and the information contained herein may be used solely in connection with the NetApp products discussed in this document.