2

I implemented a RAMDisk into my C# application, and everything is going great, except I need to back up the contents regularly due to it being volatile. I have been battling with AlphaVSS for Shadow Copy backups for a week, then someone informed me that VSS does not work on a RAMDisk.

The contents that are located on the RAMDisk (world files for Minecraft) are very small, but there can be hundreds of them. The majority of them are .dat files only a few hundred bytes in size, and there is other files that are 2-8MB each.

I posted about this yesterday Here, and the solution that was suggested was to use a FileStream, and save the data out of it. I just read that this is a horrible idea for binary data on another Stack Overflow question, so I am looking for a better approach to backup all of these little files, some of which might be in use.

Community
  • 1
  • 1
  • Which type of filesystem is on the RAM disk? – Petr Abdulin Aug 24 '11 at 03:50
  • I create the RAMDisk with a NTFS filesystem –  Aug 24 '11 at 04:30
  • Well, then it shouldn't be a problem with VSS on it. Could you provide some info about this limitation with RAM disks? Since VSS is natural way to copy locked files on Windows. The VSS was actually created to do just that. – Petr Abdulin Aug 24 '11 at 04:57
  • The developer of the RAMDisk software was the one that informed me that VSS generally doesn't work with RAMDisk's (in my case it is ImDisk). I created a NTFS RAMDisk and used a VSS command line tool and sure enough, it did not recognize E: as a valid drive for creating a shadow copy from. –  Aug 24 '11 at 05:03
  • Well, maybe then you can try some other RAM disk software? http://www.softperfect.com/products/ramdisk/ for example, just to be sure.. – Petr Abdulin Aug 24 '11 at 06:36

1 Answers1

1

I suggest you first zip all the small files together, then back them up to a location.

ref:

  1. zip library: http://www.icsharpcode.net/opensource/sharpziplib/
  2. use System.IO.File.Copy to copy the zip packed.
gekowa
  • 452
  • 2
  • 10
  • you would add this to your c# code that implemented the ramdisk. or did you mean you setup a ramdisk and are using it with c# to store data in ram? you probably should convert to a memorystream if so. – Brady Moritz Aug 24 '11 at 05:24