Backup mounted VeraCrypt volumes

Hi,

I have two VeraCrypt volumes mounted under U: and Z: on my windows machine.
I am running restic 0.17.0 compiled with go1.22.5 on windows/amd64.

My backup command is
restic backup -r D:\restic\t480s U: Z:

An at the end, the output is

error: nodeFromFileInfo U:.: get EA failed for path U:., with: get file EA failed with: Unzulässige Funktion.
error: nodeFromFileInfo Z:.: get EA failed for path Z:., with: get file EA failed with: Unzulässige Funktion.

(german localization of windows).

Is there any trick to backup to content of these mounted volumes from VeraCrypt via restic?
I have done some research, but did not get to a soluation.

Thank you and best regards
yoyobo

1 Like

Maybe because you cannot backup the “System Volume Information” folder? Everything else should be backuped.

Just tested with a new NTFS-VeraCrypt Container mounted to Z: and it worked (apart from the “System Volume Information” folder/error).

1 Like

@RYTD29 Thanks! With this error message I have not considered, that the backup worked at all for these drives. But looking into the snapshots, is looks like it worked:

But how do I do a restore of a specific folder in U:\ now to test it?
I have tried something lik

restic -r D:\restic\ restore latest --target C:\restore-test --include \U\kp

but no files are restored:
Summary: Restored 0 files/dirs (0 B) in 0:00

Any hints?

Thank you and best regards
yoyobo

1 Like

Can you run something like:

restic.exe -r YourRepo ls latest>"C:\restic-TEST-ls.txt"

On my system I get (for one specific file):

/Z/Z:./RT/05.jpg

The problem might be the “:” (colon) followed by the “.” (dot).

I was also not able to restore any file.

1 Like

The error should be fixed by Skip ExtendedAttribute processing in Windows for volumes that do not support EA by aneesh-n · Pull Request #4980 · restic/restic · GitHub . Please try whether a beta version from restic beta releases (/) solves the problem.

2 Likes

Created new test-repository (init) and used the following Windows-restic-exe: https://beta.restic.net/latest_restic_windows_386

Still not able to restore files. Getting the following error:

repository 46abb6d7 opened (version 2, compression level auto)
[0:00] 100.00%  1 / 1 index files loaded
restoring snapshot 8d092262 of [Z:\] at 2024-08-26 15:33:30.3849624 +0200 CEST by DESKTOP-F10EAA1\MaxMustermann@DESKTOP-F10EAA1 to D:\z_tmp\restic-TEST-restore
ignoring error for \Z\Z:.: failed to check for directory: CreateFile \\?\D:\z_tmp\restic-TEST-restore\Z\Z:: The filename, directory name, or volume label syntax is incorrect.
ignoring error for \Z\Z:.\RT: failed to check for directory: CreateFile \\?\D:\z_tmp\restic-TEST-restore\Z\Z:\RT: The filename, directory name, or volume label syntax is incorrect.
ignoring error for \Z\Z:.\RT\01.jpg: failed to check for directory: CreateFile \\?\D:\z_tmp\restic-TEST-restore\Z\Z:\RT: The filename, directory name, or volume label syntax is incorrect.
ignoring error for \Z\Z:.\RT\02.jpg: failed to check for directory: CreateFile \\?\D:\z_tmp\restic-TEST-restore\Z\Z:\RT: The filename, directory name, or volume label syntax is incorrect.
...
1 Like

I am using still the 0.17.0 (final) an the listing of the files shows this:
grafik

So no files are backed up at all…

Edit:
I will now try the beta

1 Like

What exact command did you use to create that snapshot? The output of ls should be /Z/RT/05.jpg.

1 Like

That part definitely should be fixed in the beta version.

2 Likes

Backup is now working with the beta, I have an output of the ls-command like this:
/Z/Z:./wlan.txt
for every file.

Restore from the commandline is not working
restic -r D:\restic\t480s restore latest --target C:\restore-test --include /Z/Z:./wlan.txt

