Jump to content
olehj

[PLUGIN] Disk Location

445 posts in this topic Last Reply

Recommended Posts

1 hour ago, PeterB said:

Something odd has happened to my colour picker and I'm not sure what/why or how to resolve it.

 

You have the same colour for unassigned and data drives. The colour picker always list the chosen colours first and in this row from the left: parity, data, cache, unassigned, empty. The extra two added ones are the default colours for data and cache (which is replaced by your custom colour). The behavior is expected :) 

Share this post


Link to post

Update 2020.02.19

  • Commit #124 - MINOR ISSUE/IMPROVEMENT: Added a "Reset All Color" button with following informative text to clarify the coloring of devices.

Share this post


Link to post
On 2/6/2020 at 9:47 AM, olehj said:

You have the same colour for unassigned and data drives. The colour picker always list the chosen colours first and in this row from the left: parity, data, cache, unassigned, empty. The extra two added ones are the default colours for data and cache (which is replaced by your custom colour). The behavior is expected :) 

But my Data drives are shown in a darker blue, and this colour doesn't appear in the picker.

Screenshot from 2020-02-21 08-03-33.png

Share this post


Link to post
1 hour ago, PeterB said:

But my Data drives are shown in a darker blue, and this colour doesn't appear in the picker.

Screenshot from 2020-02-21 08-03-33.png

Where? Under "Configuration" you should, under "Tray Allocation" you shouldn't.

 

The point is that it shouldn't mix up Unraid assigned devices with unassigned, but you can still manually force a custom color. Unless you choose the default colors specified under "Configuration". If you choose any color specified under "Configuration" in "custom color" it will reset like choosing "Gray/Empty" color.

Share this post


Link to post

Hey @olehj

 

What exactly is being written to the SQLite db every hour?  Considering that the db is being stored on the flash drive, is it really necessary to update it every hour if nothing changes in the setup of the server?

Share this post


Link to post
12 minutes ago, pluginCop said:

Hey @olehj

 

What exactly is being written to the SQLite db every hour?  Considering that the db is being stored on the flash drive, is it really necessary to update it every hour if nothing changes in the setup of the server?

It updates the SMART data so you'll get the feedback if it reports a SMART error, and also simply updates the "power on hours" etc. The writes are so minor that I wouldn't worry about the flash device.

 

Earlier it was only accessed when you entered the plugin, but that made it quite slow to load and would've been a pain for the dashboard plugin as well.

 

I can of course consider make an option to disable update writes, but then features will be lost, or simply add a custom update time.

Share this post


Link to post
41 minutes ago, olehj said:

I can of course consider make an option to disable update writes, but then features will be lost, or simply add a custom update time.

This^^^ because the feedback from SMART would be an overlap from the built-in SMART monitoring unless the plugin is doing something else.

 

The amount of writes varies quite wildly.  If I set up the plugin with all my drives (24), if they are all spinning, then there is ~300 writes per hour (2.6M / year) according to the dashboard.  If they're all spun down, that drops to ~20/hr

 

 

 

(under my test it would have been ~64,000 over the 9 days)

 

 

 

 

Share this post


Link to post
49 minutes ago, pluginCop said:

This^^^ because the feedback from SMART would be an overlap from the built-in SMART monitoring unless the plugin is doing something else.

 

The amount of writes varies quite wildly.  If I set up the plugin with all my drives (24), if they are all spinning, then there is ~300 writes per hour (2.6M / year) according to the dashboard.  If they're all spun down, that drops to ~20/hr

 

(under my test it would have been ~64,000 over the 9 days)

 

Alright, I'll make two additional features for the future:

1) Adjustable cron times, will probably keep it at disabled, 1 hour, 24 hours, weekly, and monthly.

2) Movable database to another device

 

Or I might consider digging through Unraids lack of documentation to implement their own SMART data into the plugin, meaning less writes to the database (maybe even none during normal operation).

 

Never thought about how much it can actually write, really.

 

Temporary workaround to disable it: rm /etc/cron.hourly/disklocation.sh

NB! This WILL leave SMART data for the plugin static/old and all changes for the system must be run by "Force scan all"

Share this post


Link to post
15 minutes ago, olehj said:

 

Alright, I'll make two additional features for the future:

1) Adjustable cron times, will probably keep it at disabled, 1 hour, 24 hours, weekly, and monthly.

2) Movable database to another device

 

Or I might consider digging through Unraids lack of documentation to implement their own SMART data into the plugin, meaning less writes to the database (maybe even none during normal operation).

 

Never thought about how much it can actually write, really.

 

Temporary workaround to disable it: rm /etc/cron.hourly/disklocation.sh

