[PLUGIN] Disk Location


Recommended Posts

Had the same happen to me.  Server hung on a line saying that it could not open file /boot/config/plugins/disklocation/disklocation.conf:  No such file or directory... 

- I booted into safe mode

- started the array

- installed the plugin from the link listed on the first page

- I then went into the plugin and to the System tab

- under System clicked on Force Update All.  It then created the missing conf file. 

- I rebooted the server and the error was gone and it booted normal.20240321_025551.thumb.jpg.63a7d776b803dd1b632014b4dc46f428.jpg

Link to comment
Posted (edited)

Update 2024.03.21b

  • b) Fixed a minor issue when fixing #309 below.
  • Commit #309 - BUG: If the disklocation.conf wasn't created (which is expected in some cases), the recent install scripts would fail. Now it will check if that file exists before it tries to pull out information from it, otherwise use default location of the database.
  • Commit #307 - ISSUE: Yet again changed a bit of the javascript based upon information from warwolf7 (I hate javascript).

 

This should fix the issues during boot of the server, did not know it would stall the entire server if a plugin install would fail. However, deleting the "disklocation" folder should almost never be necessary and will also delete the database and backups created. Deleting the .plg file would be enough in this case. You can always restore them from an Unraid backup, if you have, you should have...

 

The javascript change is minor and I could not get @warwolf7 line working, so instead did a simple "-1" in the loop to skip the empty array. I hate javascript.

Edited by FlamongOle
Link to comment
4 hours ago, FlamongOle said:

Update 2024.03.21b

  • b) Fixed a minor issue when fixing #309 below.
  • Commit #309 - BUG: If the disklocation.conf wasn't created (which is expected in some cases), the recent install scripts would fail. Now it will check if that file exists before it tries to pull out information from it, otherwise use default location of the database.
  • Commit #307 - ISSUE: Yet again changed a bit of the javascript based upon information from warwolf7 (I hate javascript).

 

This should fix the issues during boot of the server, did not know it would stall the entire server if a plugin install would fail. However, deleting the "disklocation" folder should almost never be necessary and will also delete the database and backups created. Deleting the .plg file would be enough in this case. You can always restore them from an Unraid backup, if you have, you should have...

 

The javascript change is minor and I could not get @warwolf7 line working, so instead did a simple "-1" in the loop to skip the empty array. I hate javascript.

Thank you for that change but I get the same error. 

 

Your "for" code version 2024.03.20 incremented from 0 to 20 (21 disks)
Your "for" code version 2024.03.20 incremented from 0 to 19 (20 disks), but I only have 19 assigned disks in the visualiser. 

 

This part 

i < y.length - 1

takes into account the entire drive list, while th code inside take action on 2 different object list. It takes an action on the entire drive list and on the preview above that might not contain the entire list. Because this line :
 

document.getElementById("bg3-" + y[i].id).classList.remove('flex-container-locate');


is the disk location preview above the page. This one only contains allocated disk therefore does not contains  the same element that this array return: 

document.getElementsByClassName(locateDisk);
because that array, contains the entire list of drives, allocated and non allocated, in my case 19+2
While the preview contains only the allocated drive (19)

You either need to create a new "for" loop just the the preview above or another way.

 

This works for me
 

function locateKillAll(locateDisk){
$x("//div[starts-with(@id, 'bg3-')]").forEach(el=>{el.classList.remove('flex-container-locate')})
$x("//div[@id='" + locateDisk + "']").forEach(el=>{
    el.value = "Locate"
    el.style.backgroundColor = "#F2F2F2"
})
	$.get('/plugins/disklocation/pages/locate.php',{ cmd:"killall"},function(data) {});
}

function locateStart(locateDisk){
	if(locateDisk) {
		locateDisk.value = "Stop";
		locateDisk.style.backgroundColor = "#020202";
		var diskpath = encodeURI(locateDisk.id);
		$.get('/plugins/disklocation/pages/locate.php',{ disklocation:diskpath, cmd:"start"},function(data) {});
		$x("//div[starts-with(@id, 'bg3-')]").forEach(el=>{el.classList.remove('flex-container-locate')}) //this also need to be changed
	}
}

