Jump to content
RESET Forums (homeservershow.com)

Reattaching USB drives on QNAP NAS after ejecting via GUI


Recommended Posts

A while back,    I mentioned in a post that QNAP has a switch in its backup program to allow a USB drive to be ejected  after a backup -     This was a handy way to disconnect a backup, thus protecting it from a ransomware attack.   ( or so I thought)   


I had wondered if there was a way to "reconnect" the drive -  so I wouldnt have to go down to the server and manually turn my backup drives off and on again to reconnect.  couldnt find a way at the time. 


Well  a user on the QNAP community forum found a way,  I came across this post from last fall    -   




Logging in to the NAS via ssh and entering the commands:


echo 0 > /sys/bus/usb/devices/2-1/authorized
echo 1 > /sys/bus/usb/devices/2-1/authorized

makes the "ejected" USB drive reappear just as if it had been unplugged and replugged, including the start of an Auto-Backup job that has been defined for that disk, if any.

Incidentally, this means that an "ejected" USB backup disk is not safe from crypto trojans.
So always disconnect your backup disk physically after running a backup!




I tested it this evening and it works !!        I had to enable SSH logins ,  Not a linux command line guy at all but it worked  1st time I tried it.   I've since disabled SSH logins.   Qnap is linux based so this may work on other systems


The reason I mention this is the caution that he gave at the end.    If a command line newb like me can do this,   a ransomware jockey could easily "wake up"  all the usb drives hooked up and left powered on your NAS.      


For what its worth -  what I have been doing is -     I put the backup drive on  a smart switch ( I use TpLink Kasa).       When I want to backup,  I turn on the drive remotely -  when it is completed and ejected from the system,  I switch it off remotely.   with a incremental backup , this is typically within an couple hours.  


I do a full "offline" backup about once a month -   so I havent gotten around to automating this any further.   -   I guess I could use something like IFTTT or something.   


  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...