NB! This WILL leave SMART data for the plugin static/old and all changes for the system must be run by "Force scan all"

I've had 2 USB stick failures in less than 12 months, the first one I was surprised at after 5 months, but just put it down to bad luck.  Then I had another one at the next 5 month interval, this then made me very nervous, I had to contact support to get them to issue the new key as I'd gone through my "grace keys".

When I saw 29000 and then 35000 writes after 7 days I got very nervous again and this was when I decided to try and find out what was the root cause which I eventually tracked down to this Plugin.  I've removed it now, I wasn't really using it anyway, but that volume of writes is not good!

 

Surely this is something that can just be stored in ram and then only written to USB on an array stop or shutdown.  Unscheduled shutdowns (power loss, kernel panic) are tough luck.

Share this post


Link to post
32 minutes ago, Fizzyade said:

I've had 2 USB stick failures in less than 12 months, the first one I was surprised at after 5 months, but just put it down to bad luck.  Then I had another one at the next 5 month interval, this then made me very nervous, I had to contact support to get them to issue the new key as I'd gone through my "grace keys".

When I saw 29000 and then 35000 writes after 7 days I got very nervous again and this was when I decided to try and find out what was the root cause which I eventually tracked down to this Plugin.  I've removed it now, I wasn't really using it anyway, but that volume of writes is not good!

 

Surely this is something that can just be stored in ram and then only written to USB on an array stop or shutdown.  Unscheduled shutdowns (power loss, kernel panic) are tough luck.

I for sure won't do the RAM approach, but the other options I gave should eliminate the problem. I have myself ran this without issue since the cronjob was added, I run on a Kingston USB 3.0 DataTraveler 50 32GB. I expect you might have a device with less storage? For curiosity only, I will still fix the problem one way or the other.

Share this post


Link to post
6 minutes ago, olehj said:

I for sure won't do the RAM approach, but the other options I gave should eliminate the problem. I have myself ran this without issue since the cronjob was added, I run on a Kingston USB 3.0 DataTraveler 50 32GB. I expect you might have a device with less storage? For curiosity only, I will still fix the problem one way or the other.

Both were 64GB Sandisk UltraFit drives.

Share this post


Link to post

Update 2020.02.23

  • Commit #127 - MAJOR ISSUE: Disk Location uses a cronjob for storing data in a database file located at the flash device, and an hourly cronjob might have exhausted some flash devices. A new setting is available where the default is now set as "Disabled", however, "Daily" (and longer periods) should still be quite safe to use. It's stored on the flash device because the database contain information about old devices as well, which is neat in case of a major device failure and you just wanna know how long it lasted.

Everybody is strongly encourage to upgrade ASAP!

 

Also: please use the inline Help function for more information - it works!

 

People with Unraid earlier than 6.7.1 should upgrade using the development branch (or simply update your Unraid altogether). I hope it's none.

Edited by olehj
Inline help

Share this post


Link to post
On 2/21/2020 at 9:23 AM, olehj said:

Where? Under "Configuration" you should, under "Tray Allocation" you shouldn't.

 

The point is that it shouldn't mix up Unraid assigned devices with unassigned, but you can still manually force a custom color. Unless you choose the default colors specified under "Configuration". If you choose any color specified under "Configuration" in "custom color" it will reset like choosing "Gray/Empty" color.

I have been selecting default colours, I have clicked the reset button, and the machine has been rebooted.  What else can I do to gain control over the colours?

 

See attached screenshot. Disks 1-8 are data drives, Drive 12 is unassigned (used for docker).

Screenshot from 2020-02-27 18-14-06.png

Share this post


Link to post
7 hours ago, PeterB said:

I have been selecting default colours, I have clicked the reset button, and the machine has been rebooted.  What else can I do to gain control over the colours?

 

See attached screenshot. Disks 1-8 are data drives, Drive 12 is unassigned (used for docker).

 

Screenshot_20200227_184435.png.eb6bdb8c5e3a4d44e7838ec676c1ca15.png

 

-This- reset button?

Share this post


Link to post
36 minutes ago, klipp01 said:

I am getting sqllite errors after installing plugin.

 

 

disk location Capture.JPG

Looks like a php comment section was accidentally pasted  into a SQL creation variable. Will fix asap.

Share this post


Link to post

Update 2020.02.28

  • Commit #131 - BUG: A php comment section was accidentally pasted into an SQL creation variable, causing an update to fail (affected version: 2020.02.23).
  • Commit #127 - MAJOR ISSUE: Disk Location uses a cronjob for storing data in a database file located at the flash device, and an hourly cronjob might have exhausted some flash devices. A new setting is available where the default is now set as "Disabled", however, "Daily" (and longer periods) should still be quite safe to use. It's stored on the flash device because the database contain information about old devices as well, which is neat in case of a major device failure and you just wanna know how long it lasted.

