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:NTFS:"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:NTFS:"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


                      • #12
                        Originally posted by David (PassMark) View Post
                        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.



                        I can verify that. I tried it with a bunch of ramdisks,and it was neck in neck with Asus ROG Ramdisk,, but OSFMount offers a few more options. I posted my results here, although I tried it on different amounts of memory, so the results may seem skewed.

                        I've been trying to create a ramdisk with the commands above, but it isn't working for me, what command do I run to create a 15GB ramdrive,formatted as FAT32, with a logical partition, with the letter A? Thanks in advance,and thanks again for making this awesome software.

                        Comment


                        • #13
                          Thanks for the post ibay770, but there are a bunch of problems with your test method.
                          1. You switched between different versions of Crystal Disk Mark. Some tests were with V8 and some with V7
                          2. You picked a different number of test threads. Sometime 5 threads and sometimes 1 thread.
                          3. You picked different file sizes for the test (8GB, 2GB, 1GB, etc..).
                          4. The size of the RAM drives you created are different for each product tested.
                          5. You used different file systems when formatting the RAM drives.
                          6. There was no information on the test hardware you were using. Was it even the same hardware for each test?
                          So all this kind of ruins the comparisons. It isn't apples to apples.

                          Comment


                          • #14
                            True, I'll have to retry it, sorry for the inconsistancy/

                            Comment


                            • #15
                              I use the RAM disk of ImDisk Toolkit for some years now. That program has integrated options for both a) autostart and b) temp variables. So my system always starts with the temp folder on the RAM disk. Yesterday, I read an article about a new version of OSFmount and wanted to give it a try.

                              The good news is: OSFmount is faster than ImDisk. The following grapics show CrystalDiskMark 8.0.4 with the SSD (C), ImDisk (R) and OSFmount (S):

                              SSD
                              Click image for larger version  Name:	ssd.jpg Views:	4 Size:	58.9 KB ID:	56261

                              ImDisk
                              Click image for larger version  Name:	imdisk.jpg Views:	4 Size:	57.4 KB ID:	56262

                              OSFMount
                              Click image for larger version  Name:	osfmount.jpg Views:	4 Size:	59.4 KB ID:	56263
                              Actually, I started the three tests with osf and made a fourth test again with osf - with the same reslts. Yes, osf is really faster.

                              Now the bad news: osf has no autostart option - neither for the RAM disk itself nor for the temp variables. And that led me to this thread.
                              Interestingly, the command line arguments did not work. It only showed the help instructions how to use the command line arguments. I tried the arguments mentioned here (copy + paste) and also some variations.
                              It made no difference whether a batch file was used or Win+R or cmd or PowerShell (admin or not).​ A pity.
                              Attached Files

                              Comment

                              Working...
                              X