How to lookup disk "Device Identifier" from "Device / Media Name"? There are 20+ drives in the system. One of the drives is having issues according to the disk controller. The disk controller reports to me by the drives serial number. That drive serial I can map to a &quot;Device / Media Name&quot; (f.e. HPT DISK 1_7 Media).
Device / Media Name → Device Identifier
Next, I do wish to know the &quot;Device Identifier&quot; (like disk8) or &quot;Device Node&quot; (f.e. /dev/disk8).

Regression
Having to do a diskutil info /dev/diskZZ for all of the 20+ drives is quite inefficient.

What is the efficient way to do a command-line lookup for the disk its &quot;Device Identifier&quot; having the &quot;Device / Media Name&quot; using Lion (Mac OS X 10.7)?
The following will output the device node for any volume with a matching name by replacing &lt;string&gt; with the Device/ Media Name you're searching for. 

for d in /dev/disk*; do
    if [ `diskutil info $d | grep -c &lt;string&gt;` == 1 ]; then
        diskutil info $d | grep "Node"
    fi
done


One-liner

$ for disk in /dev/disk*; do [ `diskutil info $disk | grep -c '&lt;string&gt;'` == 1 ] &amp;&amp; diskutil info $disk | grep Node; done


BTW, on my MacBook Pro I have two "drives" with the same device name as they are two volumes on an APFS drive so some people reading this may have similar happening. I also don't have a 10.7 Mac available to test it, but it doesn't rely on any fancy shell stuff so should work fine. It certainly works on 10.12 and 10.13.