Everybody is strongly encourage to upgrade ASAP!

 

Also: please use the inline Help function for more information - it works!

 

People with Unraid earlier than 6.7.1 should upgrade using the development branch (or simply update your Unraid altogether). I hope it's none.

Share this post


Link to post
14 minutes ago, olehj said:

Looks like a php comment section was accidentally pasted  into a SQL creation variable. Will fix asap.

Actually fixed it by powering down and renaming the disk location folder that still had some database files after removing plugin. Rebooted and reinstalled plugin and it is working great now.

Share this post


Link to post
Just now, klipp01 said:

Actually fixed it by powering down and renaming the disk location folder that still had some database files after removing plugin. Rebooted and reinstalled plugin and it is working great now.

Guess you reached pulling the new update ;) 

Share this post


Link to post
14 hours ago, olehj said:

 

 

-This- reset button?

Ah, that was just off the bottom of my browser window.  Okay, that has done the trick - thanks.

Share this post


Link to post

Update 2020.03.02

  • Commit #133 - IMPROVEMENT: Removed the "Reset" buttons as they make people confused about its function. They only resetted the changed input in forms, pure html reset.

Share this post


Link to post

Fantastic plug in ! I've got 36 bays and it's a nightmware when 1 drive goes down. Which one is it now!?

 

Oddly enough, it isn't seeing 3 drives in my array.  I'm assuming the "delete flag" on the drives is enabled. Can I modify the DB myself and remove this flag without running through all the manual assignments again?

 

Share this post


Link to post
Posted (edited)
3 hours ago, mistah said:

Fantastic plug in ! I've got 36 bays and it's a nightmware when 1 drive goes down. Which one is it now!?

 

Oddly enough, it isn't seeing 3 drives in my array.  I'm assuming the "delete flag" on the drives is enabled. Can I modify the DB myself and remove this flag without running through all the manual assignments again?

 

If you are sure you have flagged it for deletion earlier, then yes it is possible. But you should rather know some SQL basics.

 

Make sure you have ran the "Force Scan All" button first, I don't remember if that will re-add it if it is found or if it's completely ignored because of the flag.

 

SQL:

First, backup the entire database:

cp /boot/config/plugins/disklocation/disklocation.sqlite /boot/config/plugins/disklocation/disklocation.bak

To check for the deletion flag (if nothing is listed the flag does not exist and there's nothing more you can do here):

sqlite3 /boot/config/plugins/disklocation/disklocation.sqlite "select device,devicenode,model_family,model_name,status,hash from disks where status='d';"

To undelete a specific device, type this and copypaste the HASH from the list to be undeleted (do not include < >), this will put the device under "Devices not found or removed" under the "Drives" tab, where you can add or delete it manually from the list:

sqlite3 /boot/config/plugins/disklocation/disklocation.sqlite "update disks set status='r' where hash='<INSERT HASH HERE>';"

Option 2) To undelete all devices (I might add this to a function later)

Button added under "System"

 

Finally you wanna run "Force Scan All" to make sure it detects the devices.

Edited by olehj
Added a function in the new update

Share this post


Link to post
Posted (edited)

Update 2020.03.03 (probably 3rd somewhere in the world already)

  • Commit #136 - IMPROVEMENT: Added help text for the "System" tab (also renamed the tab from "System Files").
  • Commit #135 - FEATURE: Added an "Undelete" button under "System" tab for undeleting manually deleted devices.

@mistah ..or you can use this new function when you update the plugin 😛

 

The buttons under "System" are only available when it's possible to use them, otherwise hidden if there's nothing to do.

Edited by olehj

Share this post


Link to post

I am using this to show my drive locations on the dashboard, works great, but I want them to be a nice sized with, like this 800x140 for example, the problem is, with this set at this size, it makes the info page HUGE 

 

Can we make these two values separated somewhere, or unrelated? Right now they appear linked somehow.

 

 

 

image.png.3115bcd512b3e5c50235c030ac1f103c.png

 

image.thumb.png.9cbed4440a3ab78e89b8706c67c9aa29.png

Share this post


Link to post
34 minutes ago, CorneliousJD said:

I am using this to show my drive locations on the dashboard, works great, but I want them to be a nice sized with, like this 800x140 for example, the problem is, with this set at this size, it makes the info page HUGE 

 

Can we make these two values separated somewhere, or unrelated? Right now they appear linked somehow.

They are directly related by a factor of 10x the size. The idea is that you should adjust the size of the "Devices" page, and not the "Layout" display.

Share this post


Link to post

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.