[Plugin] Remount Flash Drive


Squid

Recommended Posts

Remount Flash Drive

 

This is a simple plugin that will remount your flash drive if it happens to drop offline due to flakey USB ports, flakey drive, evil cats and/or children etc.

 

The OS itself does not recover very gracefully if the flash drive for one reason or another happens to drop offline and then becomes available again.  This plugin will automatically remount the flash drive if that happens, and everything will be back to the way that it was.  It will also automatically run a filesystem check on the flash drive to ensure that everything is good.

 

A call trace when this happens will appear in the system log (completely normal under the circumstances) and then the system will log that it's remounting the flash drive.  At that point your system has completely recovered.

 

Note that there is a situation where the server cannot recover from the flash drive dropping offline.  Namely if the array is stopped.  This is due to how certain files are mounted from the flash drive with the array stopped.  If the array is stopped when the flash drive drops and reconnects, then this plugin will ignore the situation altogether and won't attempt a remount until the array is started and the flash drops and reconnects again.  But, in that circumstance you're probably going to have issues anyways because those files which prevent proper operation of this plugin running won't be correctly written in the first place.  You're best off there to reboot if you notice the problem.

 

Display Glitch:  With the Unassigned Devices plugin installed, the remounted flash will appear in the UD section on Main showing that it's mounted.  DO not unmount it.  This is a display glitch with UD because it thinks that a new drive is installed because Linux automatically assigns a new drive letter to it.  

  • Thanks 2
Link to comment
  • 5 months later...
On 9/6/2021 at 10:41 AM, Squid said:

Display Glitch:  With the Unassigned Devices plugin installed, the remounted flash will appear in the UD section on Main showing that it's mounted.  DO not unmount it.  This is a display glitch with UD because it thinks that a new drive is installed because Linux automatically assigns a new drive letter to it

This isn't an issue for two reasons:

  • UD won't unmount it because it was not mounted by UD at /mnt/disks.
  • A recent update to UD wil recognize the label is 'UNRAID' and will mark the mount button as 'Array' and disable the button.
Link to comment
  • 1 year later...

It doesn't do it every time, but my Samba shares drop out of visibility on my Windows clients after the flash drive remounts.  I do see the smb services restarting after the remount process, is there a command I can run as a stopgap?  Rebooting does reset it

Link to comment
  • 3 weeks later...

Rebooting and restarting the server does reset the Samba visibility, but I have to make sure I catch it before the USB stick drops off again, else I have to go downstairs and restart the whole box.

 

Still drops out of visibility on 6.12 stable, I was hoping the samba updates would take care of this.

Link to comment
  • 1 month later...

This plugin no longer appears to be working with 6.12.2, and I can't keep my USB drive connected long enough to complete a parity check from the previous hard shutdown because the USB drive doesn't stay connected.  The internal updater for 6.12.3 did not take because the USB drive is not seen by the system, so I will manually update and check again.

Link to comment

It still works no problem.

 

As mentioned in the OP, if the array is stopped then the plugin will not remount the drive and as a side effect you also won't be able to start the array with the flash offline.  This is because of a design consideration of the OS and if the plugin attempts a remount then the entire system crashes.

 

The plugin was never meant to be "the end-all, be-all" of if you have this problem, then all your problems will disappear. 

 

Rather its a stop gap solution to keep things more or less running.

 

If you suffer from constant disconnects, then you should use a different port or different device.

Link to comment
  • 6 months later...

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.