-
Notifications
You must be signed in to change notification settings - Fork 99
Methods Directory/File.Copy throw DeviceNotReadyException when using GLOBALROOT source path. #456
Comments
You're not doing anything wrong, it is a new bug related to GLOBALROOT. |
You asked me to confirm "Could you verify that delayUntilReboot is false?" - it is false in File.Copy.cs 761. But I guess you already reproduced. |
Yeah, sorry about that, post that message while debugging when I did not mean to. :) |
Could you try branch |
It solved GLOBALROOT issue, but now I have "System.IO.FileNotFoundException: '\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy4\Program Files\Microsoft SQL Server\MSSQL12.MSSQL2014\MSSQL\ALLTYPES_log.ldf'" at Directory.ExistsDrive.cs line 94. And this is snap_path returned by |
Lines 65 to 70 in 9ea257d
You should be able to use AlphaFS methods |
I'm bit confused. Code at the start of topic from VSS 1.40 src\Samples\VssBackup, Snapshot.cs and VssBackup.cs used. Snapshot created before "\\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy6\Program Files\Microsoft SQL Server\MSSQL12.MSSQL2014\MSSQL\ALLTYPES_log.ldf" and I can see "\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy6" in that tool, can copy file from snapshot "c:\Program Files\Microsoft SQL Server\MSSQL12.MSSQL2014\MSSQL\ALLTYPES_log.ldf" to "d:\Backups" with that tool, but AlphaFS fails with "System.IO.FileNotFoundException: '\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy6\Program Files\Microsoft SQL Server\MSSQL12.MSSQL2014\MSSQL\ALLTYPES_log.ldf'" I'm not familiar with Shadowcopy service, but if I understand it right VSS creates snapshot "HarddiskVolumeShadowCopy6" and through that snapshot AlphaFS going to copy file? Is that correct? Is it AlphaFS fails or is there already suppose to be file "ALLTYPES_log.ldf" in "HarddiskVolumeShadowCopy6" before AlphaFS will be able to copy it? |
Yes, AlphaFS expects the directory/file to exist in |
Last issue was on my side: "DATA" folder missing from source path. After changing to openFileDialog with "ValidateNames=false" to get file path everything works (I checked path side by side to figure). Thanks for help and amazing work. It saved me from making the same through kernel mode drivers. |
Glad to hear! Thanks for the bug. |
I'm trying to copy files from SQL Server data folder into another folder where I can work with them by using Shadowcopy (AlphaVSS). I made simple project by example from VSS
` string source_file = @"c:\Program Files\Microsoft SQL Server\MSSQL12.MSSQL2014\MSSQL\ALLTYPES_log.ldf";
string backup_root = @"D:\Backups";
string backup_path = Path.Combine(backup_root, Path.GetFileName(source_file));
First error was with '?' in snap_path "\\\\?\\GLOBALROOT\\Device\\HarddiskVolumeShadowCopy9\\Program Files\\Microsoft SQL Server\\MSSQL12.MSSQL2014\\MSSQL\\ALLTYPES_log.ldf", but I disabled that in Path.Helpers.cs with
switch (num){
case 34: // " (quote)
case 60: // < (less than)
case 62: // > (greater than)
case 124: // | (pipe)
throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, Resources.Illegal_Characters_In_Path, (char) num), "path");
`
Now I have "Alphaleonis.Win32.Filesystem.DeviceNotReadyException: '(21) The device is not ready: [GLOBALROOT]'" in Alphaleonis.Win32.Filesystem.File.Copy(snap_path, backup_path) but it suppose to be fixed in 2.2.1. I downloaded today AlphaFS-develop, tried 2.2.2 but still have error. Am I doing something wrong or error in AlphaFS?
The text was updated successfully, but these errors were encountered: