--- title: "Managing SMB Open Files" slug: "managing-smb-open-files" tags: ["5.4"] updated: 2026-10-28T01:53:34Z published: 2026-10-28T01:53:34Z canonical: "docs.vastdata.com/managing-smb-open-files" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.vastdata.com/llms.txt > Use this file to discover all available pages before exploring further. # Managing SMB Open Files **NOTE**: This feature is available starting with VAST Cluster 5.4.1. For each SMB-enabled view, you can list all open files and/or SMB byte-range locks for a certain directory and unlock the files as needed. The following actions are supported: - List all open files and directories under a certain path - Close selected files or folders (will close all open handles on files) - Unlock all SMB byte-range locks on selected files - List all open handles of a single chosen file or folder - Release selected open handles of a single chosen file or folder To list open files, you run an open file query. You can create a new query or select one of queries that you've run previously. - [Managing Open SMB Files in VAST Web UI](/docs-5-4/docs/managing-smb-open-files-tg#managing-open-smb-files-in-vast-web-ui) - [Managing Open SMB Files in VAST CLI](/docs-5-4/docs/managing-smb-open-files-tg#managing-open-smb-files-in-vast-cli) ## Managing Open SMB Files in VAST Web UI - [Run an Open File Query](/docs-5-4/docs/managing-smb-open-files-tg#run-an-open-file-query) - [View All Open Handles for a File](/docs-5-4/docs/managing-smb-open-files-tg#view-all-open-handles-for-a-file) - [Close Open Handles](/docs-5-4/docs/managing-smb-open-files-tg#close-open-handles) - [Release Byte-Range Locks for a File](/docs-5-4/docs/managing-smb-open-files-tg#release-byterange-locks-for-a-file) ### Run an Open File Query To search for open files on an SMB view: 1. From the left navigation menu, select **Element Store** and then **Views** to open the **Views** page. 2. Right-click an SMB-enabled view and choose **Open SMB Files** -> **SMB Locks & Open Handles** to open the **SMB Locks & Open Handles** dialog. 3. Do either of the following: - If you want to create and run a new query, use the **Define query** pane: - In the **File prefix** field, enter the path to the directory to search for open files. - This field is prepopulated with a path to the current view's root directory. Append it with a relative path to the directory you want. If you omit the ending slash, it will be added automatically when processing the query. - Note that the search will not include subdirectories. - Select **Return only files with byte-range-locks** if you want the query to return only files that have SMB byte-range locks on them. If this checkbox is not selected, both open handles and byte-range locks are displayed. - Click **Start query**. - If you want to rerun one of prior queries, select the query you want in the **Past queries** pane and click **Start query**. - VAST Cluster runs the query and displays a list of open files. For each file, there is an indication whether it has SMB byte-range locks on it. ### View All Open Handles for a File To list all open handles for a file included in open file query results: - Right-click the file and choose **List All Open Handles**. A list of open handles for the file is displayed, including the following information per handle: | **Client IP** | The IP address of the client. | | --- | --- | | **Share Access** | SMB share permissions. | | **Username** | The name of the user for which the handle was created. | | **Session ID** | The ID of the session where the handle was created. | | **Unique ID** | The unique ID of the handle. | | **Has Locks** | Indicates whether the file has byte-range locks on it. | | **Access mask** | A list of SMB access masks. | | **Lease** | Indicates whether there is a lease on the file. | ### Close Open Handles To close all open handles and release all SMB byte-range locks for a file: 1. [Run](/docs-5-4/docs/managing-smb-open-files-tg#run-an-open-file-query) an open file query for the path where the file resides. 2. Right-click the file in the query results and choose **Close All Handles and Locks**. To close one or more specific handles for a file included in open file query results: 1. [Run](/docs-5-4/docs/managing-smb-open-files-tg#run-an-open-file-query) an open file query for the path where the path resides. 2. Right-click the file in the query results and choose **List All Open Handles** to [view](/docs-5-4/docs/managing-smb-open-files-tg#view-all-open-handles-for-a-file) a list of open handles for the file. 3. Select one or more handles you want to close. Up to five handles can be selected. 4. Right-click the selection and choose the option to close handles. 5. Click **Yes** in the confirmation prompt. ### Release Byte-Range Locks for a File To release byte-range locks for a file: 1. [Run](/docs-5-4/docs/managing-smb-open-files-tg#run-an-open-file-query) an open file query for the path where the file resides. 2. Right-click the file in the query results and choose **Release Byte-Range Locks**. ## Managing Open SMB Files in VAST CLI Use the following VAST CLI commands to manage SMB open files: | Create a query to search for open files | `openfilesquery create` | | --- | --- | | Delete an open file query | `openfilesquery delete` | | List open file queries | `openfilesquery list` | | View details of an open file query | `openfilesquery show` | | Run an open file query | `openfilesquery list-open-files` | | Close an open file | `openfilesquery close-open-file` | | Retrieve open file handles for a file | `openfilesquery query-open-file-handles` | | View open file handles for a file | `openfilesquery list-open-file-handles` | | Close a particular file handle | `openfilesquery close-open-file-handle` |