Jump to content











Photo
- - - - -

Some questions about creating a persistent RAMdisk with ImDisk Toolkit.....


  • Please log in to reply
5 replies to this topic

#1 AnonVendetta

AnonVendetta

    Silver Member

  • Advanced user
  • 655 posts
  • Location:A new beginning.....
  • Interests:Self-development, computing

Posted 29 June 2018 - 07:17 AM

So, I would like to create a RAMdisk with ImDisk TK. I've been looking at the the TK's RAMdisk creation GUI, but am not sure about some of the options. I'll go straight to the questions:

 

1. Is the "Launch at Windows startup" option equivalent to using the -P parameter in the command line options? I ask because I plan to *INSTALL* some apps into the RAMdisk, and I need them to be available at every boot, exactly as I left them.

 

2. When I try to use the "-a" or "imdisk -a" parameter in the command line options, I get an "Error: the volume cannot be mounted" error. This happens even if no other parameters are used.

 

3. When using the "-t type" parameter, for using a file backingstore for the RAMdisk, what is the correct syntax? Am I supposed to specify it simply as "-t <location of backingstore file here> (i.e. "-t C:\RAMDisk.img") Or just as "-t type"? Or "-t type <location of backingstore file here>"? I need the contents of an *.img to be stored on the root of a fast SSD volume (for immediate availability at startup), but have the contents loaded into RAM during startup. So I'm looking for a true RAMdisk that is filebacked for persistence, rather than a *.img that is simply mounted but not loaded into RAM. I have tried using a RAMDisk before with software such as Opera, but they didn't seem any faster, I guess they were just loaded from a mounted *.img rather than being located in RAM. Not sure.

 

4. Is the "vm" parameter specified in conjunction with -f the equivalent to using the "Load content from image file or folder" in the Data tab of the RAMDisk creation GUI (and therefore not necessary)?

 

5. Is the "-P" parameter effective when used alone, or does it need to be explicitly specified along with -a?

 

6. I would also like to create a RAMDisk for temp directories, both for C:\Windows\Temp, as well as the temp directories for each of my user accounts. Should I also change the user/system environment variables myself (instead of trusting the GUI to do it and possibly screwing it up)? I think I should create the directories myself beforehand, save them into a *.img, then let the TK load that *.img. Should I also create NTFS junction points redirecting the user/system temp folders into the appropriate RAMDisk locations? Or is this not advised? I know that the RAMDisk is available while the system is running, and there should be no issues if the temp directories are seamlessly redirected. But my concern is that, somehow, if Windows or the user accounts tries to access the temp folders during startup or shutdown, then they may not be available if the ImDisk driver hasn't loaded yet. At what point in the bootup process does the driver load? Very early, or only after other critical system services are started first? And the shutdown process, it would seem that Windows is in a mad rush to kill all services ASAP, including ImDisk's services. How does the TK handle this during shutdown? I'm also worried that something like Windows Update may try to make use of the temp folders during startup or shutdown, and they may not be available if the ImDisk service(s) are not running, thus causing updates to fail.

 

7. Is hibernation compatible with the RAMDisk created by the TK? I'm aware that the TK syncs all data in the RAMDisk to the backing file during shutdown/reboot. But if I hibernate, will this cause issues? I currently have hibernate/hybrid sleep disabled, and if the RAMDisk will have issues with it then I will leave it as such. So for me, a shutdown is a true poweroff event, and a reboot is a "regular" reboot, with nothing saved to C:\hiberfil.sys either way. I don't really feel that hibernation is necessary on an SSD, but if I need to use it for say, emergency shutdown while doing something important (i.e. updates, working on my online schooling/Internet marketing projects, etc) then I won't hesitate to enable and use it in a one-off scenario.

 

8. Are the -hd, -fix, and -rw parameters the TK's defaults when creating a RAMDisk, or should I explicitly specify them. In the case of -hd, I'm not sure if it's necessary to create a dedicated partition within a *.img (to be loaded into RAM).



#2 v77

v77

    Silver Member

  • Team Reboot
  • 553 posts
  •  
    France

Posted 29 June 2018 - 11:09 AM

1. Is the "Launch at Windows startup" option equivalent to using the -P parameter in the command line options?

 

No, the GUI does not use the -P switch or similar mechanism.

