How to save RAMdisk to image without GUI?

Started by 790

790

How to save RAMdisk to image without GUI?   23 November 2023, 19:55

ramdisk.exe" /save:R starts the GUI and cmd-window does not close.
ramdiskc.exe" /save:R there is no such command or doesn't work for disks created by GUI?
I've already configured the RAMdisk, I don't need start the GUI with logon.
If the disk is configured to save on system shutdown, will this not work without the GUI also?
SoftPerfect Support forum - Andrew avatar image

Re: How to save RAMdisk to image without GUI?   23 November 2023, 21:13

It really depends on the disk type you have configured.

If that's a disk mounted at startup, then the GUI is not needed. It will still be saved on shutdown by the driver.

However, if it's a disk mounted at logon, then the GUI is required for correct initialisation and finalisation.
790

Re: How to save RAMdisk to image without GUI?   23 November 2023, 22:17

My RAMdisk mounted at startup from image-file. How can I save it to its image without GUI, at any time, NOT during system shutdown?
I use a cmd.bat file to clean and save to the image after (ramdisk.exe" /save:R). It's working fine with GUI in tray, but not without one.

btw. It would be nice to add functionality to clear user-defined folders/files before image saving at system shutdown.
SoftPerfect Support forum - Andrew avatar image

Re: How to save RAMdisk to image without GUI?   24 November 2023, 14:28

To address your main query, saving the RAM disk to its image file without a GUI and at any time other than system shutdown requires the GUI component of the software to be running. This is because the command-line functionality (ramdisk.exe /save:R) depends on certain services and interfaces that are only active when the GUI is operational. Therefore, to perform on-demand saving of the RAMdisk, the GUI needs to be active, even if it's running in the background or minimised to the system tray.

Regarding your batch file for cleaning and saving the RAMdisk, you can certainly add commands to clear specific user-defined folders or files before the saving process. Here's a basic example of how you could modify your batch file to include this functionality:
@echo off
REM Clear specific folders/files
del /Q "R:\path\to\your\folder\*"
del /Q "R:\path\to\your\file.txt"

REM Save the RAM disk
ramdisk.exe /save:R
Regarding your suggestion to add a feature for clearing specific folders/files before saving the image at system shutdown, we appreciate your input and always welcome customer feedback. However, at this time, such a feature is outside the scope of our product.
790

Re: How to save RAMdisk to image without GUI?   24 November 2023, 20:55

Ok, thanks for your answer!
Just deleting for some folders or files is not enough, need to create new empty, because they are linked as junction points or symlinks. Because I also use RAM-disk as a "garbage collector" (logs, temp, cache, etc.) and there is no desire to save this "garbage" into an image smile
@echo off
cmd /c rd %tmp% /s /q 
md %tmp%
----------------
cmd /c rd R:\K\Win10LTSC\Logs /s /q
md R:\K\Win10LTSC\Logs
cmd /c rd R:\cache /s /q
md R:\cache
----------------
cmd /c DEL R:\Windows\PFRO.log /s /q
set /p=<nul > R:\Windows\PFRO.log
cmd /c DEL R:\Windows\setupact.log /s /q
set /p=<nul > R:\Windows\setupact.log
cmd /c DEL R:\Windows\setuperr.log /s /q
set /p=<nul > R:\Windows\setuperr.log
----------------
REM "Save to disk"
"C:\Program Files\SoftPerfect\ramdisk.exe" /save:R
SoftPerfect Support forum - Andrew avatar image

Re: How to save RAMdisk to image without GUI?   24 November 2023, 22:37

To point out, deleting files and folders will not stop them from being written into the image. When you delete a file or folder, it's only removed from the file system metadata, but the actual file contents remain. This is generally how file recovery tools operate. It might be better to use two RAM disks: one for volatile data and another for persistent data.
790

Re: How to save RAMdisk to image without GUI?   24 November 2023, 23:38

I tried two RAM-disks, but...

I have SATA-III SSD for system and games and SATA-II HDD for data. All are NTFS.
System RAM 16Gb, Win10x64 Home (pagefile 2Gb was kicked out to HDD, unfortunately it's needed for one game).
System partition 'C' on SSD, SoftPerfect RAMdisk 4.4.1 installed here also, in C:\Program Files\.
RAM-disk 'R' (exFAT, 2Gb) starts from image-file on HDD "At Startup". All works fine.
TRIM on partition 'C' is working normal also. (fsutil behavior query disabledeletenotify: DisableDeleteNotify = 0).
"Trimcheck" utility shows "TRIM... WORKING".

But when I add 1 more RAM-disk (exFAT, 1Gb, without image-file, only with folder structure, logon-start, with 'HD emulation' or without one, wiping or not-wiping), TRIM on partition 'C' stops working. "Trimcheck" utility shows "TRIM appears to be NOT WORKING (or has not kicked in yet)". So very long time "not kicked", only manual ReTRIM is working here.
When I remove this new RAM-disk - reboot - TRIM works fine again!
790

Re: How to save RAMdisk to image without GUI?   25 November 2023, 21:39

Yesterday I set the start of my only RAM-disk (from image) to start "At Logon" mode. I have not any important data there.
"Trimcheck" utility shows "TRIM... WORKING".
Now I'm in a good mood laugh

Reply to this topic

Sometimes you can find a solution faster if you try the forum search, have a look at the knowledge base, or check the software user manual to see if your question has already been answered.

Our forum rules are simple:

  • Be polite.
  • Do not spam.
  • Write in English. If possible, check your spelling and grammar.

Author:

Email:

Subject

A brief and informative title for your message, approximately 4–8 words:

     

Spam prevention: please enter the following code in the input field below.

  *******    *******   **     **  **     **  ******** 
 **     **  **     **  **     **  **     **     **    
 **     **  **     **  **     **  **     **     **    
  ********   ********  **     **  **     **     **    
        **         **   **   **    **   **      **    
 **     **  **     **    ** **      ** **       **    
  *******    *******      ***        ***        **    

Message: