The old PGPdisk had the option to mount to a folder on Windows like DFS or Linux.
The VeraCrypt requires to select a free drive letter to mount.
Yes, someone can create a link (by the 'mklink' command) and be happy, but all these used letters still remain in the system as a waste.
👍
1
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You can manually remount a veracrypt volume to a folder path and free the drive letter using mountvol. For instance, if you mounted a VeraCrypt volume to drive letter X: and want it at C:\Mount instead, do the following in cmd:
mkdir C:\Mount mountvol (observe the volume GUID currently assigned to X:) mountvol X: /D (free X:) mountvol C:\Mount \\?\{<Volume GUID>}
X: is now free to be used for other things, except for mounting another VeraCrypt volume to it (the volume bound to C:\Mount still has the device name \Device\VeraCryptVolumeX, which will cause VeraCrypt to fail trying to mount anything to X:)
Note that VeraCrypt will still list the volume as mounted to X: even though it's not. Dismount works normally. The next time you mount this volume with VC, you only need to do step 3 above (free the drive letter), the mount created at step 4 reactivates automatically.
But I definitely second your request. This would be very useful, as currently you need to run a script like the one above to automate such a procedure.
Last edit: neos6464 2018-10-15
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I used mklink /d /j C:\Mount X:\ for the first time only. Then it also remembers specified paths after usual Dismount without new commands. But users worry about waste letters and same content. Once a user had cleaned double data as she thought.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The mountvol sequence above lets you free X: (i.e. it is not wasted, there are no duplicate trees, and from the point of view of the system X: has nothing to do with your encrypted volume anymore).
mklinking to X: obviously does not let you free X:, because as soon as you do, your link is broken
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you for sharing of your nice solution. I understood it. I had just dropped a note for other readers and, I hope, for the author too, for some ideas.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
@neos6464: your idea does not work for me (Windows 7, VC 1.22, 32-bit); whatever I do, I get both a test volume mounted to a drive letter, and a folder (shown as a shortcut), and can read and write to the volume at both locations. That is, the original drive letter allocation is not removed from Windows Explorer.
Inspired by your idea, I wrote a batch script to automate mounting a test volume, as follows:
@echo off
:: Create a variable with mount options
set op0=/q /v F:\testvol /l Z /hash sha512 /p testvol /c n /nowaitdlg /m rm
:: Mount volume using mount options variable
veracrypt %op0%
:: Write GUID into file; read GUID from file into a variable
mountvol Z: /l > F:\testvol.txt
for /f %%a in (F:\testvol.txt) do set op1=%%a
:: Remove the original mount point
mountvol Z: /d
:: Mount to folder using GUID variable, only on first run
if exist F:\firstrun.txt goto skip01
if not exist F:\firstrun.txt echo firstrun > F:\firstrun.txt
mountvol F:\vc1 %op1%
:skip01
echo. & echo Press any key to dismount F:\testvol
pause > nul
veracrypt /d Z /q /f /w /s
exit
What am I doing wrong, please?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Looks like you have to call mountvol Z: /d twice. Not sure why...
Let me know if that works, and thanks for the script - saved me a bit of upcoming work :)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi @neos6464, yes, that sorts it, script now works as expected. So, script now is:
@echo off
:: Create a variable with mount options
set op0=/q /v F:\testvol /l Z /hash sha512 /p testvol /c n /nowaitdlg /m rm
:: Mount volume using mount options variable
veracrypt %op0%
:: Write GUID into file; read GUID from file into a variable
mountvol Z: /l > F:\testvol.txt
for /f %%a in (F:\testvol.txt) do set op1=%%a
:: Remove the original mount point (NB need to run the command twice)
mountvol Z: /d
mountvol Z: /d
:: Mount to folder using GUID variable, only on first run
if exist F:\firstrun.txt goto skip01
if not exist F:\firstrun.txt echo firstrun > F:\firstrun.txt
mountvol F:\vc1 %op1%
:skip01
echo. & echo Press any key to dismount F:\testvol
pause > nul
veracrypt /d Z /q /f /w /s
exit
I don't understand why you have to duplicate mountvol Z: /d either! Doesn't make much sense, given normal successful usage of the command.
Like you and Dmitrii, I'd like to see an in-built ability to mount to a folder. However, I guess the developers have to prioritise sorting out core issues first, particularly those caused by the proliferation of proprietary configurations these days, caused by different manufacturers' GPT/UEFI/SecureBoot etc implementations.
So, I'm always looking for ways to make VC work the way I'd like it to by external means if necessary, and it had never occurred to me to try using mountvol to acheive that particular objective. Thanks again for pointing this possibility out.
Last edit: Adrian Kentleton 2018-10-17
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The old PGPdisk had the option to mount to a folder on Windows like DFS or Linux.
The VeraCrypt requires to select a free drive letter to mount.
Yes, someone can create a link (by the 'mklink' command) and be happy, but all these used letters still remain in the system as a waste.
You can manually remount a veracrypt volume to a folder path and free the drive letter using
mountvol
. For instance, if you mounted a VeraCrypt volume to drive letter X: and want it at C:\Mount instead, do the following in cmd:mkdir C:\Mount
mountvol
(observe the volume GUID currently assigned to X:)mountvol X: /D
(free X:)mountvol C:\Mount \\?\{<Volume GUID>}
X: is now free to be used for other things, except for mounting another VeraCrypt volume to it (the volume bound to C:\Mount still has the device name
\Device\VeraCryptVolumeX
, which will cause VeraCrypt to fail trying to mount anything to X:)Note that VeraCrypt will still list the volume as mounted to X: even though it's not. Dismount works normally. The next time you mount this volume with VC, you only need to do step 3 above (free the drive letter), the mount created at step 4 reactivates automatically.
But I definitely second your request. This would be very useful, as currently you need to run a script like the one above to automate such a procedure.
Last edit: neos6464 2018-10-15
I used
mklink /d /j C:\Mount X:\
for the first time only. Then it also remembers specified paths after usual Dismount without new commands. But users worry about waste letters and same content. Once a user had cleaned double data as she thought.The
mountvol
sequence above lets you free X: (i.e. it is not wasted, there are no duplicate trees, and from the point of view of the system X: has nothing to do with your encrypted volume anymore).mklink
ing to X: obviously does not let you free X:, because as soon as you do, your link is brokenThank you for sharing of your nice solution. I understood it. I had just dropped a note for other readers and, I hope, for the author too, for some ideas.
@neos6464: your idea does not work for me (Windows 7, VC 1.22, 32-bit); whatever I do, I get both a test volume mounted to a drive letter, and a folder (shown as a shortcut), and can read and write to the volume at both locations. That is, the original drive letter allocation is not removed from Windows Explorer.
Inspired by your idea, I wrote a batch script to automate mounting a test volume, as follows:
@echo off
:: Create a variable with mount options
set op0=/q /v F:\testvol /l Z /hash sha512 /p testvol /c n /nowaitdlg /m rm
:: Mount volume using mount options variable
veracrypt %op0%
:: Write GUID into file; read GUID from file into a variable
mountvol Z: /l > F:\testvol.txt
for /f %%a in (F:\testvol.txt) do set op1=%%a
:: Remove the original mount point
mountvol Z: /d
:: Mount to folder using GUID variable, only on first run
if exist F:\firstrun.txt goto skip01
if not exist F:\firstrun.txt echo firstrun > F:\firstrun.txt
mountvol F:\vc1 %op1%
:skip01
echo. & echo Press any key to dismount F:\testvol
pause > nul
veracrypt /d Z /q /f /w /s
exit
What am I doing wrong, please?
Looks like you have to call
mountvol Z: /d
twice. Not sure why...Let me know if that works, and thanks for the script - saved me a bit of upcoming work :)
Hi @neos6464, yes, that sorts it, script now works as expected. So, script now is:
@echo off
:: Create a variable with mount options
set op0=/q /v F:\testvol /l Z /hash sha512 /p testvol /c n /nowaitdlg /m rm
:: Mount volume using mount options variable
veracrypt %op0%
:: Write GUID into file; read GUID from file into a variable
mountvol Z: /l > F:\testvol.txt
for /f %%a in (F:\testvol.txt) do set op1=%%a
:: Remove the original mount point (NB need to run the command twice)
mountvol Z: /d
mountvol Z: /d
:: Mount to folder using GUID variable, only on first run
if exist F:\firstrun.txt goto skip01
if not exist F:\firstrun.txt echo firstrun > F:\firstrun.txt
mountvol F:\vc1 %op1%
:skip01
echo. & echo Press any key to dismount F:\testvol
pause > nul
veracrypt /d Z /q /f /w /s
exit
I don't understand why you have to duplicate mountvol Z: /d either! Doesn't make much sense, given normal successful usage of the command.
Like you and Dmitrii, I'd like to see an in-built ability to mount to a folder. However, I guess the developers have to prioritise sorting out core issues first, particularly those caused by the proliferation of proprietary configurations these days, caused by different manufacturers' GPT/UEFI/SecureBoot etc implementations.
So, I'm always looking for ways to make VC work the way I'd like it to by external means if necessary, and it had never occurred to me to try using mountvol to acheive that particular objective. Thanks again for pointing this possibility out.
Last edit: Adrian Kentleton 2018-10-17
I think this may be a simple asynchronous timing issue. If you add a TIMEOUT /T 1 then it will probably be caught up. /T 2 to make doubly sure.
Why hasn't the dev added direct support for volume mount point folders?
my solution: just remove drive letter for encrypted disk in disk management. that's all. then just mount it whatever letter you want in veracrypt