Windows – Shadow Copy With Storage Spaces

powershellsystem-restorevolume-shadow-copywindows 10

I converted 2 of my drives to be a mirrored storage space on windows 10. I am using ReFS. This drive is d drive.

When I create a restore point the dialog that comes up does not have d drive in it.

enter image description here

Thus I cannot configure the shadow copy space allocation for that drive, or turn system protection on or off. I used to be able to do this when the drives were separate and NTFS.

My aim is to schedule a daily restore point using the powershell Checkpoint-Computer command. But I assume that this drive won't be included if I can't configure it in the system restore dialog?

Why is it missing? Is there some kind of issue with storage spaces or ReFS? I suspect not because my backup program is creating a snapshot of that d drive when running a backup.

I found some information about enabling drives for system restore in powershell,

enter image description here

But again no luck. I found others online saying that I should run powershell as administrator, which I am doing, and also to check the drive exists, and this follows,

enter image description here

Update:

I tried this command as suggested. I double checked I was using an elevated command prompt,

vssadmin add shadowstorage /for=D: /on=D: /maxsize=100GB

And this is what I get,

enter image description here

Looks like this is only for server versions of windows.

https://stackoverflow.com/questions/43276093/windows-10-how-to-create-shadow-storage-on-another-drive-without-vssadmin-create

Best Answer

1 Create shadow storage

1.1 The System protection tab in System Properties

  • this GUI only lists NTFS volumes, so you can't create shadow storage for ReFS volume there
  • instead try one of:
    • vssadmin add shadowstorage /for=D: /on=D: /maxsize=100GB (Windows Server only)
      • alternatively for non-server Windows editions try vssadmin resize shadowstorage /for=D: /on=D: /maxsize=10% that will add shadow storage if it does not exist and thus is comparable to vssadmin add
    • wmic shadowstorage call create Volume=D:\ DiffVolume=D:\ MaxSpace=20
      • if this command returns ReturnValue = 10 (which is Unknown error) workaround follows
    • wmic shadowcopy call create Volume=D:\
      • creating shadow copy on disk without shadow storage will create one automatically
      • you can resize the shadow storage with vssadmin resize shadowstorage /for=D: /on=D: /maxsize=10%

1.2 List shadow storages

  • make sure the shadow storage is there and configured using one of:
    • vssadmin list shadowstorage
    • wmic shadowstorage list

2 Create shadow copy

2.1 Create shadow copy

  • you want to use scheduled system protection feature, but for now just take a snapshot manually:
    • wmic shadowcopy call create Volume=D:\

2.2 List shadow copies

  • verify the snapshot was created:
    • vssadmin list shadows /for=D:

3 Mount shadow copy

  • since you are using Storage Spaces, you won't see snapshots in Previous versions tab in disk/file properties
  • but the snapshots exists and can be mounted as a folder
  • this shortage apply for both NTFS and ReFS Storage Spaces
  • to mount a snapshot you will need shadow ID, shadow path and temporary folder

3.1 Get shadow copy ID

  • vssadmin list shadows /for=D:
    • look for something like this Shadow Copy ID: {5cc29315-0379-415e-8496-69923618e3de}

3.2 Get shadow copy path

  • wmic shadowcopy where "ID='{5cc29315-0379-415e-8496-69923618e3de}'" get DeviceObject
  • or vssadmin list shadows /for=D:
    • look for Shadow Copy Volume: \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy624

3.3 Mount shadow copy as folder

  • mklink /j %tmp%\shadow \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy624\
    • note the extra \ at the end
    • the shadow copy is now available in %tmp%\shadow
Related Question