Creating a Ramdisk on Linux

0
1229
Ram

A ramdisk is a tiny, virtual drive that is part of the working memory. This memory is called RAM. Storage space is occupied dynamically and statically. This file system is mounted and formatted before. The storage space is diverted and can not be reached by the system.

The volatile memory The ramdisk

For Linux, the ramdisk is important for a fast read and write process. So this is less affected by wear, like a normal hard drive or even a flash memory. A busy CPU or a slow network connection can of course stop the disk. Deletion problems under file systems, such as ext3 or ext4, can even be circumvented. The precarious files are not copied to the hard disk, but stored in the file system, so the ramdisk. Note that the files should not land on the hard disk. Some files are stored without being asked. Different ways can be used to create a RAM disk.

speed ufo

The different possibilities

The first way would be to create a ramdisk with a tmps file system. This is not a complete RAM system, but can also store data on the hard disk. So the memory on the ramdisk can not be too tight. If it is empty drive it can not consume memory on the disk either. At startup these partitions can be included.
The second way is to format the hard disk. This allows an area to be selected as a RAM disk. An option -m0 should ensure that no space is reserved on the root user. This would take away space. Effectively, the system resources should be deprived. So the memory is smaller with the partitions. The goal is a ramdisk that can not be read or written, but has corrections. This must probably be granted. The size of the ramdisk can be called up and changed with special commands. Each time the computer restarts, the disk disappears, so a script should be created to store the commands. So the commands do not have to be typed again.
The third way is to work with the ramfs file system. This differs from the tmpfs file system in that the swap data is swapped out. This also makes the creation easy. The disk is dynamically resized and the partition is always mounted at system startup. This can be prevented with the editor and the root rights.

The RAM disk sizes

Each of the ram disks created can be kept different in size. This is different for everyone. The system should be available as sufficient memory, and swap space, or SWAP, should also be accessible. That would slow down the speed of the RAM disk. 1GB RAM should often suffice.

Instructions for Linux can be found in the article Ramdisk to accelerate amavis under Linux.

LEAVE AN ANSWER

Please enter your comment!
Please enter your name here