简体   繁体   English

卷影复制(VSS)

[英]Volume Shadow Copy (VSS)

Can anyone clarify an issue? 任何人都可以澄清一个问题吗? I'm using the VSS API (C++ using VSS2008 and the latest SDK running on XP SP3) in a home-brew backup utility*. 我在家庭酿造备份工具*中使用VSS API(使用VSS2008的C ++和在XP SP3上运行的最新SDK)。

THe VSS snapshot operations work fine for folder that have no subfolders - ie my email and SQL server volumes. VSS快照操作适用于没有子文件夹的文件夹 - 即我的电子邮件和SQL服务器卷。 However when I take a snapshot of a folder that does contain subfolders, the nested structure is 'flattened' in the snapshot - all sub-directories cease to exist. 但是,当我拍摄包含子文件夹的文件夹的快照时,嵌套结构在快照中被“展平” - 所有子目录都不复存在。

So here is the question: I am aware that support for VSS on XP is a bit limited but is there a way to specify a snapshot be non-recursive? 所以这里有一个问题:我知道在XP上对VSS的支持有点受限但有没有办法指定快照是非递归的? The docs are not very helpful ... 文档不是很有帮助......

  • I got really tired of buggy rubbish that costs boatloads and fails every few days so I thought I'd roll my own. 我真的厌倦了需要花费大量船只并且每隔几天都会失败的垃圾垃圾,所以我想我会自己滚动。 It'll get onto CodeProject at some point. 它会在某个时刻进入CodeProject。 If anyone is interested let me know and you can have a (source) copy when it's ready ... 如果有人有兴趣让我知道,你可以准备一份(来源)副本......

Thx++ THX ++

Jerry 杰瑞

Your question is confusing... 你的问题令人困惑......

VSS does not work at a "folder" level. VSS无法在“文件夹”级别工作。 It works a "volume" level. 它工作在“音量”级别。

You "snap" a volume and you will have a device path which you can "open" using the filesystem api (which will automatically mount the device volume with a filesystem) on a file by file or you can access the device directly (sector by sector). 您“捕捉”一个卷,您将拥有一个设备路径,您可以使用文件系统api(它将使用文件系统自动挂载设备卷)“打开”文件或您可以直接访问设备(扇区部门)。

It should be easy to backup all files on the snapped device volume (don't forget all of the file streams and ACL's for NTFS files), your problem will be restoring them... VSS will not help you on the restore. 备份快照设备卷上的所有文件应该很容易(不要忘记NTFS文件的所有文件流和ACL),您的问题将是恢复它们...... VSS无法帮助您进行恢复。 The main problem will be restoring a system volume, where you will need another OS to boot to like WinPE or DOS or something else. 主要问题是恢复系统卷,在那里你需要另一个操作系统来启动,如WinPE或DOS或其他东西。 If your not worried about system volumes then restore can be easy. 如果您不担心系统卷,则可以轻松恢复。

If you backup the data in terms of sectors, then you get the added benefit that if you write a volume device driver for it (to look like a volume or HD) then windows will auto-load a filesystem driver for it. 如果您按扇区备份数据,那么您将获得额外的好处,如果您为它编写卷设备驱动程序(看起来像卷或HD),那么Windows将自动加载文件系统驱动程序。 This gives you a free explorer application, this is what most sector based backup applications do. 这为您提供了免费的资源管理器应用程序,这是大多数基于扇区的备份应用程序所做的 Also it gives them VM possibilities. 它也为他们提供了VM的可能性。

Even if you are doing simple file backups, it helps to understand filesystems (NTFS, FAT, etc) so that you know what you can/should backup and restore. 即使您正在进行简单的文件备份,也有助于理解文件系统(NTFS,FAT等),以便您知道可以/应该备份和还原的内容。 Do you know what a NTFS reparse point is? 你知道NTFS重新分析点是什么吗? How are you going to deal with it if you hit one during your backup? 如果你在备份期间遇到一个,你将如何处理它? Do you know how windows actually boots and what files you need to backup and restore and "patch" to be able to have a chance at booting. 你知道windows实际上是如何启动的,你需要备份和恢复哪些文件,并且“修补”以便有机会启动。 On a restore, how best do you lay out the NTFS volume as not to affect NTFS performance on the restored volume? 在还原时,如何将NTFS卷布局为不影响还原卷上的NTFS性能? Are you going to support restoring system volumes to new hardware, what does that require you to do just to have a chance of working? 您是否支持将系统卷还原到新硬件,这需要您做些什么才能有效? The questions are endless. 问题是无止境的。

System backup/restore is not easy, there are lots of edge cases (see some of the questions above) that you don't know about until you hit them. 系统备份/恢复并不容易,有很多边缘情况(请参阅上面的一些问题),除非你碰到它们,否则你不知道。

Good luck on you project, I hope I haven't put you off too much, I'm just saying there is a lot of work to be able to deliver a backup application that most people have have no idea about. 祝你的项目好运,我希望我没有太多关闭你,我只是说有很多工作要能提供大多数人都不知道的备份应用程序。

Comment on the above - if a 'writer' is playing the VSS game then it will ensure that the file system is in a happy state as part of the VSS setup. 评论上述内容 - 如果'作家'正在播放VSS游戏,那么它将确保文件系统处于快乐状态,作为VSS设置的一部分。

In the case of MS SQL Server - check that it is a VSS writer. 在MS SQL Server的情况下 - 检查它是否是VSS编写器。 If it is then your snapshot of the DB files should be OK. 如果是,那么您的DB文件快照应该没问题。 If not, then its in what is called a 'crash state'. 如果没有,那么它就处于所谓的“崩溃状态”。 So for example if you are using MySQL or some other non-MS, non-VSS aware SQL database - your backup may or may not be coherent ('a good one'). 因此,例如,如果您使用MySQL或其他非MS,非VSS感知的SQL数据库 - 您的备份可能是也可能不一致('一个好的')。 In that case it may be better than nothing, but it it may also still be useless. 在那种情况下,它可能总比没有好,但它也可能仍然没用。 Using VSS MAY result in a better integrity from which to make your backup, but of the files are open, they are open and if the app does not play in the VSS pig-pen then you may or may not be hosed. 使用VSS 可能导致从中让你的备份更好的完整性,但文件是开放的,他们是开放的,如果应用程序没有在VSS猪笔玩,那么你可能会或可能不会进行大清洗。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM