Since ransomware is ever evolving, I’m sure there is or will be a variant that can remount an ejected USB drive. A quick Internet search will turn up a couple of ways of doing this without having to power-cycle or physically disconnect/reconnect the drive to the server. It’s also very likely that a person will forget to physically remove the drive and/or reconnect it to the server before the next scheduled backup.
I don’t know if this is overkill or not but I thought I’d share my way of automating the process. Since I’m a novice at best when it comes to scripting, I took the path of least resistance and went with a B&R managed agent backup job rather than attempting to script everything which would be a requirement for a stand-alone, agent managed backup job. With the B&R managed job, you will have the option to specify pre-job and post-job scripts; not to be confused with pre-freeze and post-freeze scripts. This made it a much less daunting task for me since I would not have to figure out how to determine, with scripting, when the backup job finished.
To use the script, you would replace C:\scripts\pre-job.bat with C:\<your path>\usb_drv\drv_status.bat mount and replace C:\scripts\post-job.bat with C:\<your path>\usb_drv\drv_status.bat remove
Requirements:
- Veeam B&R
- USB drive enclosure or dock with external power
- I use the Avastor HDX Pro enclosure but there are many brands to choose from.
- This OWC is a great dock but it will NOT work because it requires you to physically power on/off each HDD, individually.
- Remote power switch
- USB Safely Remove
- The script can be tweaked to use Window’s mountvol, devcon.exe or whatever but I chose to use USB Safely Remove because it also spins down the drive whereas nothing else I tried was capable of doing so.
- INITIAL STATE - The USB drive is always physically attached to the backup server via USB cable but remains powered off.
- The B&R scheduled backup job runs the pre-job script which verifies if the volume is already mounted. If not, it sends a command to the Synaccess to power on the outlet. The backup repository is now available.
- The backup job performs the backup and then runs the post-job script which ejects and spins down the USB drive and finally switches the power outlet off.
Download the scripts (663KB):
Code: Select all
https://mir.cr/GZIIEIAJ
Please feel free to chime in and tell me if this is a waste of time or how you've improved the process or scripts