Jump to content

Documentation:RAMDISK

From UBC Wiki

A RAMDISK can be used to artificially consume RAM on a server when it is beneficial to simulate low RAM scenario for experiments.

Use a similar procedure as follows:

mkdir /mnt/ramdisk
mount -t ramfs -o size=180GB ext4 /mnt/ramdisk
# Create a 160GB file on ramdisk
dd < /dev/zero bs=1048576 count=163840 > /mnt/ramdisk/testfile 

This will create a disk of 160GiB (163840*1048576/(1024*1024*1024)=160)

Tune the block size and count for a different size. Be particularly careful with the use of dd, improper use can lead to data destruction. Additionally, making the RAMDISK too large can lead to server crash.