How do you create a Writable VSS Snapshot?

668 Views Asked by At

This implies you can create a writable vss snapshot: Usability limit for Volume Shadow Copy Service (VSS) in Windows

But how do you do it? I've played around with things, I can get a FAT/FAT32 partition VSS snapshot to be writable by removing the read-only flag on the volume, but for NTFS it reports ERROR_WRITE_PROTECT

2

There are 2 best solutions below

1
Rita Han On BEST ANSWER

Shadow copies are read-only. It requires additional operation if you want to convert a shadow copy to a read/write LUN.

IVssBackupComponentsEx2::BreakSnapshotSetEx with VSS_BREAKEX_FLAG_MAKE_READ_WRITE option can make the shadow copy LUN be exposed to the host as a read-write volume.

For an example you can refer to official sample: VShadow Volume Shadow Copy Service sample. Use -bw command to break the shadow set into writable volumes.

0
Neelabh Mam On

keeping hardware luns (and the associated BreakSnapshotSetEx) aside, there are 2 potentials ways in which one could get hold of a writable snapshot in a purely software way. First one is to write a custom VSS writer and expose the OnPostSnapshot event handler. This is where the snapshot becomes writable first immediately after vss creates it so that all involved writers could do their specific rollback corrections on the snapshot device. The second one is to write a block device driver driver that layers a writable differencing image on top of a read only persistent snapshot device.. much like how differencing virtual disks work.