Menu

Mount one volume ID from 2 possibilities by command line

ragnolor
2017-07-09
2017-07-11
  • ragnolor

    ragnolor - 2017-07-09

    Hi,

    I have this situation: 2 HDD (encrypted) will be used to do weekly backups. They will take turns like this: first week is HDD A, second week HDD B, third week HDD A again, and so on...

    What I need is a VeraCrypt command line to include the two devices IDs and if the first ID is not phisically connected it go ahead and try the next volume ID:

    Supposing \?\Volume{ID.of.HDD.weekB is the currently connected device ID on the server:

    veracrypt.exe /volume \?\Volume{ID.of.HDD.weekA}\ /letter h /password "123456" - and VeraCrypt says.."ok, this one is not connected.. trying the next volume.."

    veracrypt.exe /volume \?\Volume{ID.of.HDD.weekB}\ /letter h /password "123456" - and then the volume is successfully mounted!

    Is this possible?

     
  • Adrian Kentleton

    Which version of Veracrypt are you running?

     
  • ragnolor

    ragnolor - 2017-07-10

    1.21 RC4

     
  • Adrian Kentleton

    I don't see how you could do it with one command line, but a simple batch file eg 'mount.bat' could do it:

    @echo off
    if exist \\?\Volume{YourVolA}\ goto mount1
    veracrypt /v \\?\Volume{YourVolB}\ YourOptionsB
    goto end
    :mount1
    veracrypt /v \\?\Volume{YourVolA}\ YourOptionsA
    :end
    exit
    

    Are you familiar with batch files? It's just a series of command lines in a plain text file, with .bat extension. Can provide a bit more info if needed.

    If I were writing such a file, I'd make it a bit more complicated, to build in error checking, success messages etc, but the code snippet above would do the basic job.

     

    Last edit: Adrian Kentleton 2017-07-10
  • ragnolor

    ragnolor - 2017-07-11

    Thank you Adrian, tryed your script and worked like a charm!

     

Log in to post a comment.

MongoDB Logo MongoDB