Mapped and online LUNs can remain unused in a filer because a connected initiator is missing. With the NetApp-CLI, such LUNS can be detected by following these steps:
First, we look for initiator groups for which **all **initiators are not logged in.
node01::> lun igroup show -igroup \*group06\* -instance
Vserver Name: Node01A1
Igroup Name: group061a
Protocol: fcp
OS Type: windows
Portset Binding Igroup: fc\_pset\_1
Igroup UUID: \*\*\*\*
ALUA: true
Initiators: 10:00:00:00:c9:74:b6:f9 (**not logged in)**
10:00:00:00:c9:74:b7:b5 (**not logged in**)
Vserver Name: Node01A1
Igroup Name: group062a
Protocol: fcp
OS Type: windows
Portset Binding Igroup: fc\_pset\_1
Igroup UUID: \*\*\*\*
ALUA: true
Initiators: 10:00:00:00:c9:74:9b:f1 (**not logged in**)
10:00:00:00:c9:74:b2:91 (**not logged in**)
```Next, we can search for the LUNs:```
node01::> lun mapping show -igroup group06\*
Vserver   Path                Igroup  LUN ID
---------- -------------------------------- Â ------- Â ------
Node01A1  /vol/group061a/group061a\_2     group061a    1
Node01A1  /vol/group061a/rbgs061a\_1     group061a    0
Node01A1  /vol/group062a/group062a\_1     group062a    0
Node01A1  /vol/group062a/group062a\_2     group062a    1
```We would like to automate this process with a check, so that one can check for unused LUNs on a regular basis and any found LUNs can be suggested to the storage admin for deletion.
We appreciate your feedback, please leave a comment bellow or send an email to [[email protected]](mailto:[email protected]).