Display information about open SMB files in ONTAP
You can display information about open SMB files, including the SMB connection and session ID, the hosting volume, the share name, and the share path. You can also display information about the continuously available protection level of a file, which is helpful in determining whether an open file is in a state that supports nondisruptive operations.
You can display information about open files on an established SMB session. The displayed information is useful when you need to determine SMB session information for particular files within an SMB session.
For example, if you have an SMB session where some of the open files are open with continuously available protection and some are not open with continuously available protection (the value for the -continuously-available field in vserver cifs session show command output is Partial), you can determine which files are not continuously available by using this command.
You can display information for all open files on established SMB sessions on storage virtual machines (SVMs) in summary form by using the vserver cifs session file show command without any optional parameters.
However, in many cases, the amount of output returned is large. You can customize what information is displayed in the output by specifying optional parameters. This can be helpful when you want to view information for only a small subset of open files.
-
You can use the optional
-fieldsparameter to display output on the fields you choose.You can use this parameter either alone or in combination with other optional parameters.
-
You can use the
-instanceparameter to display detailed information about open SMB files.You can use this parameter either alone or in combination with other optional parameters.
-
Perform one of the following actions:
If you want to display open SMB files… Enter the following command… On the SVM in summary form
vserver cifs session file show -vserver vserver_nameOn a specified node
vserver cifs session file show -vserver vserver_name -node {node_name|local}On a specified file ID
vserver cifs session file show -vserver vserver_name -file-id integerOn a specified SMB connection ID
vserver cifs session file show -vserver vserver_name -connection-id integerOn a specified SMB session ID
vserver cifs session file show -vserver vserver_name -session-id integerOn the specified hosting aggregate
vserver cifs session file show -vserver vserver_name -hosting-aggregate aggregate_nameOn the specified volume
vserver cifs session file show -vserver vserver_name -hosting-volume volume_nameOn the specified SMB share
vserver cifs session file show -vserver vserver_name -share share_nameOn the specified SMB path
vserver cifs session file show -vserver vserver_name -path pathWith the specified level of continuously available protection
vserver cifs session file show -vserver vserver_name -continuously-available continuously_available_statusThe value for
-continuously-availablecan be one of the following:-
No -
YesIf the continuously available status is
No, this means that these open files are not capable of nondisruptively recovering from takeover and giveback. They also cannot recover from general aggregate relocation between partners in a high-availability relationship.
With the specified reconnected state
vserver cifs session file show -vserver vserver_name -reconnected reconnected_stateThe value for
-reconnectedcan be one of the following:-
No -
YesIf the reconnected state is
No, the open file is not reconnected after a disconnection event. This can mean that the file was never disconnected, or that the file was disconnected and is not successfully reconnected. If the reconnected state isYes, this means that the open file is successfully reconnected after a disconnection event.
There are additional optional parameters that you can use to refine the output results. Learn more about the commands described in this procedure in the ONTAP command reference.
-
The following example displays information about open files on SVM vs1:
cluster1::> vserver cifs session file show -vserver vs1 Node: node1 Vserver: vs1 Connection: 3151274158 Session: 1 File File Open Hosting Continuously ID Type Mode Volume Share Available ------- --------- ---- --------- ----------- ------------ 41 Regular r data data Yes Path: \mytest.rtf
The following example displays detailed information about open SMB files with file ID 82 on SVM vs1:
cluster1::> vserver cifs session file show -vserver vs1 -file-id 82 -instance
Node: node1
Vserver: vs1
File ID: 82
Connection ID: 104617
Session ID: 1
File Type: Regular
Open Mode: rw
Aggregate Hosting File: aggr1
Volume Hosting File: data1
CIFS Share: data1
Path from CIFS Share: windows\win8\test\test.txt
Share Mode: rw
Range Locks: 1
Continuously Available: Yes
Reconnected: No