The -P switch instructs the driver, through some registry entries, to load a file or create a ramdisk. But since this is done directly by the driver, you don't have some features such as formatting an empty volume.
 

2. When I try to use the "-a" or "imdisk -a" parameter in the command line options, I get an "Error: the volume cannot be mounted" error. This happens even if no other parameters are used.

 

Is this your full command?
With -a, you need to specify either a file or a size.
 

3. When using the "-t type" parameter, for using a file backingstore for the RAMdisk, what is the correct syntax? Am I supposed to specify it simply as "-t <location of backingstore file here> (i.e. "-t C:\RAMDisk.img") Or just as "-t type"? Or "-t type <location of backingstore file here>"? I need the contents of an *.img to be stored on the root of a fast SSD volume (for immediate availability at startup), but have the contents loaded into RAM during startup. So I'm looking for a true RAMdisk that is filebacked for persistence, rather than a *.img that is simply mounted but not loaded into RAM. I have tried using a RAMDisk before with software such as Opera, but they didn't seem any faster, I guess they were just loaded from a mounted *.img rather than being located in RAM. Not sure.

 

The file location is specified through the -f switch.
To have the full content of the file loaded in RAM, you need to specify "-t vm".
However, nothing will done at shutdown. To write the ramdisk content into the file, you need to use either a script (that you have to write) or the GUI.
 

4. Is the "vm" parameter specified in conjunction with -f the equivalent to using the "Load content from image file or folder" in the Data tab of the RAMDisk creation GUI (and therefore not necessary)?

 

For an image file, yes, it is equivalent. But as I said, there is nothing done at system shutdown with the command line.
 

5. Is the "-P" parameter effective when used alone, or does it need to be explicitly specified along with -a?

 

As the syntax help says, the -P switch is meant to be used with -a.
 

6. I would also like to create a RAMDisk for temp directories, both for C:\Windows\Temp, as well as the temp directories for each of my user accounts. Should I also change the user/system environment variables myself (instead of trusting the GUI to do it and possibly screwing it up)? I think I should create the directories myself beforehand, save them into a *.img, then let the TK load that *.img. Should I also create NTFS junction points redirecting the user/system temp folders into the appropriate RAMDisk locations? Or is this not advised? I know that the RAMDisk is available while the system is running, and there should be no issues if the temp directories are seamlessly redirected. But my concern is that, somehow, if Windows or the user accounts tries to access the temp folders during startup or shutdown, then they may not be available if the ImDisk driver hasn't loaded yet. At what point in the bootup process does the driver load? Very early, or only after other critical system services are started first? And the shutdown process, it would seem that Windows is in a mad rush to kill all services ASAP, including ImDisk's services. How does the TK handle this during shutdown? I'm also worried that something like Windows Update may try to make use of the temp folders during startup or shutdown, and they may not be available if the ImDisk service(s) are not running, thus causing updates to fail.

 

If you change the environment variables, you don't need to create junctions. And the opposite.

If you want the Temp directory available the sooner possible, you have to use the command line and the -P switch.
Drivers are loaded before user mode services.
User mode services are started before initializing the user session, but it does not meant that these services are ready when the user session starts

The GUI uses a user mode service, so the Temp directory can be available too late in the case another service uses this directory. However, I never seen a bug related to that.
Services that use the Temp directory are quite rare, and anything that is started with the system should be prepared to use another directory.

About Windows Update, to speak frankly, I gave up. About one hour just for installing security updates, and the whole system that can be reconfigured 2 times a year...
My system (Windows 10 version 1607) continuously runs since 200 days. No reboot, no sleep. Everything works perfectly. Of course it is a personal machine.
I still have made tests in a virtual machine with a more recent build for a bug described on SourceForge, but no major issue for me.
 

7. Is hibernation compatible with the RAMDisk created by the TK? I'm aware that the TK syncs all data in the RAMDisk to the backing file during shutdown/reboot. But if I hibernate, will this cause issues? I currently have hibernate/hybrid sleep disabled, and if the RAMDisk will have issues with it then I will leave it as such. So for me, a shutdown is a true poweroff event, and a reboot is a "regular" reboot, with nothing saved to C:\hiberfil.sys either way. I don't really feel that hibernation is necessary on an SSD, but if I need to use it for say, emergency shutdown while doing something important (i.e. updates, working on my online schooling/Internet marketing projects, etc) then I won't hesitate to enable and use it in a one-off scenario.

 

If you uses hibernation (or the fast startup feature of Windows 8.1/10), Windows writes the ramdisk content to the harddrive.
This is even done with the dynamic ramdisks because RamDyn.exe is started in the session 0 (its user name is "System" in the task manager).
 

8. Are the -hd, -fix, and -rw parameters the TK's defaults when creating a RAMDisk, or should I explicitly specify them. In the case of -hd, I'm not sure if it's necessary to create a dedicated partition within a *.img (to be loaded into RAM).

 

No need to specify these switches, except for some specific scenarios: for instance, if you have a 1440KB image file and you don't want it to be mounted as a floppy drive, then -hd is required.

You should not creeate a partition because, as it is said many times, ImDisk only mounts volumes. However, imdisk.exe can detect partitions in raw image files and mount them with the -v switch (does not work with GPT partitioned disks).


  • Olof Lagerkvist likes this

#3 AnonVendetta

AnonVendetta

    Silver Member

  • Advanced user
  • 655 posts
  • Location:A new beginning.....
  • Interests:Self-development, computing

Posted 29 June 2018 - 12:56 PM

OK, so I read your post and this is where I'm stuck:

 

1. There is a file called RAMDisk.img, located at C:\RAMDisk.img, 1GB in size, and formatted as NTFS. It is empty thusfar. My actual RAMDisk will be bigger (about 4GB), this is for testing. I plan to drop some portable apps in it and see if they are available after reboot. Once I get this finalized and am sure that it is an actual RAMDisk and not simply an image file being mounted but not in RAM, then I will try something more risky, like installing Kaspersky Endpoint Security into the RAMDisk.

 

2. I was thinking of creating junctions, on the off-chance that the environment variables aren't sufficient. A double insurance of sorts, to be sure that the temp directories always go where I want them. Ideally I would want them available as early in the boot process as possible (i.e. identical to normal behavior without temps in a RAMDisk). Just in case something does try to use them.

 

I'm sick and tired of 10's auto-update BS, and all the extra crap they load into the OS, So I'm using Enterprise LTSB N 1607, which is mostly free of cruft, telemetry, etc. Pirated, of course, since I can't afford the license cost, and all the other editions are too bloated for my liking. I'm running it on a $4K Sager gaming laptop. Previously I was running Enterprise 1803, but it had too many issues, like unexplained lag in modern games. Even with 2 NVIDIA GTX 1080s running in SLI, an SSD boot drive, i7-7700K, and 16GB RAM. This is unacceptable, LTSB performs like an ace as it should.

 

. In the GUI I have selected G:\ as my RAMDisk's drive letter and NTFS for the filesystem. The "Launch at Windows startup" box is checked. "Create Temp folder" is unchecked, for now. In the Data tab, I have selected C:\RAMDisk.img. "Sync at system shutdown" and "Delete data removed from the RAMDisk" are checked, "Copy only files with the archive attribute" is unchecked. In the Advanced tab, under Additional Parameters, I am attempting to use the following:

 

-a -t vm -m G: -f C:\RAMDisk.img -P

 

I'm not sure why I'm still getting the "Error: the volume cannot be mounted" issue. Maybe -a needs even more switches?

 

On an unrelated note, since you have posted to help me when you did not have to, without bringing up the past, ehm, shall I say, miscommunication, then I am willing to squash any bad feelings we might have toward each other from past interactions. I was in a weekly meeting with my psychotherapist yesterday, whom I have been seeing by choice for several years and argue with often, but he somehow tolerates me. He brought up a point that my interactions with others might go better if I started viewing people as potential allies rather than adversaries. I thought about it, he does have a point, but this probably won't change the fact that I'm an abrasive asshole, at least not at this point. People rarely change longstanding habits overnight.

 

So.....genuinely.....thanks!



#4 v77

v77

    Silver Member

  • Team Reboot
  • 553 posts
  •  
    France

Posted 29 June 2018 - 05:48 PM

