SoftPerfect Support Forum
Suggestions for ramfsctl CLI
|
Suggestions for ramfsctl CLI 31 August 2026, 13:14 |
Registered: 2 years ago Posts: 7 |
May I suggest/request a few improvements?
To use a source folder for software dev, I want replace my folder with the RAM disk using the current folder as a source, then I want to develop software for a bit, then turn it off to be sure all changes are back in place.
With software development there are a lot of writes, i.e. bin folder, node_modules, etc. So I tried to write a script that would replace current folder with drive B:
The process would be:
1) replace a source folder with RAM disk
2) do the work
3) unmount the disk once done
I was intending to use ramfsctl.exe with the create option.
I have encountered 2 problems:
a) when I use ramfsctl create, the disk is not shown in the UI.
b) the autosave option is missing, which I think is the limitation of the platform, not just the UI - autosave seems to be only available for drives created at logon.
I have ended up using the ramfsctl auto that seems to work with both options, but I would still like to use ramfsctl instead as the idea is that the process is temporary. And I would want to have auto save, no one wants to lose a day of work after power loss. Of course there is git and things like that though, but still...
My current scripts are at: https://github.com/marat-365/misc_scripts/tree/main/ramfsctrl
|
|
Re: Suggestions for ramfsctl CLI 31 August 2026, 19:14 |
Admin Registered: 20 years ago Posts: 2 104 |
In the Add Volume dialog, click Use a source folder instead and pick your project folder, tick Save changes at shutdown, and in Advanced tick Save changes every (minutes) if you want periodic write-back. That is the power loss protection you want
At mount, the folder contents are loaded into the volume before it is published to Windows, the folder on disk is renamed aside to a hidden copy, so C:\Work becomes C:\Work.ramfs, and the original path is turned into a junction to the volume. From then on C:\Work and the drive letter are the same data, so nothing has to be reconfigured: your IDE, your build scripts and your paths all stay as they are.
Saving writes back only the delta. Untouched files are not rewritten, unchanged regions inside a modified file are not rewritten either, renaming a folder with thousands of files costs a single rename on disk, and deletions propagate, so the disk always ends up matching the volume.
At dismount the junction is removed and the hidden copy is renamed back to C:\Work with your changes in it, an ordinary folder again. If the machine loses power, the swap is recognised and resolved at the next mount, so the folder is never left stranded.
If you leave saving off, the folder is loaded into RAM and everything is discarded on dismount, with the original folder reappearing untouched. That is a neat way to run a build or a test suite against real data that must not be modified.
One tip for a dev folder: opening a file through C:\Work goes via the junction redirect each time, while opening it through the drive letter does not. Reads and writes are equally fast either way, but a build that opens thousands of files is better pointed at the drive letter.
|
Re: Suggestions for ramfsctl CLI 02 September 2026, 03:21 |
Registered: 2 years ago Posts: 7 |
Yes I do understand how it works, but I am asking for the disks created with ramfsctl create to be shown in UI, and whether we can add autosave for the disks like that. I don't want to use ramfsct auto.
P.S. The folder mapping is brilliant, but I would need it to script to be more usable.
Thanks a lot!
|
|
Re: Suggestions for ramfsctl CLI 03 September 2026, 23:32 |
Admin Registered: 20 years ago Posts: 2 104 |
ramfsctl mount <letter> mounts a volume from its stored recipe, the same one auto add creates, so size, source and autosave do not have to be repeated on the command line the way create requires. Pair it with manual on the auto add line and the volume never mounts at boot, only when you call mount:
ramfsctl auto add V 8G Work manual autosave period=300 source=C:\WorkThen your everyday script is just:
ramfsctl mount V :: work ramfsctl dismount VConfigured once, mounted and dismounted per session, autosave running the whole time in between. It shows in the main window while mounted, same as any other volume, which is the bit you said was missing.
Try the latest release and let us know how it goes.
|
Re: Suggestions for ramfsctl CLI 10 September 2026, 21:55 |
Registered: 2 years ago Posts: 7 |
|
Re: Suggestions for ramfsctl CLI 11 September 2026, 00:42 |
Registered: 2 years ago Posts: 7 |
Quote.\ramfsctl.exe auto add B 18443M Work norecycle wipe autosave period=300 compress=normal source="A:\_gt\_angular_learning"
ramfsctl: store volume configuration failed: busy
(Win32 error 32: The process cannot access the file because it is being used by another process.)
|
|
Re: Suggestions for ramfsctl CLI 11 September 2026, 08:05 |
Admin Registered: 20 years ago Posts: 2 104 |
Regarding create, no it is still the one-off that stores nothing, so it has no autosave and doesn't show in the main window. mount is the one to use, and having several projects is fine. Give each project its own letter once
ramfsctl auto add P 8G ProjectA manual autosave period=300 source=C:\Work\ProjectA ramfsctl auto add Q 8G ProjectB manual autosave period=300 source=C:\Work\ProjectBand then mount P, mount Q, or both, and dismount each when you are done. The only limitation is that the source folders must not sit inside one another.
If you'd rather keep a single letter: dismount it, run auto add again with the other folder, which simply replaces the stored recipe, and mount. That also suits your script if you want the size recalculated each time: keep its auto add, add manual to it, and replace the create line with mount. The auto del in your dismount script can then go, since the recipe is meant to stay.
The busy error isn't a permission problem, so running as admin makes no difference. auto add checks that the folder can actually be moved aside, and Windows refuses that while any process has the folder open as its current directory. Your script moves its own prompt out of the way, but any other process counts too: a terminal or VS Code terminal opened in the project, ng serve or another Node process started there, and so on. We reproduced it here: a command prompt left sitting in the folder gives exactly your error, and the same command succeeds once it's closed.
To see what's holding it, open Resource Monitor, go to the CPU tab and type the folder name into Associated Handles. Close that, along with any editor or dev server that has the project open, before running mount as well, since that's when the folder is actually renamed and open files inside it get in the way too. Once it's mounted you can open everything again, through the folder path or the drive letter.
|
Re: Suggestions for ramfsctl CLI 11 September 2026, 21:48 |
Registered: 2 years ago Posts: 7 |
|
|
Re: Suggestions for ramfsctl CLI 12 September 2026, 09:21 |
Admin Registered: 20 years ago Posts: 2 104 |
Worth knowing though, and it makes the whole thing moot: auto add is a one-off. The recipe is stored permanently and survives dismount and reboot, so it only needs running once per project, not once per session. Do it once while nothing has the folder open, and your everyday script can be just:
ramfsctl mount B :: work ramfsctl dismount BThis keeps the config step out of your working day entirely, and mount only needs the folder free at the moment you start a session, before the editor is open.
If you do want the size recalculated on every run, keep the auto add where it is, but run the script before opening the project in VS Code or a terminal rather than after.
|
Re: Suggestions for ramfsctl CLI 13 September 2026, 14:31 |
Registered: 2 years ago Posts: 7 |
|
|
Re: Suggestions for ramfsctl CLI 13 September 2026, 14:41 |
Admin Registered: 20 years ago Posts: 2 104 |
So the pair already is the create you're asking for, just split in two. If you'd like it in a single step in your script, keep your current auto add line, add manual to it, and follow it with mount:
ramfsctl auto add B 18443M Work manual norecycle wipe autosave period=300 compress=normal source="A:\_gt\_angular_learning" ramfsctl mount BSame parameters you pass today, and the volume shows in the main window and saves every five minutes. Next time, run auto add with a different folder or size and it simply replaces the previous settings. manual just stops it mounting by itself at the next boot.