Create and test speed of RAM disk on Ubuntu Linux

Make a Simple RAM disk:

Create the directory location you want to mount:
mkdir /media/ram
mount -t tmpfs -o size=1G tmpfs /media/ram/

Test how fast it is to write to it:
dd if=/dev/zero of=/media/ram/zero bs=4k count=10000

Test how fast it is to read from it:
dd if=/media/ram/zero of=/dev/null bs=4k count=10000

Remove your test file:
rm /media/ram/zero

If you want to create it again when you reboot:
vi /etc/fstab
none /media/ram tmpfs defaults,size=1G 0 0

If you were really looking for a way to test a regular hard disk:
gnome-disks
http://askubuntu.com/questions/87035/how-to-check-hard-disk-performance

2 comments:

Rauls said...

Great post, man! Thanks!

Jabacoder said...

Simple and fast! Super!