Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shadow Copy error when trying to backup data on a DrivePool drive #92

Open
beepboop1234 opened this issue Feb 3, 2024 · 7 comments
Open

Comments

@beepboop1234
Copy link

I'm getting the following error when attempting to backup data from a drive mounted with StableBit's DrivePool software (https://stablebit.com/DrivePool). DrivePool doesn't support Shadow Copy (https://community.covecube.com/index.php?/topic/4222-how-do-i-correctly-backup-stablebit-drivepool/&do=findComment&comment=28277) and I imagine this is why I'm getting the error.

Fatal: unable to save snapshot: CreateFile \?\GLOBALROOT\Device\HarddiskVolumeShadowCopy108\restic"F:: The filename, directory name, or volume label syntax is incorrect.

Inside the backup.ps1 file I see this portion:

            # disable VSS / file system snapshot for external drives
            # TODO: would be best to just test for VSS compatibility on the drive, rather than assume it won't work
            $vss_option = $null

Is there something I can change here (or anywhere else) that would allow my backups to use shadow copy on the C drive and similar but not on the F drive which is the DrivePool drive?

@hello-world-dot-c
Copy link

hello-world-dot-c commented Mar 15, 2024

I have a pseudo-fixed drive that uses a permanently installed SDcard and stumbled over the same thing. I modified the script so that it determines the drive letter for each backup source (function Get-Drives, now not only called if Test-Path fails but always) and then uses the Windows 'vssadmin' tool to get a list of drives that support VSS. If the drive from the backup source is not in the list of drives that support VSS, it disables VSS, If you're interested I can post it here or pm it.
The main issue that I see why this is not a universal solution is that the 'vssadmin' tool's output will depend on the system language. My version only works in English and will need a slight change for other system languages. Of course the parse string could be added to config.ps1.

@beepboop1234
Copy link
Author

If you're interested I can post it here or pm it.

Either would be GREATLY appreciated! I imagine posting it here would make it easier for people in the future as well.

@hello-world-dot-c
Copy link

Here it is. Already had an idea to improve it to revert to default behaviour when vssadmin fails (e.g.wrong language). Maybe I will add this later.
backup.zip

@Tamnac
Copy link

Tamnac commented Sep 8, 2024

Weird, I'm getting this exact error, no drivepool. I only get on Powershell core (v7.4.0) though, windows powershell works fine. Been trying to figure out why that makes a difference considering powershell itself is not doing anything except passing in the argument to use vss

@hello-world-dot-c
Copy link

Sounds like a permission issue.

@Tamnac
Copy link

Tamnac commented Sep 8, 2024

Sounds like a permission issue.

What permission? I'm running as admin, there's no other permissions I'm aware of

@Tamnac
Copy link

Tamnac commented Sep 8, 2024

No, I found the issue, it seems v7.3 changed how quoted arguments are passed (see stackoverflow explanation). It can be fixed by setting

$PSNativeCommandArgumentPassing = 'Legacy'

or by removing the quoting for this line (the '"{0}"' -f part)

$p = '"{0}"' -f ((Join-Path $root_path $path) -replace "\\$")

I'll probably make a pr for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants