Volume Shadow Copy (VSS) - c++

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*.
THe VSS snapshot operations work fine for folder that have no subfolders - i.e. my email and SQL server volumes. 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? 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. If anyone is interested let me know and you can have a (source) copy when it's ready ...
Thx++
Jerry

Your question is confusing...
VSS does not work at a "folder" level. 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).
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. 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. 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. This gives you a free explorer application, this is what most sector based backup applications do. Also it gives them VM possibilities.
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. Do you know what a NTFS reparse point is? 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. On a restore, how best do you lay out the NTFS volume as not to affect NTFS performance on the restored volume? 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.
In the case of MS SQL Server - check that it is a VSS writer. If it is then your snapshot of the DB files should be OK. 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'). 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.

Related

vmware quiescence snapshot

I have a question about "quiescence" snapshot.
As I understand step of quiescence" snapshot:
Freeze FS and Processes
Run pre-freeze
Make snapshot
Run post-script
Unfreeze FS and Processes
Is it right? For example if I stop mysql in pre-freeze , is it not necessary to run it in post-script?
You may find this KB article useful:
https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1015180
In general, the goal here is to get the file system into a consistent state. That is to say, if you restore from this snapshot, you want to make sure that your application can re-start from this point. For many SQL based databases, this implies that transactions should be committed prior to snapshot. The actual details vary depending on the system you are using.
All of this is managed by guest tools as only the guest can actually quiesce the file system.

Restoring from Glacier after Synology NAS

Have been using Synology NAS for backup for quite some time.
Due to changes in structure will be migrating to new system and need to restore all files from Glacier.
Tried using CloudBerry Backup (desktop free) however after synchronizing there where no listed files for restoration.
Also tried using Fast Glacier, however this resulted in errors preventing the backup from functioning.
Any and all suggestions more than welcome.
The most easy approach would be if you could copy the files in question from your Synology NAS to the new system, whether it is a new Synology NAS or something else. It is the fastest and most cost-efficient way.
If you migrating to the new Synology, you should just copy the files from the old one. If it is somehow not possible, you should use "Retrieve task" button from "Restore" tab.
Beware, it will take long time just to retrieve the task. When retrieving the task, Synology NAS will download files related to the task. These files contain all the information about your backup task: which files are backed up, versions, file location, size and so on. When the task is retrieved, you can begin to recover the files. Use this calculator to calculate the restore price before you begin - it is far from cheap.
Also, hope that restore will succeed (because, sometimes, backup integrity fails which makes restore not possible)
In case you restore to some other system than Synology, you should definitely copy the files from your old Synology. If you no longer have access to the old Synology NAS, buy a new Synology (or maybe use XPenology), restore to it and then copy the files to the new system. Amazon Glacier on Synology NAS backs up in proprietary format, which to my knowledge only readable by other Synology devices.
Good luck with migration.

How VMWare Snapshot "Save" VM's state without copying all the VM files?

I was wondering, what kind of technique VMware Snapshots uses to assure that you will be able to return to a previous state without copying all the VM's disk?
It is basically a delta child disk. Operations are made it it while running off the snapshot. Makes it easy to revert.
link to explanation

Can I access the filesystem with Google NaCl?

Since Google NaCl is C++, will I be able to access the file system somehow? That's pretty much needed if I am to create a game or a desktop app.
Due to security restrictions, NaCl doesn't allow you to just open up any folder on the disk.
It does, however, grant the ability to access a sandboxed, obfuscated filesystem.
You can check out the PONG example in the latest SDK for examples of how to use the FileSystemAPI.
In addition, this page is a good starting point to understanding how the file system works:
https://developers.google.com/native-client/beta-docs/fileIO
~Main
Yes, but this access is supposedly secure and only able to access a sandboxed file system. Apparently you'll be able to do mmap calls, even. What could go wrong? :-)
Beyond any data files that come with the download, additional disk quota is an "app privilege" you have to "approve" when you install something. It can range from 0 to unlimited.

Unexposing a snapshot in XP (Volume Shadow Copy)

Microsoft provides a way of mounting a read-only snapshot as a volume using their vshadow program. However, it does not provide a way to unmount the snapshot (I wonder what would happen if I deleted the snapshot?). Going through the documentation on MSDN I found UnexposeSnapshot Method, and added the ability to use it in the vshadow. However, it says that it's only supported for Vista and Server 2008 machines. Is there anyway around this? The XP configuration for vshadow won't compile. It would be really bizarre if Microsoft wrote a way to mount volume shadow copies in XP and server 2003, yet didn't provide a way to unmount them.
Any ideas?
Use Windows' built-in mount management utility mountvol.exe.
On API level, you should be able to use DeleteVolumeMountPoint.
There is a command line tool inside the Windows Vista platform sdk that can be used to create batch files that operate on snapshots. I don't know if you mean that one, but it definitively works this way: You invoke it and it will create the snapshot. Then it will launch another process that you specify. Then that process (e.g. another batch file or the same batch file) will run. When it ends, the command line tool will remove and delete the snapshot.