LinuxLinux has the native ability to support two filesystem types that allow for RAM-based storage: ramfs and tmpfs. A RAM disk can give faster-than-SSD read and write speeds ideally suited for applications that rely heavily on cached data.

The key difference between ramfs and tmpfs is that ramfs does not take a maximum capacity, which could potentially give us problems, so we will be looking at tmpfs. The volatile nature of random access memory makes this configuration a no-go for storing anything important and you should keep in mind that that all data will be lost in a reboot or if the device is unmounted.

Get an idea of your current RAM usage by using the free -h command. First we will make a mount point for our file system, we’ll go with /mnt/ramdisk. The next command will mount a 1 GB EXT4 filesystem to /mnt/ramdisk; however, the amount you choose should be appropriate to your system and hardware.

mkdir /mnt/ramdisk<br>
mount -t tmpfs -o size=1024m ext4 /mnt/ramdisk

Since this will disappear after every reboot we can add the same mount command to our /etc/rc.local file to have it created on boot.

 

About Canadian Web Hosting

Since 1998, Canadian Web Hosting has been providing on-demand hosting solutions that include Shared HostingVirtual Private Servers (VPS), Cloud HostingDedicated Servers, and Infrastructure as a Service (IaaS) for Canadian companies of all sizes. Canadian Web Hosting is SSAE 16 Type II SOC 2 certified, ensuring that their processes and business practices are thoroughly audited against industry standards. Canadian Web Hosting guarantees a 100% network uptime, and a total money-back guarantee that backs everything they do. Customers can get help by calling 1-888-821-7888 to get 24/7 support. For more information, visit them at www.canadianwebhosting.com, or get the latest news by following them on Twitter at @cawebhosting.