How to Create a RAM Disk on Windows Server?

A RAM disk is a digital disk created in a free space of the reminiscence (RAM) that it sees by the OS as a separate bodily disk. Due to the RAM disk being saved within the quick RAM, all learn/write operations on this disk are carried out nearly instantaneously, even sooner than when utilizing an SSD (the info switch pace of the best SSDs is about 560 MB/s, whereas DDR4 reminiscence – 12,000-25,000 MB/s.)

It is beneficial to use a RAM disk in techniques with an extra of free reminiscence. You can use the RAM disk to place the cache or momentary information of apps/system, momentary SQL databases. Thus you’ll be able to obtain a vital improve within the functions and databases efficiency.

In Windows OS, there aren’t any built-in instruments to create RAM disks, so you’ve gotten to use third-party software program to do it (AMD RAMDisk, ImDisk, PassMark OSFMount, StarWind RAM Disk, and many others.).

However, you’ll be able to create a RAM disk in Windows Server with out utilizing any third-party apps. To do it, you should use the iSCSI driver.

First, set up the iSCSI Target Server part (it’s the a part of the File and Storage Services function).

If you’ve gotten Windows Firewall enabled, you should permit iSCSI Service site visitors.

To permit site visitors to the loopback interface for iSCSI, change the worth of the DWORD parameter AllowLoopBack to 1 within the HKLMSoftwareMicrosoftiSCSI Target registry key. You can utilizing a single command:

Set-ItemProperty -Path 'HKLM:SOFTWAREMicrosoftiSCSI Target' -Name AllowLoopBack -Value 1

Now open the PowerShell console and create a 5 GB digital RAM disk utilizing this command:

New-IscsiVirtualDisk -Path "ramdisk:testRAM.vhdx" -Size 5GB

Now you want to create an iSCSI goal pointing to the IP deal with of your server (not localhost!):

New-IscsiServerTarget -TargetName targetRAMDisk -InitiatorIds @("IPAddress:")

Connect the RAM disk to the created iSCSI goal:

Add-IscsiVirtualDiskTargetMapping -TargetName targetRAMDisk -GadgetPath "ramdisk:testRAM.vhdx"

Run the iSCSI Initiator administration console by way of Server Manager.

Specify the IP deal with of your server within the Targets tab and click on Quick Connect to add your iSCSI goal.

You can join the iSCSI Target with the command:

Get-IscsiTarget | Connect-IscsiTarget

Open the Disk Management console and make it possible for the brand new 5 GB disk appeared there. This is the RAM disk we created. Initialize the disk, create a partition and format it. Assign a disk letter to it.

You can initialize a RAM disk and assign it a drive letter utilizing the PowerShell cmdlets from the built-in with a following one-liner:

Get-Disk | Where partitionstyle -eq 'uncooked' | Initialize-Disk -PartitionModel MBR -PassThru | New-Partition -AssignDriveLetter -UseMaximumSize | Format-Volume -FileSystem NTFS -NewFileSystemLabel "disk2" -Confirm:$false

Now you’ll be able to transfer app information to the RAM disk and reconfigure your software program to use it.

After rebooting the server, the RAM disk is eliminated with all its contents and you should have to re-create it once more.

Some third-party packages that create RAM disks permit saving RAM disk information as a file on your arduous drive. When the system is restarted, the info are extracted and moved to the RAM disk.

To take away your RAM disk, use the next instructions:

Remove-IscsiVirtualDiskTargetMapping -TargetName targetRAMDisk -GadgetPath "ramdisk:testRAM.vhdx"
Remove-IscsiServerTarget -TargetName targetRAMDisk
Remove-IscsiVirtualDisk -Path "ramdisk:testRAM.vhdx"

Check Also

How to Use Native SSH Client in Windows 10?

The built-in SSH shopper appeared in Windows 10 and Windows Server 2019. Ssh.exe can be …

Leave a Reply

Your email address will not be published. Required fields are marked *