Jump to content

- - - - -

Problem with using script at shutdown to persist RAMDisk

ramdisk imdisk robocopy

  • Please log in to reply
2 replies to this topic

#1 schliemann

  • Members
  • 2 posts

Posted 14 September 2012 - 08:56 AM


I have set up a RAMDisk with IMDisk and it is working great. I do have one headache though. I want to persist my data at shutdown. Let me shortly describe how my setup works right now.

Start up:

With a scheduled task the following lines is executed in a bat file:

Load Image into RAMDisk
imdisk -a -t vm -f D:RAMDiskRAMDisk.img -m F:

I have a group policy that handles shutdown with the following commands in a bat file:

Mount image directly as drive
imdisk -a -f "D:RAMDiskRAMDisk.img" -o fix -o hd -o rw -m K:

Copies differences from drive E to drive K.
robocopy F: K: /M /COPYALL /MIR

Unmount drive K.
imdisk.exe -D -m K:

When I run the shutdown script inside windows robocopy acts as i'd expect and is very fast as long as I only make small changes, but when I do a proper shutdown and the script is invoked it seems as if the whole image is saved to the disk again. It takes a long time ~1 minute for 22 GB. Can anyone help me with what my problem might be?

Edited by schliemann, 14 September 2012 - 08:58 AM.

#2 dog


    Frequent Member

  • Expert
  • 236 posts

Posted 14 September 2012 - 12:15 PM

You could try robocopy's /log option and see if it is doing anything differently?

#3 schliemann

  • Members
  • 2 posts

Posted 14 September 2012 - 06:52 PM

Turned out that robocopy and IMDisk failed at reaching my F: drive when the script was run at shutdown. I changed it to run on the Group policy logoff instead and it seems to work now. Thanks

Also tagged with one or more of these keywords: ramdisk, imdisk, robocopy

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users