RAM disk
- RAM Disk is a portion which is used like physical storage.
- any data stored on RAM disk is lost when system is shut down or powered off, So RAM disk is great place to put the temporary data.
- Generally, RAM based file system is two types. one is rampfs, the other is tmpfs.
command to make RAMdisk on CentOS 7
$ mount -t tmpfs -o size=2G tmpfs /directory position
for example
$ mkdir ramdisk
$ mount -t tmpfs -o size=2G tmpfs ./ramdisk
What is the differenc between ramdfs and tmpfs
Primarily both ramfs and tmpfs does the same thing with few minor difference.
-
RAMFS will grow dynamically : So you need control the process that wirtes the date to make sure ramfs doesn’t go above the abailable RAM size in the system.
-
Tmpfs will not grow up dynamically : It would not allow you to write more that the size you’ve specified while mounting the tmpfs.
-
Tmpfs uses Swap
-
but RAMFS doesn’t use swap
procedure after getting a new device
- this is juse option, you have to get partition from a storage device.
fdisk or anther command
- you have to make file system format.
mkfs
- and then you have to mount device some directory.
mount
Appendix
Just I found out mkramdisk command on IBM AIX
But I cannot find that command in CentOS 7
$ mkramdisk
bash: mkramdisk: command not found...