Menu

Help requested. I'm using swapadd, automatizing process

2023-11-23
2023-12-28
  • Gus Tarballs

    Gus Tarballs - 2023-11-23

    Hey there folks.

    I'm using swapadd to create a pagefile on a ANS-9010 DRAM SSD.

    the problem is the backup system for ANS-9010 has been disabled. the battery and backup cf card are not present.
    Currently I'm forced to activate the drives format them ( since i'm using dual sata port mode), and after that i launch the batch files, to populate the drives with pagefiles.

    I'd like to automate the process. I alredy handled the swapadd side, as i created shortcuts to cmd.exe and created a scheduled task to launch at logon with parameter:
    /c start "" /High "C:\Windows\System32\swapadd" Z:\pagefile.sys 8300000K 8300000K
    and
    /c start "" /High "C:\Windows\System32\swapadd" Y:\pagefile.sys 8300000K 8300000K

    the task scheduler was configured to run those shortcuts at admin mode, ad it carries out perfectly.
    Now at least when i reboot the computer i don't have to worry about re-running the above scripts.

    However the other problem remained intact. i need to automate the process of formating those two drives (2x8GB ANS-9010 drives in one 5.25" form factor).
    So far I've found out that the only tools for the job are either "disk managment utility" or "diskpart" utility..
    The Disk Managment utility is kind of hard to work around for automation, since it is a GUI application.
    Diskpart on the other hand, is commandline utility and it supports scripts,

    this is how far i've got, however I have no idea how to create a proper script for the diskpart.
    I only know that the select disk # can't be an automated process, since my system sometimes detects te driives as disk 0 and disk 1 and other times they are visible to the system as disk 2 and disk 3, so given such circumstances it is not possible to make a full unattended script. i thought o a script that pauses somehow on the disk selection and after i select the disk properly the formatting would continue.

    the drives must be formated: MBR/NTFS/allocation unit size 4096 bytes/full size/set to active, and initiated each time before formatting. this is tedious task to do by hand as i have to do this each time i startup my PC.

    Does anyone have any suggestions on how to tackle this?

     
  • Gus Tarballs

    Gus Tarballs - 2023-11-23

    oh yeah forgot to mention: currently i handle this by hand with the windows Disk Managment utility.. Unfortuneatly i have no idea how to solve this the diskpart way..

     
  • Danish Bronco

    Danish Bronco - 2023-12-15

    Have you try to split the operation into two different steps, one to mount the drives, and the other to create a pagefile on them?

    That's what I do. I have created one scheduled task that creates a RAM drive, and another that installs the pagefile on it.

    Step 1: imdisk -a -s 4095M -m P: -p "/fs:fat /q /y"

    Step 2: swapadd P:\pagefile.sys 1024M 4095M

     
  • Gus Tarballs

    Gus Tarballs - 2023-12-28

    no I did not meant to ceate a Ramdisk with ImDisk but rather automatization of formating of a DRAM SSD. That is a physical 5.25" form factor drive that consists of 8x2GB ECC DDR2 800MT downclocked to 400MT ram sticks.

    I wanted to use windows diskpart command, however automatization is a it tricky as my mobo sometimes detect the drives as 0 and 1 and sometimes as 2 and 3, so chances are i might format my OS drive by accident. Hence why i seek assistance, on the code.

    I already tackled the pagefile part. it is set to automatically start at log-on in task scheduler.
    i did not use .bat files but instead used cmd.exe's start command to start swapadd with parameters from a shortcut to cmd.exe

     

Log in to post a comment.