• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

The Geek Diary

CONCEPTS | BASICS | HOWTO

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • Linux Services
    • VCS
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Interview Questions
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to Create a tmpfs Filesystem in CentOS/RHEL

By admin

tmpfs are not really used as filesystems, but just take advantage of the filesystem abstraction. Applications can do I/O on a tmpfs. tmpfs functions reside purely in memory.

Creating a tmpfs special filesystem

1. Mount a new instance of tmpfs:

# mkdir /mnt/tmpfs
# mount -t tmpfs none /mnt/tmpfs

Note: Check how much space the filesystem has been given and how much it is using.

# df -h /mnt/tmpfs
Filesystem Size Used Avail Use% Mounted on
none         915M 0    915M 0%    /mnt/tmpfs

2. Once the filesystem is not more needed, unmount the filesystem

# umount /mnt/tmpfs

Conclusion

Virtually, modern Linux distributions mount an instance of tmpfs at /dev/shm.

# df -h /dev/shm
Filesystem Size Used Avail Use% Mounted on
tmpfs 915M 0 915M 0% /dev/shm

To check which instaces of tmpfs is using the system by default:

# df -h | grep tmpfs
devtmpfs 901M 0 901M 0% /dev
tmpfs 915M 0 915M 0% /dev/shm
tmpfs 915M 9.6M 906M 2% /run
tmpfs 915M 0 915M 0% /sys/fs/cgroup
tmpfs 183M 28K 183M 1% /run/user/42
tmpfs 183M 3.5M 180M 2% /run/user/1000
tmpfs 183M 4.0K 183M 1% /run/user/0

Filed Under: Linux

Some more articles you might also be interested in …

  1. How to Configure Multiple Fencing-device Levels in Pacemaker Cluster
  2. RPM : package installation Error : cpio: read failed
  3. How to Disable IPv6 on Ubuntu 18.04 Bionic Beaver Linux
  4. CentOS / RHEL : How to install Open Virtual Machine Tools for Virtual machines Hosted on VMWare
  5. Which network ports are reserved by the Linux Operating System?
  6. CentOS / RHEL 6 : Lock User Account After N Number of Incorrect Login Attempts
  7. What are SELinux Users and how to Map Linux Users to SELinux Users
  8. How to disable a specific command for a specific user in Linux
  9. Understanding the job control commands in Linux – bg, fg and CTRL+Z
  10. How to change the Default Log Directory(/var/log) in Rsyslog for CentOS/RHEL 6,7

You May Also Like

Primary Sidebar

Recent Posts

  • How to disable ACPI in CentOS/RHEL 7
  • How to Use real-time query to access data on a physical standby database
  • CentOS/RHEL 8: “ACPI MEMORY OR I/O RESET_REG” Server Hung after reboot
  • How to Create a Physical Standby Database by Using SQL and RMAN Commands
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary