I need to grep specific luns
from the lsscsi
command.
For example:
[root@e15l1 ~]# lsscsi 4 0 1 | awk '{print $1,$6}' | head
[4:0:1:0] -
[4:0:1:1] /dev/sdab
[4:0:1:2] /dev/sdj
[4:0:1:3] /dev/sdz
[4:0:1:4] /dev/sdk
[4:0:1:12] /dev/sdo
[4:0:1:13] /dev/sdp
[4:0:1:38] /dev/sdad
How can I grep only luns
1, 12 and 13?
I am using:lsscsi | awk '{ print $1,$6 }' | grep -w 4:0:1 | egrep -w '1|1[2-3]'
The problem is when I am searching for a lun
with same number as other scsi
entries. For example in my case searching lun
1 will give the whole output because my ID
is also 1. Same with lun
4(due Host adapter
)...
Output should be as in the example, scsi
entries and /dev/...