Delay Unassigned Devices SMB mount?


Recommended Posts

Hi there,

 

I was wondering if it was possible to delay the SMB Share from the "Unassigned Devices" Plugin?

 

 

Situation:

When in a powerfailure and the UPS is also empty everything goes down. But when the power comes back 2 machines are set to start automatic. 

 

Machine 1(Unraid) boots in about 70 seconds. 

Machine 2(Synology) boots in about 4 minutes or so. 

 

Machine 1 auto-mounts a smb share from Synology on Unraid startup. But when it tries to connect the smb share the Synology is not ready to accept connections yet. 

 

 

So does anyone know how to delay the smb auto-mount?

 

thanks in advance.

Link to comment
7 hours ago, johnvid said:

Situation:

When in a powerfailure and the UPS is also empty everything goes down. But when the power comes back 2 machines are set to start automatic. 

Set the unraid to not automatic start. That way you can confirm everything is ok before you start all the services. It's a very bad idea to run the UPS to empty and immediately start everything back up when power returns. Many times the power will go back out again for a little bit after the first time it comes up, and if the UPS batteries are already drained, there will be no way for it to successfully shut down again, plus it's very hard on the UPS batteries to fully drain them.

 

There are only 2 likely scenarios I can think of, either the power goes out so rarely that waiting for your servers to come back on line isn't going to happen hardly ever, or the power goes out so frequently that you really need to rethink the use of just a battery backup, possibly an inverter with a bank of batteries to allow you to ride them out.

 

Either way, automatic restart after a power outage is a bad idea, you need to evaluate each individual situation before you get everything running again.

Link to comment
  • 2 years later...

Sorry if this is a bit late but it is very possible, you can use the mount command that looks like this for unassigned devices:


mount -t cifs //192.168.0.37/D /mnt/disks -o username=krys,password=*****,dir_mode=0777,file_mode=0777

and then use the user scripts plugin to automate the running of the script. I don't actually know how you can set a delay per se but if you know your reboot schedule then using a custom cron time works just fine. I put my computer to rest every night automatically to save power and setting a cron time 5-10 minutes after the normal boot time works just fine for all my 20-30 docker instances. it annoying that such a simple feature is not available on unraid but this is how i solved my issue with internal vm's hosting thier own smb shares for dockers.  

Edit: running the command over and over again does not cause any harm either so you can just run it every 5 minutes if you really wanted to. not sure if it temporarily breaks storage for dockers but in all the testing i have done the server pics up on whatever it left after a second or two after realizing the storage location is available again. 

Edited by PCwhale
  • Like 1
Link to comment
  • 2 years later...
On 6/26/2019 at 3:21 PM, PCwhale said:

Sorry if this is a bit late but it is very possible, you can use the mount command that looks like this for unassigned devices:


mount -t cifs //192.168.0.37/D /mnt/disks -o username=krys,password=*****,dir_mode=0777,file_mode=0777

and then use the user scripts plugin to automate the running of the script. I don't actually know how you can set a delay per se but if you know your reboot schedule then using a custom cron time works just fine. I put my computer to rest every night automatically to save power and setting a cron time 5-10 minutes after the normal boot time works just fine for all my 20-30 docker instances. it annoying that such a simple feature is not available on unraid but this is how i solved my issue with internal vm's hosting thier own smb shares for dockers.  

Edit: running the command over and over again does not cause any harm either so you can just run it every 5 minutes if you really wanted to. not sure if it temporarily breaks storage for dockers but in all the testing i have done the server pics up on whatever it left after a second or two after realizing the storage location is available again. 

Thank you so much for this solution!

 

For anyone who's looking for and dont know this yet:

 

You can schedule the script to run everytime the array starts, just add 'sleep 180' before your command in the script, to delay 3 minutes after the boot.

Edited by kjames2001
  • Like 1
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.