Menu

How to create dynamic ramdisk with AWE in command line?

2022-09-02
2022-10-28
  • Ricky Dicky

    Ricky Dicky - 2022-09-02

    I have been using ImDisk ramdisk for several months on this computer. But yesterday when I launched RamDiskUI.exe, nothing shows up. Then I reinstalled ImDisk and the issue is still here.
    I'm now trying to use RamDyn.exe to create ramdisk instead. But the Syntax GUI doesn't exactly provide a clear instruction about the syntax required.
    I tried this command in cmd, but the command just returns without any effect and error.
    RamDyn.exe N: 1000k -1 10 10 1 12

     
  • v77

    v77 - 2022-09-02

    You should read again the syntax help. For instance, "1000k": there is a non-numeric character, so this is the name of an image file.
    You set "-1" as CleanRatio, which means you want to use the TRIM commands. In this case, the next parameter is PhysicalMemory, which should be 0 or 1.
    And finally, you need to ensure you have the proper privilege in the group policy (which can be done with RamDiskUI):
    https://docs.microsoft.com/windows/security/threat-protection/security-policy-settings/lock-pages-in-memory

    But the true question would rather be: why do you say "when I launched RamDiskUI.exe, nothing shows up"? What do you mean exactly?


    RamDyn.exe MountPoint Size|ImageFile CleanRatio|TRIM [CleanTimer CleanMaxActivity] PhysicalMemory BlockSize AddParam

    • MountPoint: a drive letter followed by a colon, or the full path to an empty NTFS folder.
    • Size|ImageFile: size of the volume, in KB. With at least one non-numeric character, it is assumed to be the name of an image file to load. 0 triggers the cleanup function for the specified mount point, if TRIM is not used (following parameters are ignored).
    • CleanRatio: with -1, TRIM commands are used in replacement of the cleanup function, and the 2 following parameters are not used; otherwise, it's an approximate ratio, per 1000, of the total drive space from which the cleanup function attempts to free the memory of the deleted files (default: 10).
    • CleanTimer: minimal time between 2 cleanups (default: 10).
    • CleanMaxActivity: the cleanup function waits until reads and writes are below this value, in MB/s (default: 10).
    • PhysicalMemory: use 0 for allocating virtual memory, 1 for allocating physical memory (default: 0); allocating physical memory requires the privilege to lock pages in memory in the local group policy.
    • BlockSize: size of memory blocks, in power of 2, from 12 (4 KB) to 30 (1 GB) (default: 20).
    • AddParam: additional parameters to pass to imdisk.exe. Use double-quotes for zero or several parameters.

     

    Last edit: v77 2022-09-02
    • Ricky Dicky

      Ricky Dicky - 2022-09-03

      I added my user account to the group policy "Lock pages in memory" and then tried these 2 commands, but strangely it just runs the Syntax windows without creating the ramdisk.
      RamDyn.exe N: 10000 -1 0 12
      RamDyn.exe N: 10000 -1 1 12

      About the issue I had with RamDiskUI.exe:
      ImDisk had been working fine for past few months. I don't usually launch the UI since the ramdisk works fine after boot.
      But yesterday when I ran the UI, no window shows up. At that point the ramdisk was still working, but I reinstalled ImDisk entirely to try to get the UI working.
      Now the UI still won't show up after I run the shortcut or the exe directly, and I'm trying to set up ramdisk with command line instead.
      My Windows 10 version is 21H2. Not sure what went wrong.

       
  • v77

    v77 - 2022-09-03

    The last parameter is missing. As said in the syntax help, even for 0 argument to pass to imdisk.exe, you must add "".

    About the missing GUI, I see 2 cases that could explain that:
    - Something has modified the context menu of .exe files. When you right-click on a .exe file, do you still have "Run as administrator"?
    In an elevated command prompt, in the installation folder, try the following command:
    RamDiskUI.exe UAC 0
    - An antivirus is interfering. Did you try to disable it?

     
  • Ricky Dicky

    Ricky Dicky - 2022-09-03

    RamDyn.exe N: 10000 -1 1 12 ""
    This command works. Thanks.

    The context menu for .exe has "Run as administrator".
    I only use Microsoft Defender. I tried disabling it and launch RamDiskUI, but it didn't work.

    If I run RamDiskUI.exe UAC 0 with admin privilege, the UI shows up without issue.
    If I run the command without admin privilege, an error window pops up, saying "Error: cannot create service". Then after clicking OK on this window, the UI shows up.
    If I run RamDiskUI without any argument, it doesn't open.

     
  • v77

    v77 - 2022-09-03

    OK, thanks for testing.
    RamDiskUI calls the UAC through an internal call to the context menu. There must be something wrong in your configuration about that.
    This technique has the advantage to call the UAC only when it is required. This technique is rather common, is documented and still work on Windows 11:
    https://docs.microsoft.com/windows/win32/api/shellapi/nf-shellapi-shellexecutew#runas

    I could try to avoid that, but it will require some time and I am not sure to get all I want.

     
  • absolutely not

    absolutely not - 2022-10-28

    I have no issues with RamDiskUI, but wanted to create an additional dynamically allocated ramdisk for testing purposes. I added my user to the "Lock pages in memory" policy and ran

    "C:\Program Files\ImDisk\RamDyn.exe" S: 1048576 -1 1 12 ""

    from both normal and elevated command prompts, but nothing seems to happen. I don't see an additional device with imdisk -l anyway. Is it because I already have a ramdisk configured and running through RamDynUI? Or am I missing something else?

    Or is there a way to create a dynamically allocated, Physical Memory backed ramdisk through imdisk command line tool? Thanks.

     
    • v77

      v77 - 2022-10-28

      Your command works. But as said in the GUI, after the privilege granted in the group policy, a logout is required for this change to take effect.
      If it still does not work, try to add the Administrators group instead of your current user.

       
      • absolutely not

        absolutely not - 2022-10-28

        Thanks, I missed the requirement to log out.

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.