Linux: Listing all local and SAN disks on a host

linuxstorage

I am attempting to list and categorize all connected disks on a host; local and SAN-connected. The SAN use various types of adapters (namely Emulex and Qlogic) so scanning the FC bus can be somewhat unreliable (some hosts use both types for whatever reason). Basically I am gathering data for various reporting and analytics.

My question is this: if I use 'blkid' to list local disks, and 'lsscsi' to list the SAN devices attached via fibrechannel, will that encompass all of the disks connected to the host?

I've not had a lot of experience with either command to know the in's and out's of them, so I wanted to see if their results are reliable enough to build a data framework.

I should note that this is a heavily scrutinized environment and extraneous tools will not be permitted to be installed.

Best Answer

I'd probably just compare fdisk -l and lsscsi.

On my systems, I tend to see more output in fdisk, as lsscsi doesn't account for all of the block devices in use on the servers (ZFS zpool devices, etc.) Similar situation for blkid.