No announcement yet.

OSFMount CLI Make Removable Media

  • Filter
  • Time
  • Show
Clear All
new posts

  • OSFMount CLI Make Removable Media


    I am trying to automate a fairly simple process with the OSFMount CLI to execute on Windows boot, but running into a snag that causes me to always having to manually take the last step. Hoping someone here can help me figure this one out.

    I already have a batch script working that automatically mounts an empty RAM Disk with a specified drive letter, and formats it as FAT32, which is awesome.

    I am now trying to also make this RAM Drive a removable media via CLI, but I can't get it to work.

    Here is the script I use, note the 2nd option ",rem" behind the -o flag that is resulting in an error.

    @Echo OFF
    "%PROGRAMFILES%\OSFMount\" -a -t vm -s %RAMDISK_SIZE% -o format:fat32:"%RAMDISK_LABEL%",rem -m "%RAMDISK_DRIVE%
    I realized that "rem" is also used for comments in batch scripts (oh boy Microsoft), but not sure if that's the only problem here.
    The error I get with the script above:

    Creating device...
    Created device 5: S: -> VM image
    Formatting drive with volume label RAM Disk
    Unknown Error encountered during formatting of RAM Disk. Manual format may be necessary.
    Unknown Error encountered during formatting of RAM Disk.
    Manual format may be necessary after disk is mounted.
    The volume does not contain a recognized file system.
    Please make sure that all required file system drivers are loaded and that the volume is not corrupted.​
    I'd appreciate any help!
    Last edited by osfuser1337; Aug-21-2023, 06:32 PM. Reason: Fix @Echo within code tags

  • #2
    Yes, there might be a bug when using the command line for create and format a RAM drive with the removable attribute set.
    Seems to work OK without the removable attribute however. Also seem to work OK from the GUI.

    Removable attribute was really only used with flash drives and floppy disk, where the user might suddenly remove the media before a cached write took place. Any reason you think you need it for a RAM drive?


    • #3
      Good to know, thanks!

      Correct, currently I do it manually through the UI after running the script to create the drive.

      Unfortunately, the internal tool I use the RAM drives with requires them to have the removable attribute set otherwise it won't read from them.


      • #4
        We add it to our to do list to eventually get it fixed. But it isn't a high priority as it is super niche.
        Is this was for business use and you need an immediate solution, we could provide a quote for custom software development and get it fixed in a few days.


        • #5
          That's great, thank you. And yes, understandable. It helps me to know that this is just a limitation at the moment.
          Yes, it is for business use, but I doubt I would get very far trying to get approval
          I appreciate the offer though, and thanks again for the help!