Announcement

Collapse
No announcement yet.

How to Automate Mounting and Saving Image File of a RAM Disk?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to Automate Mounting and Saving Image File of a RAM Disk?

    I've read a ton of articles on OSFMount and I finally think I figured out how to use this awesome program. I was able to create a empty RAM disk and format it. Then, I installed caches and a few programs like my PDF editor and Microsoft Office. I saw an immediate explosion in speed. That a great feeling.

    Now the only 2 question I have right now are:

    1. Is there a way to automatically have the RAM disk image be mounted by OSFMount when my computer boots up?

    2. Is there a way to automatically have the RAM disk image be saved when shutting down (I don't know if sleep will erase the RAM)?"

    I found this guy's blog in which he created a program but I actually have no idea what language he is using and where he is putting the code.

    https://dandar3.blogspot.com/2018/05...e-on-boot.html

    Any help, peeps?


  • #2
    1) Yes. There are lot of ways to auto-run programs at boot time in Windows.

    One way is,
    1. Press windows key + r
    2. Copy the run command Shell:startup
    3. It will reach C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup
    4. Create the shortcut of the program you want to run in startup. (this might be a batch file for example that runs OSFMount)
    5. Drag and drop shortcut into the folder.
    6. Restart the computer.

    2) No, at least nothing built into OSFMount

    Comment


    • #3
      For Question #1 (the mounting of the RAM disk image), I'm not sure but doesn't your instructions simply start OSFMount? Don't you still have to mount the image you had saved on your C drive and re-input stuff like what type of drive it is?

      For example, when I shutdown my computer, I go to the Drive actions tab and select Save to image... and dismount the image. I shut down my computer.

      After I log into my computer and start OSFMount, there isn't any RAM drive. I have to go to the File menu and select Mount new virtual disk... Then, I browse for my image on my C drive.

      Is there another way to do this that's completely automatic?


      Has anyone written a script that has automated any of the mounting and dismounting procedure?

      Thanks for any info you can provide.



      Originally posted by David (PassMark) View Post
      1) Yes. There are lot of ways to auto-run programs at boot time in Windows.

      One way is,
      1. Press windows key + r
      2. Copy the run command Shell:startup
      3. It will reach C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup
      4. Create the shortcut of the program you want to run in startup. (this might be a batch file for example that runs OSFMount)
      5. Drag and drop shortcut into the folder.
      6. Restart the computer.

      2) No, at least nothing built into OSFMount

      Comment


      • #4
        There are a bunch of command line arguments you can use with OSFMount to mount an image from the command line.
        They are all documented in the Help file (Which you can get to from the "Help" menu).

        Some examples,
        Mounting a empty RAM disk and format

        osfmount.com -a -t vm -m #: -o format:"RAM Volume" -s 1G
        Mounting an image file as a virtual drive

        osfmount.com -a -t file -f C:\passmark\images\vmdk_split.001 -m #:

        Comment


        • #5
          For mounting I think I may have found a better way. Local Computer Policy (gpedit.msc) > Computer Configuration > Windows Settings > Scripts (Startup / Shutdown). Place the script in the Startup > View files folder (%SYSTEMROOT%\System32\GroupPolicy\Machine\Scripts \Startup)

          David (PassMark)

          A question if I may on the implmentation and difference in performance.
          1. -t vm -f ramdrive.img creates a logical "RAM (Virtual)" type disk, it loads the image and performs very fast in benchmarks.
          2. -t file -f ramdrive.img creates a logical "Disk" type disk, it loads the image, it is able to persist it on shutdown but it appears to perform at the speed of the medium storing the .img file.

          Is the second variant persisting each change on the RAMDrive to the original image file or does it do it at shutdown? From the performance test I would say it persists it with every change rather than at shutdown, is that correct? Thank you.

          Comment


          • #6
            Using the virtual memory "-t vm" option on the command line creates a RAM drive. So the content of the drive is stored in virtual memory. If you have enough free physical RAM, this will be a very fast drive. If you don't have enough free physical RAM, performance will drop off a cliff as the operating system will start swapping to disk. Adding the -f option, pre-loads a disk image into the RAM drive. Once this happens there is no mirroring or backups back into the on disk .img file. So changes to the RAM drive are lost (unless you manually save it). Manually saving a RAM drive back to disk will be slow, as typically disks are pretty slow.

            Using the -t file option means all reads and writes go back into the .img file (the new volume is backed by a file and not by virtual memory). So this is not a RAM drive. But some caching in RAM can still happen. It will generally be a lot slower than a RAM drive. But contents are not lost on demounting.

            There is also a 3rd option which is "-t file+wc". With this option the virtual disk is backed by the '-f' image file and an existing write cache file (.osfdelta). This means the orginal disk image is never modified and all changes get added to a separate delta file. LIMITATIONS: The disk must be mounted using physical emulation option.





            Comment


            • #7
              Thank you David (PassMark), very useful information!

              Comment


              • #8
                Hi, David,

                I looked at the Help file that you referred to. Are there perhaps some additional CLI arguments besides the ones listed in the Help file?

                For example, I notice that there are no CLI arguments to save the contents of the RAM drive to the image file. That would be really helpful.

                Also, I think there was a claim somewhere that OSFMount is the fastest RAM disk program. Is there a source for this claim?

                Thank you.



                Originally posted by David (PassMark) View Post
                There are a bunch of command line arguments you can use with OSFMount to mount an image from the command line.
                They are all documented in the Help file (Which you can get to from the "Help" menu).

                Some examples,
                Mounting a empty RAM disk and format

                osfmount.com -a -t vm -m #: -o format:"RAM Volume" -s 1G
                Mounting an image file as a virtual drive

                osfmount.com -a -t file -f C:\passmark\images\vmdk_split.001 -m #:

                Comment


                • #9
                  I think all the available options are in the help file.

                  We did some benchmarks back in 2019 with Arsenal image mounter (as I don't think there is another other solution that supports the same range of disk image formats).
                  Example below.


                  OSFMount benchmark

                  We also did a benchmark comparison with Softperfect as they were the other fastest solution at the time.

                  OSFMount vs Softperfect ram disk benchmark comparison


                  We haven't redone them in 2020.
                  But it is pretty trivial to run a comparison. So we would encourage people to do their own. Results will probably vary depending on your hardware.




                  Comment


                  • #10
                    Originally posted by David (PassMark) View Post
                    1) Yes. There are lot of ways to auto-run programs at boot time in Windows.

                    One way is,
                    1. Press windows key + r
                    2. Copy the run command Shell:startup
                    3. It will reach C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup
                    4. Create the shortcut of the program you want to run in startup. (this might be a batch file for example that runs OSFMount)
                    5. Drag and drop shortcut into the folder.
                    6. Restart the computer.

                    2) No, at least nothing built into OSFMount
                    This is a problem because when you put a bach script into startup directory then the Windows 10 will display a popup and ask for administrator promt every time I start my computer.
                    It would be better to make the app automount/autostart like it is done in ImDisk .

                    Comment


                    • #11
                      Originally posted by hhprfmxdeifhtxywva_avxrja View Post

                      This is a problem because when you put a bach script into startup directory then the Windows 10 will display a popup and ask for administrator promt every time I start my computer.
                      It would be better to make the app automount/autostart like it is done in ImDisk .
                      Use Windows Task Scheduler to create a task with a trigger at boot or logon and action like:
                      "osfmount.com -a -t file -f C:\passmark\images\vmdk_split.001 -m #"
                      It should ask for the password only when you create the task.

                      However, an option to save the ramdisk to a file from command line seems to be missing.

                      Comment

                      Working...
                      X