1. There is a file called RAMDisk.img, located at C:\RAMDisk.img, 1GB in size, and formatted as NTFS. It is empty thusfar. My actual RAMDisk will be bigger (about 4GB), this is for testing. I plan to drop some portable apps in it and see if they are available after reboot. Once I get this finalized and am sure that it is an actual RAMDisk and not simply an image file being mounted but not in RAM, then I will try something more risky, like installing Kaspersky Endpoint Security into the RAMDisk.


The synchronization tool of the Toolkit is not meant to be used with the command line tool imdisk.exe.
By the way, to extend a volume, you need to call imdisk.exe a second time with the -e switch.

But there is another issue with the Temp folder. This one (and the volume itself) will not be ready as long as the entire image file is not completely read.
So if you want a Temp folder ready as soon as possible, you should avoid to use an image file.

With the Toolkit, if you have data to load, you should put them in a directory, and specify the latter in "Load Content from Image File or Folder". This way, the Temp folder will be created before loading the data, and only the actual data will be read, which is faster in most cases.
 

2. I was thinking of creating junctions, on the off-chance that the environment variables aren't sufficient. A double insurance of sorts, to be sure that the temp directories always go where I want them. Ideally I would want them available as early in the boot process as possible (i.e. identical to normal behavior without temps in a RAMDisk). Just in case something does try to use them.


Yes of course, you can do both. It should not be a problem.
 

In the Advanced tab, under Additional Parameters, I am attempting to use the following:
 
-a -t vm -m G: -f C:\RAMDisk.img -P
 
I'm not sure why I'm still getting the "Error: the volume cannot be mounted" issue. Maybe -a needs even more switches?


The parameters you add in this field are added to the existing command line used by the GUI. So in your case, you are using 2 times the -a switch.
And the -P switch will conflict with the GUI, because both the driver and the service of the Toolkit (ImDiskRD, located in RamDiskUI.exe) are trying to mount the same volume.

This field is only useful for some specific cases, such as if you want a CD-ROM type for your ramdisk, or if you want to select a partition in an image file...
 

On an unrelated note, since you have posted to help me when you did not have to, without bringing up the past, ehm, shall I say, miscommunication, then I am willing to squash any bad feelings we might have toward each other from past interactions. I was in a weekly meeting with my psychotherapist yesterday, whom I have been seeing by choice for several years and argue with often, but he somehow tolerates me. He brought up a point that my interactions with others might go better if I started viewing people as potential allies rather than adversaries. I thought about it, he does have a point, but this probably won't change the fact that I'm an abrasive asshole, at least not at this point. People rarely change longstanding habits overnight.
 
So.....genuinely.....thanks!


Being an "abrasive asshole" does not prevent to make useful things.
And anyway, this discussion can be helpful to others.

#5 AnonVendetta

AnonVendetta

    Silver Member

  • Advanced user
  • 655 posts
  • Location:A new beginning.....
  • Interests:Self-development, computing

Posted 29 June 2018 - 06:23 PM

@v77: OK, so I understand that loading from an image into RAM may be a bad idea for temp directories. But what about regular installed programs? Will they load slower from an image as well? It seems that you are saying that I should install the programs I want in RAM into a particular folder, then instruct the TK to load that folder into RAM. And then, upon shutting down or rebooting (with hibernation/hybrid sleep still disabled), the TK will sync the data back to the folder that was loaded. Are these correct assumptions? If so, then I can only think of one potential problem:

 

The programs or something else attempts to access that folder before the TK has a chance to fully load it into RAM. Which could result in corrupt data.

 

Or maybe I should stick to installing them to some other location, create a junction that points to the folder that the TK is to load?

 

That is the confusing part for me. Whereas an image file is a discrete object.



#6 v77

v77

    Silver Member

  • Team Reboot
  • 553 posts
  •  
    France

Posted 29 June 2018 - 07:08 PM

If you install programs in the ramdisk, with an image file, you will have nothing as long as the whole image file is not loaded.

And with the Toolkit loading a folder, the volume will be available very soon, but some files could be not yet copied when you start a program on the ramdisk.
In this case, the only way to ensure that everything is loaded is to check the state of the ImDiskRD service, which can be done with the following command (no need to have administrative privileges):
sc query ImDiskRD
You should have a line with:
STATE : 1 STOPPED
Otherwise, it would be:
STATE : 4 RUNNING






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users