or if you can't get the xpath thing to work
you can add a try catch arround the problematic lines like this (I didnt put anything in the catch brackets but you could add some error handling code if needed)
 

function locateStart(locateDisk){
	if(locateDisk) {
		locateDisk.value = "Stop";
		locateDisk.style.backgroundColor = "#020202";
		var diskpath = encodeURI(locateDisk.id);
		$.get('/plugins/disklocation/pages/locate.php',{ disklocation:diskpath, cmd:"start"},function(data) {});
		try{document.getElementById("bg3-" + diskpath).classList.add('flex-container-locate');}catch(){}
	}
}



function locateKillAll(locateDisk){
	var y = document.getElementsByClassName(locateDisk);
	var i;
	for (i = 0; i < y.length - 1; i++) {
		y[i].value = "Locate";
		y[i].style.backgroundColor = "#F2F2F2";
		try{document.getElementById("bg3-" + y[i].id).classList.remove('flex-container-locate');}catch(){}
	}
	$.get('/plugins/disklocation/pages/locate.php',{ cmd:"killall"},function(data) {});
}

I hope this helps

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

Thank you for that change but I get the same error. 

 

Your "for" code version 2024.03.20 incremented from 0 to 20 (21 disks)
Your "for" code version 2024.03.20 incremented from 0 to 19 (20 disks), but I only have 19 assigned disks in the visualiser. 

 

This part 

i < y.length - 1

takes into account the entire drive list, while th code inside take action on 2 different object list. It takes an action on the entire drive list and on the preview above that might not contain the entire list. Because this line :
 

document.getElementById("bg3-" + y[i].id).classList.remove('flex-container-locate');


is the disk location preview above the page. This one only contains allocated disk therefore does not contains  the same element that this array return: 

document.getElementsByClassName(locateDisk);
because that array, contains the entire list of drives, allocated and non allocated, in my case 19+2
While the preview contains only the allocated drive (19)

You either need to create a new "for" loop just the the preview above or another way.

 

This works for me
 

or if you can't get the xpath thing to work
you can add a try catch arround the problematic lines like this (I didnt put anything in the catch brackets but you could add some error handling code if needed)
 

I hope this helps

 

I tried both, and things around it, but whatever I did, it would not start the locate script, nor the blinking of the disk visualization. Next release will revert the "-1" change, as it wont accept "Stop" click on the last device. Also cleaned up where the script was loaded twice in different positions. But it won't change your error code, which I don't seem to get myself.

 

For curiosity, which browser do you use? It works without problem on Chrome, Vivaldi, Firefox for me.

Link to comment
4 hours ago, FlamongOle said:

 

I tried both, and things around it, but whatever I did, it would not start the locate script, nor the blinking of the disk visualization. Next release will revert the "-1" change, as it wont accept "Stop" click on the last device. Also cleaned up where the script was loaded twice in different positions. But it won't change your error code, which I don't seem to get myself.

 

For curiosity, which browser do you use? It works without problem on Chrome, Vivaldi, Firefox for me.

Do you have non allocated drive (unassigned devices) when you test? That's when I get the problem. If all disk are assigned to a location I don't have the problem, but logically, I can't assigned them a location if I can't get them to blink first (thats why your plugin is so useful). I have the same problem in firefox, edge, chrome 122.0.6261.95 (Official Build) (64-bit). It's not the browser. It very clear in the code. The code tries to remove a class in an object that doesn't exist in the tray preview at the top. The top tray preview only contains assigned drive. While your code remove class from every drive even the ones that are not assigned. That doesn't work because unassigned drive are not present in the top tray preview. If the object doesn't exist, you can't remove a class. Therefore you get an error telling that you can't read property of null because the selector refers to a non existent element.

 

unraid.png

 

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

