NFSv4 file deletion fails with "Device or resource busy" error on RHEL systems.

Solution Verified - Updated -

Issue

  • Getting "Device or resource busy" error, while attempting to remove a file, present on a NFS share; Although the file is not in use, by the concerned client:

    # rm -f /path/to/file/on/a/nfs/share
    rm: cannot remove '/path/to/file/on/a/nfs/share': Device or resource busy
    
  • Why am I seeing a "Device or resource busy" error when trying to delete a file? Could it be that another NFS client has the file open? I have already checked that the file is not in use, using lsof and fuser on the affected client.

  • A packet capture while removing the file, shows NFS4ERR_FILE_OPEN error, even though no processes on the current NFS client have the file open.

  • Could NFSv4 be blocking deletion due to an open file on another client?

  • Is NFSv4 preventing the file deletion because it’s open on another client? How can I check for active locks?

Environment

  • Red Hat Enterprise Linux 7
  • Red Hat Enterprise Linux 8
  • Red Hat Enterprise Linux 9
  • Red Hat Enterprise Linux 10
  • NFSV4

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content