So, I had this task the other day at work. Needed to figure out which LUNs (Logical Unit Numbers) were mapped to a specific controller on our Linux servers. You know, the usual storage management stuff. I did some digging around, and I thought I’d share my little journey here, in case anyone else finds it useful.
First, I wanted to see which LUNs the system could already see. For this, I used the command `multipath -ll`. Easy, right? But this command spits out a bunch of information, and I needed to make sense of it. In the output, there were these strings like “1:0:0:0” and “3:0:0:1”. I learned that the last digits in these, like the “0” and “1”, are actually the iSCSI LUN ID numbers. That was a nice little “aha” moment.
But sometimes, the LUNs don’t show up right away. So, the next step I took was to rescan the SCSI bus. I ran `*`, hoping that the OS would magically see the new LUN. To check if it worked, I used `lsscsi`. Most of the time, the LUN would show up. But if it didn’t, I would run the rescan command again with some extra parameters like `-w -c -l`. This basically tells the system to go look harder for all devices. And if even that didn’t work, I knew it was time for the good old reboot. Yeah, sometimes you just gotta turn it off and on again.
Find Unmapped LUNs
- Another thing I found out is that if you’re looking for LUNs that aren’t connected, you can search using the ‘unmapped’ filter.
- It’s a simple way to list out those unmapped LUNs, regardless of whether they’re online or offline.
- I also tried to refresh the multipath daemon using `multipath -v2`. This is supposed to make the device mapper take control of the new LUNs.
- Then, I realized that looking into `/sys/class/block/sd` could give a direct clue about the mapping.
- It’s like a behind-the-scenes look at how things are connected.
Anyway, that’s pretty much what I did. It wasn’t rocket science, but it definitely made me feel like a bit of a detective, piecing together clues to find those LUNs. Hope this helps someone out there!