Feature Request: Ramdisk Folder Migration

FAQ, getting help, user experience about Primo Ramdisk
Post Reply
InquiringMind
Level SS
Level SS
Posts: 477
Joined: Wed Oct 06, 2010 11:10 pm

Feature Request: Ramdisk Folder Migration

Post by InquiringMind »

Given that most systems have only enough memory for a small ramdisk (especially compared to the size of a hard disk), making best use of one currently involves choosing a folder with frequently accessed data, copying it to ramdisk (with an image file to avoid data loss) and then setting up links or junctions from the original location to the new ramdisk location (or reconfiguring relevant software to use the ramdisk).

This could be automated with a feature like Ramdisk Folder Migration which would do the following:
  • When the ramdisk starts, folders listed for migration are renamed (to avoid conflict with their replacement junctions);
  • Folder contents are copied to the ramdisk (using the original folder name);
  • NTFS junctions are set up in the original folders' location (and with the original names) to point to the new folders on ramdisk.
When the system is shut down (or suspended/hibernated):
  • (optional) any changes made to the ramdisk folders are copied to the (renamed) original folders;
  • the junctions are deleted;
  • the original folders renamed back to their previous names, leaving things as they were before.
This would make it quicker to relocate folders while preserving data (the original folders are still there if a system crash causes ramdisk data loss or image file corruption). Having changes copied back to the original files means being able to access them, even if no ramdisk was present (e.g. if the folders were copied to another system without a ramdisk or if the ramdisk failed to start), providing a second level of data security over that of an image file alone.

This would also provide another way of handling full ramdisks - if a migrated folder exceeds the space available, it gets copied back to its original location (as above) with Primo Ramdisk reporting an error without having to interrupt the program responsible.
User avatar
Support
Support Team
Support Team
Posts: 3627
Joined: Sun Dec 21, 2008 2:42 am

Re: Feature Request: Ramdisk Folder Migration

Post by Support »

Thanks for the suggestion! It will be a good option for those who don't care the boot time and shutdown time.
InquiringMind
Level SS
Level SS
Posts: 477
Joined: Wed Oct 06, 2010 11:10 pm

Re: Feature Request: Ramdisk Folder Migration

Post by InquiringMind »

Thank for the response. Another possible benefit is to allow users to switch ramdisk usage between different programs (having multiple ramdisk profiles with different migration settings). So someone could run a ramdisk set up for, say, Photoshop during working hours and then switch to another ramdisk configured for World of Warcraft during leisure time.
robertcollier4
Level 3
Level 3
Posts: 17
Joined: Thu Nov 15, 2012 6:35 am

Re: Feature Request: Ramdisk Folder Migration

Post by robertcollier4 »

I like the idea.

FYI you could do it also via Group Policy running a BAT script at Windows startup and Windows shutdown.

The following REG script will register C:\OnStartup.bat and C:\OnShutdown.bat to run at startup and shutdown. And it will make them run asynchronously (Windows will wait for the BAT script to finish before finishing log on).

Code: Select all

Windows Registry Editor Version 5.00

; http://technet.microsoft.com/en-us/library/cc957393.aspx
; http://www.pctools.com/guides/registry/detail/1086/
; Run startup scripts asynchronously - Disabled
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
"RunStartupScriptSync"=dword:00000001

; http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=112428
; Always wait for the network at computer startup and logon - Enabled (irrelevant to network, but required for RunStartupScriptSync)
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
"SyncForegroundPolicy"=dword:00000001

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System\Scripts]

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System\Scripts\Shutdown]

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System\Scripts\Shutdown\0]
"GPO-ID"="LocalGPO"
"SOM-ID"="Local"
"FileSysPath"="C:\\WINDOWS\\System32\\GroupPolicy\\Machine"
"DisplayName"="Local Group Policy"
"GPOName"="Local Group Policy"

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System\Scripts\Shutdown\0\0]
"Script"="C:\\OnShutdown.bat"
"Parameters"=""
"ExecTime"=hex(b):00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System\Scripts\Startup]

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System\Scripts\Startup\0]
"GPO-ID"="LocalGPO"
"SOM-ID"="Local"
"FileSysPath"="C:\\WINDOWS\\System32\\GroupPolicy\\Machine"
"DisplayName"="Local Group Policy"
"GPOName"="Local Group Policy"

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System\Scripts\Startup\0\0]
"Script"="C:\\OnStartup.bat"
"Parameters"=""
"ExecTime"=hex(b):00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
InquiringMind
Level SS
Level SS
Posts: 477
Joined: Wed Oct 06, 2010 11:10 pm

Re: Feature Request: Ramdisk Folder Migration

Post by InquiringMind »

robertcollier4 wrote:FYI you could do it also via Group Policy running a BAT script at Windows startup and Windows shutdown...
Thanks for that tip - I was also thinking of an AutoHotKey script which, with 5.6.0's CLI, could create, mount and populate a ramdisk on a single keypress (moving my pagefile onto a separate ramdisk which would be available at system start). With some effort AHK could even put up a progress bar while populating the ramdisk.

However this wouldn't cope with sleep and hibernation (a few times, I've had a PC fail to resume from sleep so would want data copied back to physical disk first) so having this facility built-in would be better.
Post Reply