[PLUGIN] Disk Location


Recommended Posts

Running into a couple issues, which may have already been mentioned.

1. My SSD is not recognized as a cache drive for some reason (I'm thinking because it is lacking a Device Family attribute).

2. I am using a 2x4 (CxR) layout, and my layout looks like this and nothing I seem to do can fix it. 

HDrBIX6.png

Link to comment
9 minutes ago, plttn said:

Running into a couple issues, which may have already been mentioned.

1. My SSD is not recognized as a cache drive for some reason (I'm thinking because it is lacking a Device Family attribute).

2. I am using a 2x4 (CxR) layout, and my layout looks like this and nothing I seem to do can fix it. 

HDrBIX6.png

Some SSD's might not include enough information to make a unique checksum. It must include "model" and "serial number" - this is as far as I've seen always included, if it's not; it will fail. It might also cause the layout to be messed up like you show it.

Another reason might be that you assigned devices to the tray slots before storing the actual layout. 

Please check the drives if they give at minimum model+serial number, serial number has to be unique. I know for a fact that some less known brands might just put in a lot of zeroes instead of an actual number and hence won't work with this script. It won't be able to assign them either in any way.

Link to comment
22 minutes ago, olehj said:

Some SSD's might not include enough information to make a unique checksum. It must include "model" and "serial number" - this is as far as I've seen always included, if it's not; it will fail. It might also cause the layout to be messed up like you show it.

Another reason might be that you assigned devices to the tray slots before storing the actual layout. 

Please check the drives if they give at minimum model+serial number, serial number has to be unique. I know for a fact that some less known brands might just put in a lot of zeroes instead of an actual number and hence won't work with this script. It won't be able to assign them either in any way.

7ae8Ykr.png

 

I don't know offhand if this is enough for it to be unique.

It's very possible this SSD is just too cheap for it to work properly. Thanks for letting me know!

Edited by plttn
Link to comment

I think I may have figured out why it doesn't seem to work on this drive. The manufacturer is setting a value your parsing isn't handling properly as the logical unit name. 

 

[1:0:0:0]    disk    ATA     SPCC Solid State Disk   _ /dev/sdb   /dev/sg1
[2:0:0:0]    disk    5000cca252e56185                  /dev/sdc   /dev/sg2

Since you're parsing via spaces, the luname gets set to ATA, device node gets set to SPCC and then everything falls apart from there. I don't know what the best way to solve this problem is however, as it would require a bunch of exceptions to account for all the low budget manufacturers doing things they shouldn't. It does create a unique hash for this SSD, but my guess is because the devicenode is ATA rather than sdb that's why it shows as unassigned.

 

Would parsing from the right work better to solve this issue? That gets you the devicenode right off the bat, then you could assume that everything bounded by disk and the /dev/sdX is the logical unit name whether or not it's a technically valid LUN.

Link to comment
7 hours ago, plttn said:

I think I may have figured out why it doesn't seem to work on this drive. The manufacturer is setting a value your parsing isn't handling properly as the logical unit name. 

 


[1:0:0:0]    disk    ATA     SPCC Solid State Disk   _ /dev/sdb   /dev/sg1
[2:0:0:0]    disk    5000cca252e56185                  /dev/sdc   /dev/sg2

Since you're parsing via spaces, the luname gets set to ATA, device node gets set to SPCC and then everything falls apart from there. I don't know what the best way to solve this problem is however, as it would require a bunch of exceptions to account for all the low budget manufacturers doing things they shouldn't. It does create a unique hash for this SSD, but my guess is because the devicenode is ATA rather than sdb that's why it shows as unassigned.

 

Would parsing from the right work better to solve this issue? That gets you the devicenode right off the bat, then you could assume that everything bounded by disk and the /dev/sdX is the logical unit name whether or not it's a technically valid LUN.

 

That does not look like the output of "lsscsi -u -g", or at least not the first output. The LUN should not be visible with "lsscsi", and the ATA+Model Name should not be visible with "lsscsi -u -g"

Also it appears to add an underscore after some spaces after the Model Name.

It does split on a \s+ flag, meaning single and multiple spaces/tabs will be split correctly if the output of lsscsi is. I must say it is interesting if this is your output with the "-u -g" flags.

The device model and serial number your drive shows is good for creating a hash. I still question the serial number a bit, if you have multiple of this SPCC disk check if you have any matching serial numbers as well.

In short; if the output is truly what you show above from the exact command "lsscsi -u -g", then I might think this can be a bug from the lsscsi program. I don't see why it should have a different output unless the drive itself messes up with the parsing of lsscsi. Sorry if I can't help you enough here right now, but keep me posted if you find something useful.

Link to comment
4 hours ago, olehj said:

 

That does not look like the output of "lsscsi -u -g", or at least not the first output. The LUN should not be visible with "lsscsi", and the ATA+Model Name should not be visible with "lsscsi -u -g"

Also it appears to add an underscore after some spaces after the Model Name.

It does split on a \s+ flag, meaning single and multiple spaces/tabs will be split correctly if the output of lsscsi is. I must say it is interesting if this is your output with the "-u -g" flags.

The device model and serial number your drive shows is good for creating a hash. I still question the serial number a bit, if you have multiple of this SPCC disk check if you have any matching serial numbers as well.

In short; if the output is truly what you show above from the exact command "lsscsi -u -g", then I might think this can be a bug from the lsscsi program. I don't see why it should have a different output unless the drive itself messes up with the parsing of lsscsi. Sorry if I can't help you enough here right now, but keep me posted if you find something useful.

Yes, that one specifically is indeed my output from lsscsi -u -g, but I believe I may have potentially found a fix with the pull request I submitted. 

Edited by plttn
Link to comment

So doing a massive amount of digging, 

 

/* Fetch logical unit (LU) name given the device name in the form:
 * h:c:t:l tuple string (e.g. "2:0:1:0"). This is fetched via sysfs (lk 3.15
 * and later) in vpd_pg83. For later ATA and SATA devices this may be its
 * WWN. Normally take the first found in this order: NAA, EUI-64 * then SCSI
 * name string. However if a SCSI name string is present and the protocol is
 * iSCSI (target port checked) then the SCSI name string is preferred. If
 * none of the above are present then check for T10 Vendor ID
 * (designator_type=1) and use if available. */

it looks like if lsscsi cannot find a LUN/WWN for a device, it'll eventually try to fall back to the Vendor ID. Since the Vendor ID on this is set to the funky value, lsscsi spits out the funky value, and then parsing that barfs.

Edited by plttn
Link to comment
1 hour ago, plttn said:

So doing a massive amount of digging, 

 


/* Fetch logical unit (LU) name given the device name in the form:
 * h:c:t:l tuple string (e.g. "2:0:1:0"). This is fetched via sysfs (lk 3.15
 * and later) in vpd_pg83. For later ATA and SATA devices this may be its
 * WWN. Normally take the first found in this order: NAA, EUI-64 * then SCSI
 * name string. However if a SCSI name string is present and the protocol is
 * iSCSI (target port checked) then the SCSI name string is preferred. If
 * none of the above are present then check for T10 Vendor ID
 * (designator_type=1) and use if available. */

it looks like if lsscsi cannot find a LUN/WWN for a device, it'll eventually try to fall back to the Vendor ID. Since the Vendor ID on this is set to the funky value, lsscsi spits out the funky value, and then parsing that barfs.

That is a bit of a bummer. I thought LUN always would be found. I might try to parse and compare and do some more checks and make a fallback myself. 

Link to comment
6 minutes ago, olehj said:

That is a bit of a bummer. I thought LUN always would be found. I might try to parse and compare and do some more checks and make a fallback myself. 

think I covered all the edge cases in my tokenization method here, but I actually haven't tested it running, just using logic. 

Link to comment
15 minutes ago, plttn said:

think I covered all the edge cases in my tokenization method here, but I actually haven't tested it running, just using logic. 

I looked at it a bit, but I think I might try a different approach based upon your data. However I feel it is strange you get a fallback value of Vendor ID instead of "none" as I get for some drives not including LUN.

Just for the sake, what Unraid version are you using?

Link to comment
2 minutes ago, olehj said:

I looked at it a bit, but I think I might try a different approach based upon your data. However I feel it is strange you get a fallback value of Vendor ID instead of "none" as I get for some drives not including LUN.

Just for the sake, what Unraid version are you using?

I'm using 6.7.0rc5.

Link to comment

I guess I have a solution now using some regexp and less modifications in general. As LUN is mainly not in use anymore, I just compress the Vendor ID into a "selfmade" LUN. Else it will rather check for the contents.

 

Also fixed a bug I discovered, old removed drives will now be shown until removed manually under "Information" - will release this asap

Link to comment
20 minutes ago, plttn said:

And I just confirmed that that update fixes the issue.

 

Thanks for taking care of it so fast!

I had nothing else to do while drinking my wonderful craft beers :P Now time to game and chill - fragging gets easier and easier more reduced I am ;)

 

Of course thank you for help and your effort!

Edited by olehj
Link to comment
On 2/7/2019 at 3:25 PM, olehj said:

I will make it possible to hide the contents of "empty" in the near future, but it will be either all or none of the empty slots - not selective.

I'd like to request this goes one further in having the ability to hide individual slots, or mark them in some way as N/A (not available) with their own colour.  Reasoning is because sometimes through poor quality control or over-use/abuse, individual slots on a backplane may no longer be functional.

 

I have two Supermicro 24-bay chassis where this is the case and I need to remember not to try to use those slots, so I physically mark them with tape, but it would be nice to have the plugin able to also mark individual slots as defunct, so when I am several miles away from the physical server, I can easily know which slot(s) are faulty for making upgrade or drive swap plans before visiting the site.

 

Link to comment
4 minutes ago, bman said:

I'd like to request this goes one further in having the ability to hide individual slots, or mark them in some way as N/A (not available) with their own colour.  Reasoning is because sometimes through poor quality control or over-use/abuse, individual slots on a backplane may no longer be functional.

 

I have two Supermicro 24-bay chassis where this is the case and I need to remember not to try to use those slots, so I physically mark them with tape, but it would be nice to have the plugin able to also mark individual slots as defunct, so when I am several miles away from the physical server, I can easily know which slot(s) are faulty for making upgrade or drive swap plans before visiting the site.

 

As stated earlier for the same request: I cannot do that as the sub-design does not permit it in an easy way. Empty trays are simply marked as a number and nothing else and currently I won't add a second layer of empty number as it might conflict and corrupt existing databases.

Link to comment
1 minute ago, olehj said:

As stated earlier for the same request: I cannot do that as the sub-design does not permit it in an easy way. Empty trays are simply marked as a number and nothing else and currently I won't add a second layer of empty number as it might conflict and corrupt existing databases.

Okay thanks for the explanation.  This is a useful plugin, thanks very much for your efforts!

Link to comment
  • 2 weeks later...

I've set this up and I didn't have any problems except that my Samsung NVME cache drive isn't showing up at all.

 

I'm not super linux friendly, but I did dig through the thread looking for anyone else with this problem. I saw someone running the command "lsscsi -u -g"

but when I do that, my NVME drive isn't shown at all. I can see 4 HDD's from my onboard controller, and 2 other HDD's from my External controller, and my Flash Drive is also visible (sg0). But not the NVME drive (pardon the silly obfuscation)

:~# lsscsi -u -g
[0:0:0:0]    disk    none                              /dev/sda   /dev/sg0
[1:0:0:0]    disk    500xxxxxxaf48d06                  /dev/sdd   /dev/sg3
[2:0:0:0]    disk    500xxxxxx2d2cedb                  /dev/sde   /dev/sg4
[3:0:0:0]    disk    500xxxxxx2da8bbe                  /dev/sdf   /dev/sg5
[4:0:0:0]    disk    500xxxxxx7286f91                  /dev/sdg   /dev/sg6
[10:0:0:0]   disk    500xxxxxx6e9b2d7                  /dev/sdb   /dev/sg1
[10:0:1:0]   disk    500xxxxxx664e6dc                  /dev/sdc   /dev/sg2

However running "fdisk -l" I can see it here:

Disk /dev/nvme0n1: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: Samsung SSD 970 EVO 1TB
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000

Device         Boot Start        End    Sectors   Size Id Type
/dev/nvme0n1p1         64 1953525167 1953525104 931.5G 83 Linux

Any ideas on how I can get it to show up? Is there any further information that would be useful to share?

Edited by Chunks
improved wording
Link to comment
3 hours ago, Chunks said:

I've set this up and I didn't have any problems except that my Samsung NVME cache drive isn't showing up at all.

 

I'm not super linux friendly, but I did dig through the thread looking for anyone else with this problem. I saw someone running the command "lsscsi -u -g"

but when I do that, my NVME drive isn't shown at all. I can see 4 HDD's from my onboard controller, and 2 other HDD's from my External controller, and my Flash Drive is also visible (sg0). But not the NVME drive (pardon the silly obfuscation)

However running "fdisk -l" I can see it here:

Any ideas on how I can get it to show up? Is there any further information that would be useful to share?

 

NVME drives are likely not supported at all at this moment and I dunno if or when it will be. M.2 SATA drives would likely work (or running them as SATA from BIOS, but don't do that as that would be rather pointless).

The value of listing these drives anyway are probably rather small as they are mainly directly attached to the motherboard - and rarely more than 2 (in use anyway).

It might be a task for the future if these drives comes down to a storage value level, but the importance of replacing a faulty drive is rather more important with the main Unraid array (not cache) and other Raid arrays.

Maybe in the future, and it would rather be a part of Design v2.0 which isn't even in the works. Right now this plugin is too dependent on output from "lsscsi"

  • Like 1
Link to comment
55 minutes ago, olehj said:

Maybe in the future, and it would rather be a part of Design v2.0 which isn't even in the works. Right now this plugin is too dependent on output from "lsscsi"

I completely understand. I was so focused on filling everything out, I kind of forgot the point of the plugin. What you said definitely makes sense.

 

Thanks again though, as I said, everything else works perfectly.

Link to comment
  • 1 month later...

Update 2019.04.29

  • Commit #65 - MINOR ISSUE: Checks an array before counting it. Issue appeared if no empty trays were available.
  • Removed disklocation.plg file: use disklocation-master.plg instead.

NB! If you don't receive this update, be sure you have installed this plugin with the correct file mentioned above. If you installed this via the Community Application plugin, then there's nothing to do. If you use the old file, uninstall the plugin and reinstall it again with the correct file. The old file has been deprecated for a while now.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.