Do you have non allocated drive (unassigned devices) when you test? That's when I get the problem. If all disk are assigned to a location I don't have the problem, but logically, I can't assigned them a location if I can't get them to blink first (thats why your plugin is so useful). I have the same problem in firefox, edge, chrome 122.0.6261.95 (Official Build) (64-bit). It's not the browser. It very clear in the code. The code tries to remove a class in an object that doesn't exist in the tray preview at the top. The top tray preview only contains assigned drive. While your code remove class from every drive even the ones that are not assigned. That doesn't work because unassigned drive are not present in the top tray preview. If the object doesn't exist, you can't remove a class. Therefore you get an error telling that you can't read property of null because the selector refers to a non existent element.

 

unraid.png

 

Aha, Ill have another look tomorrow or so

  • Like 1
Link to comment

Update 2024.03.22

  • Commit #307 - MINOR: Just a minor cleanup in the javascript handling and code of the Locate script. Added also a check if the device is assigned or unassigned so that the Locate works if there's unassigned devices in the list, which is kind of the point. Thanks to @warwolf7 who patiently explained the situation well enough for me to finally get the problem ;)
Link to comment
4 hours ago, dopeytree said:

Minor.

 

Few updates ago introduced a change that shows drives as being spun up when they are idle / spun down. 

 

Should be no change with that. Idle is the same as active, disk spinning. Standby is spun down.

 

It won't show instantly if it's spun up or down as it might take up to 5 minutes to gather new data. And that is a recent intended change. 

 

This plugin works semi-independent of Unraid disk statuses. 

Link to comment
17 hours ago, dopeytree said:

Minor.

 

Few updates ago introduced a change that shows drives as being spun up when they are idle / spun down. 

 

 

13 hours ago, FlamongOle said:

Should be no change with that. Idle is the same as active, disk spinning. Standby is spun down.

 

It won't show instantly if it's spun up or down as it might take up to 5 minutes to gather new data. And that is a recent intended change. 

 

This plugin works semi-independent of Unraid disk statuses. 

 

Just to add some more here, if it's under ZFS filesystem, it won't see it as it uses info from the zpool status. I must be under Unraid array.

Link to comment

Hi @FlamongOle thank you for this amazing plugin.

I've updated recently and I encountered that now there are S.M.A.R.T warnings as a feature, that's nice, the problem is that one of my disk is flashing because it has 2 uncorrectable errors but I have it acknoledged in unraid because those two errors occurred years ago and they don't increase, so I'm good with them.

The thing is that I want to use this feature for this disk and also the others, but I see that there is no specific setting, I would have to disable all warnings or increase the global limit but that's a bad solution.

Am I missing something?

Thank you!

  • Thanks 1
Link to comment
17 hours ago, Monetary5569 said:

Hi @FlamongOle thank you for this amazing plugin.

I've updated recently and I encountered that now there are S.M.A.R.T warnings as a feature, that's nice, the problem is that one of my disk is flashing because it has 2 uncorrectable errors but I have it acknoledged in unraid because those two errors occurred years ago and they don't increase, so I'm good with them.

The thing is that I want to use this feature for this disk and also the others, but I see that there is no specific setting, I would have to disable all warnings or increase the global limit but that's a bad solution.

Am I missing something?

Thank you!

Currently no. Your observation is correct. For now you can still increase the global to have it like "worst case scenario" if it bothers you. I might look into Unraids settings and use those directly at a alter point.

Link to comment
On 3/28/2024 at 12:41 PM, FlamongOle said:

Currently no. Your observation is correct. For now you can still increase the global to have it like "worst case scenario" if it bothers you. I might look into Unraids settings and use those directly at a alter point.

Ok, understood!

 

I think that using unraid settings for the warnings could be a very nice idea.

Thanks for the reply!
 

Link to comment
  • 2 weeks later...

Had a disk fail. 

Used this plugin to locate drive.

Then added 2x new drives in spare bays then rebooted.

For some reason it has messed up the disk location database. 

 

Its labelling some drives as cache (I do no use the term cache) I have a luna, merlin & cctv pools.

 

Also why is it putting unassigned drives into the allocated bays?

 