restoring snapshot c143ad06 of [C:\jb U:\ Z:\ C:\Users\yoyob\Downloads C:\Users\yoyob\Documents C:\Users\yoyob\AppData\Roaming] at 2024-08-26 15:48:59.4239336 +0200 CEST by LEN2-JB\yoyob@len2-jb to C:\jb\restore-test
ignoring error for \Z\Z:.\wlan.txt: failed to check for directory: CreateFile \?\C:\jb\restore-test\Z\Z:: Die Syntax für den Dateinamen, Verzeichnisnamen oder die Datenträgerbezeichnung ist falsch.
ignoring error for \Z\Z:.: UtimesNano: Die Syntax für den Dateinamen, Verzeichnisnamen oder die Datenträgerbezeichnung ist falsch.
ignoring error for \Z: UtimesNano: Das System kann die angegebene Datei nicht finden.
Summary: Restored 0 files/dirs (0 B) in 0:00
Fatal: There were 3 errors

But restore with Restic Browser is working fine. This seems to handle the path and syntax issues correctly…

1 Like

On my case on Windows I don’t need to write “:” for the include path just the name of the drive

Try
restic -r "D:\restic\t480s" restore latest --target "C:\restore-test" --include "/Z/Z/wlan.txt"

The same thing happened to me when I started learning restic on Windows. In the path from where I include the files I must not put the colon
For example:
C:\test\test.txt

works with
“C\test\test.txt”

Hi @fede and thinks for trying to help. Your suggestion didn’t work on my end.

1 Like

This one also does not work.

1 Like

That is already the cause of the restore problems. For a file Z:\wlan.txt the path in the snapshot must be /Z/wlan.txt all other variants are wrong. However, I’ve just created a snapshot from a VeraCrypt volume by running restic via PowerShell and the paths were handled as expected.

Which terminal/shell are you using to run restic?

Please create a debug log when running the backup command. Set the environment variable DEBUG_LOG to restic.log. I’m interested in everything between the first and last occurrence of archiver/tree.go in the log. You can also send the log to me in private.

restic -r D:\restic\t480s restore latest:/Z/Z:. --target C:\restore-test --include /wlan.txt should work. But the problem is that Z:. should never have shown up in the snapshot.

1 Like

Windows cmd-terminal (cmd.exe / Windows Eingabeaufforderung).

The *.bat-file looks as followed:

@echo off
chcp 65001
set restic="D:\z_tmp\latest_restic_windows_386.exe"
set repo_restic="D:\z_tmp\restic-TEST"
set "DEBUG_LOG=restic.log"
:: initialize
%restic% --repo %repo_restic% --insecure-no-password init
:: backup
%restic% --repo %repo_restic% --insecure-no-password backup "Z:"
pause
exit

Everything between first and last occurrence of archiver/tree.go is:

2024/08/27 10:27:47 archiver/tree.go:274	archiver.NewTree	21	targets: [Z:.]
2024/08/27 10:27:47 archiver/tree.go:274	archiver.NewTree	1	targets: [Z:.]
2024/08/27 10:27:47 archiver/tree.go:292	archiver.NewTree	21	before unroll:
/Z, root ".", path "", meta "."
    /Z:., root "", path "Z:.", meta ""

2024/08/27 10:27:47 archiver/tree.go:298	archiver.NewTree	21	result:
/Z, root ".", path "", meta "."
    /Z:., root "", path "Z:.", meta ""

2024/08/27 10:27:47 archiver/tree.go:292	archiver.NewTree	1	before unroll:
/Z, root ".", path "", meta "."
    /Z:., root "", path "Z:.", meta ""

2024/08/27 10:27:47 archiver/tree.go:298	archiver.NewTree	1	result:
/Z, root ".", path "", meta "."
    /Z:., root "", path "Z:.", meta ""

Looks like the path handling turns Z: into Z:.. I’ll have to read up on whether Z: and Z:\ are supposed to be identical on Windows or not. But either way, Z:. should have been an absolute path at that point, which it clearly isn’t. I’ll take a look what’s going on.

Broken snapshots when just specifying the volume name is actually already tracked in an issue: Restic backup of root of a drive letter on windows refuses to restore properly · Issue #2004 · restic/restic · GitHub .

Edit:

For now just use Z:\ instead of Z:.

Will be fixed by backup: support specifying volume instead of path on Windows by MichaelEischer · Pull Request #5028 · restic/restic · GitHub

1 Like

Great, thanks.