PLCnext on LinkedInPLCnext on Instagram  PLCnext on YouTube Github PLCnext CommunityStore PLCnext Community


 How to create a Blog Entry

Creating a RAM disk in the AXC F 2152

The AXC F 2152 has 512 Mb RAM. Of this the OS is using a part of it but there is still a lot which is not used. This free space could be used for a RAM drive. Unlike the SD-Card the RAM drive has no limitations in reading and writing. Therefore it could be very useful for tasks which have a lot of reading and writing, e.g. a Datalogger. The downside of the RAM drive is that everything on it is gone after a restart/reboot of the controller. So it would be a good idea to have a backup solution for the data. 


It is necessary to create a folder where the RAM disk can be mounted. In this example I would like to place it in the /opt/plcnext/ folder. I log on to the controller and create the folder.

$ mkdir ramdisk


When the folder is created, it is possible to attach the RAM drive to the folder. To do that a line is added to the file "fstab". The file is located in the folder /etc. It is only possible to edit the file when you are logged in as "root"

So with this on your terminal "root@axcf2152:/etc#". Write the command 
$ nano fstab

In the nano editor the line with the settings for our RAM drive is now added.

tmpfs                /opt/plcnext/ramdisk tmpfs      defaults,size=20%     0  0


After the line is added to the file, save it and reboot the controller. After the reboot it is now possible to check that the RAM drive is attached to the folder, and also to see the actual size of it.

ls df


# mboers 2019-02-22 16:08
Very useful feature!