odd.

 

Parity should be upper left corner.

There are only 4x merlin drives. It is saying there are more but putting them in cache...

 

Screenshot 2024-04-08 at 16.05.28.png

Screenshot 2024-04-08 at 16.05.33.png

moulin-rouge-diagnostics-20240408-1611.zip moulin-rouge-diagnostics-20240408-1512.zip

Edited by dopeytree
Link to comment
5 hours ago, dopeytree said:

Had a disk fail. 

Used this plugin to locate drive.

Then added 2x new drives in spare bays then rebooted.

For some reason it has messed up the disk location database. 

 

Its labelling some drives as cache (I do no use the term cache) I have a luna, merlin & cctv pools.

 

Also why is it putting unassigned drives into the allocated bays?

 

odd.

 

Parity should be upper left corner.

There are only 4x merlin drives. It is saying there are more but putting them in cache...

 

If the first name is either "Parity, Data or Cache", it is detected as a traditional Unraid pool. If it just has a name like "Luna" and "Merlin", it is detected as ZFS pools. "Cache: merlin*" and "Merlin" is not the same pool (or at least it shouldn't be).

 

Unassigned devices is only added if you add them there, for all I know, adding the new drives in the wrong slots might have caused this. Not sure how it would change anything otherwise. The serialized modelname+serialnumbers string are assigned to a drive slot (TrayID), and would not be moved anyhow by itself.

 

There has been modifications on how to prioritize the differnt pools, as for now the ZFS pools is sort of above the traditional Unraid array. It might be time to end the "traditional Unraid" way of labeling as they now allow for multiple pools etc. which was not a thing "back in the days." I haven't made up my mind what would be the best option here. There's more things to be updated and considered for this at this point.

Link to comment

I had a squiz at this plugin, and decided to remove it.  When i did so, it advised:

 

Quote

Plugin stopped and removed, package files removed from /boot/config/plugins/disklocation, database, settings and the backups are not removed.

 

Do i just delete the disklocation directory manually to fully remove it?

Edited by Derek_
Link to comment
14 hours ago, Derek_ said:

I had a squiz at this plugin, and decided to remove it.  When i did so, it advised:

 

 

Do i just delete the disklocation directory manually to fully remove it?

 

Yes, disklocation and disclocation-master/devel if it exists.

  • Thanks 1
Link to comment
On 4/14/2024 at 2:11 AM, bmartino1 said:

cron errors with plugins. can someone double check?
 

 

 

I run Unraid 6.12.9 and don't notice any errors with the cronjob. The first post mention "corrupted size vs prev_size", this has nothing to do with Disk Location.

 

You can always try to run the cron manually, either:

/etc/cron.hourly/disklocation.sh

 

or to get output:

php /usr/local/emhttp/plugins/disklocation/pages/cron_disklocation.php cronjob

 

Link to comment
On 4/13/2024 at 7:11 PM, bmartino1 said:

cron errors with plugins. can someone double check?
 

 

 

Bless you for bringing my troubles over here... I didn't even think to do it, I just thought it might be a general Unraid issue with cron.

Link to comment
10 hours ago, FlamongOle said:

 

I run Unraid 6.12.9 and don't notice any errors with the cronjob. The first post mention "corrupted size vs prev_size", this has nothing to do with Disk Location.

 

You can always try to run the cron manually, either:

/etc/cron.hourly/disklocation.sh

 

or to get output:

php /usr/local/emhttp/plugins/disklocation/pages/cron_disklocation.php cronjob

 

 

Yeah, I just ran those commands manually and this is what I got:

 

2088572835_Screenshot2024-04-15165435.png.11d5782179593eb6a78e9f9482190c18.png

 

So, it would appear to be an issue with one of my SSDs, not with Disk Location (though it was trying to clue me into the ultimate issue); the Main tab shows no errors with the drive, but, when I tried to run a SMART short self-test, the status goes from 10% right to 90%, then shows this:

 

1824319344_Screenshot2024-04-15165824.png.92d83cd978e83ecd2f037ff8d11f64c2.png

 

but, the SMART report shows this:

 

Quote

smartctl 7.4 2023-08-01 r5530 [x86_64-linux-6.1.79-Unraid] (local build)
Copyright (C) 2002-23, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Number:                       TEAM TM8FP4004T
Serial Number:                      112307250490941
Firmware Version:                   VB421D65
PCI Vendor/Subsystem ID:            0x10ec
IEEE OUI Identifier:                0x00e04c
Controller ID:                      1
NVMe Version:                       1.3
Number of Namespaces:               1
Namespace 1 Size/Capacity:          4,096,805,658,624 [4.09 TB]
Namespace 1 Formatted LBA Size:     512
Local Time is:                      Mon Apr 15 16:52:58 2024 CDT
Firmware Updates (0x02):            1 Slot
Optional Admin Commands (0x0017):   Security Format Frmw_DL Self_Test
Optional NVM Commands (0x0014):     DS_Mngmt Sav/Sel_Feat
Log Page Attributes (0x02):         Cmd_Eff_Lg
Maximum Data Transfer Size:         32 Pages
Warning  Comp. Temp. Threshold:     100 Celsius
Critical Comp. Temp. Threshold:     110 Celsius

Supported Power States
St Op     Max   Active     Idle   RL RT WL WT  Ent_Lat  Ex_Lat
 0 +     8.00W       -        -    0  0  0  0   230000   50000
 1 +     4.00W       -        -    1  1  1  1     4000   50000
 2 +     3.00W       -        -    2  2  2  2     4000  250000
 3 -     0.50W       -        -    3  3  3  3     4000    8000
 4 -   0.0090W       -        -    4  4  4  4     8000   30000

Supported LBA Sizes (NSID 0x1)
Id Fmt  Data  Metadt  Rel_Perf
 0 +     512       0         0

=== START OF SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

SMART/Health Information (NVMe Log 0x02)
Critical Warning:                   0x00
Temperature:                        38 Celsius
Available Spare:                    100%
Available Spare Threshold:          32%
Percentage Used:                    1%
Data Units Read:                    156,003,876 [79.8 TB]
Data Units Written:                 307,575,905 [157 TB]
Host Read Commands:                 1,075,769,987
Host Write Commands:                1,534,800,844
Controller Busy Time:               0
Power Cycles:                       33
Power On Hours:                     4,277
Unsafe Shutdowns:                   15
Media and Data Integrity Errors:    0
Error Information Log Entries:      0
Warning  Comp. Temperature Time:    0
Critical Comp. Temperature Time:    0

Error Information (NVMe Log 0x01, 8 of 8 entries)
No Errors Logged

Self-test Log (NVMe Log 0x06)
Self-test status: No self-test in progress
Num  Test_Description  Status                       Power_on_Hours  Failing_LBA  NSID Seg SCT Code
 0   Short             Completed without error                4277            -     -   -   -    -
 1   Short             Completed without error                4277            -     -   -   -    -

 

Anything I might be able to do, beside replace and RMA?

Edited by TedStriker
Link to comment
Posted (edited)
15 hours ago, TedStriker said:

 

Yeah, I just ran those commands manually and this is what I got:

 

 

 

So, it would appear to be an issue with one of my SSDs, not with Disk Location (though it was trying to clue me into the ultimate issue); the Main tab shows no errors with the drive, but, when I tried to run a SMART short self-test, the status goes from 10% right to 90%, then shows this:

 

 

but, the SMART report shows this:

 

 

Anything I might be able to do, beside replace and RMA?

Do not replace and RMA yet, not sure it's the drive. But to find out, you can try:

smartctl -x --all --json /dev/nvme1n1

 

Edited by FlamongOle
Link to comment

I may be overlooking something but I am not seeing any tabs other than 'Devices' and 'information' I can no longer configure or change any data. The below screen grab shows only the two tabs. Any help would be greatly appreciated.

image.thumb.png.a17dac04519c3be60f485e56d3ae4594.png

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.