Linux - hacked up script to show drive locations on backplanes

Notice: Page may contain affiliate links for which we may earn a small commission through services like Amazon Affiliates or Skimlinks.

xian

New Member
Feb 28, 2016
2
3
3
44
Greetings all

First time poster. I wrote a script about a year ago to help make it easier to find drives on backplanes. I had cause to update it recently and I thought that perhaps it could be of use to some people here.

This works for HBAs and I've tested a variety of backplanes. I'll be happy to add more as I did try to write it in the most inclusive way possible. I tested over a dozen different supermicro backplanes before I came across a gigabyte one, and the addition of two lines allowed me to add it in.

Here's a sample of the output. It should look a bit better on your terminal without the weird forum spacing:
Code:
[root@gh1 ~]# hdslots

0:0:24:0
╔══════════════╤══════════════╤══════════════╤══════════════╗
║    34H8K0BGF │    34H1K3PYF │    34H8K0BOF │ WMC130104139 ║
║    34H8K0BMF │    34H1K3PZF │    34H3K4SRF │ WMC130042867 ║
║    34H8K0BUF │    34H8K0BSF │    34H4K3PQF │    34H8K0BTF ║
║    34H1K3PVF │    34H9K0D3F │    34H9K0D2F │    34H8K0BKF ║
║ WCAW3LTCK241 │    34H8K0BQF │    34H8K0BJF │    34H7K03TF ║
║ WCAW3LTCKD93 │    34H8K0BVF │    34H1K3PUF │    34H8K0BNF ║
╚══════════════╧══════════════╧══════════════╧══════════════╝

0:0:37:0
╔══════════════╤══════════════╤══════════════╤══════════════╗
║ WMC130103732 │ WMC130104150 │ WMC130042840 │ WMC130104092 ║
║ WCC131225081 │ WMC130047233 │ WMC130043799 │ WMC130047798 ║
║ WMC130025163 │ WMC130104006 │ WMC130042454 │ WMC130048251 ║
╚══════════════╧══════════════╧══════════════╧══════════════╝
If it's okay, I'd like to post the link instead of pasting the entire script here as I'd like to keep it in a single place when I have to update it.
excess you: finding drives on your backplane

Feedback is not only welcome but very much appreciated.

Thanks,
Xian
 
  • Like
Reactions: Quasduco and Marsh

Marsh

Moderator
May 12, 2013
2,645
1,496
113
Thanks for the work, I'll try it out soon.

One suggestion, could you please make the script downloadable.
I think cut and paste caused some of the ASCII graphics character in the printf statement showed up different than from your intent.
 

xian

New Member
Feb 28, 2016
2
3
3
44
Hi Marsh

Sure thing. I've not seen any trouble copying from blogspot's codeboxes but then again I've only tested on various linux systems.

Try this link:
hdslots.sh · GitHub

Regards,
Xian
 
Last edited:
  • Like
Reactions: Marsh