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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • 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 Boot into Rescue Mode or Emergency Mode Through Systemd in CentOS/RHEL 7 and 8
  2. avahi-browse: command not found
  3. How to use Exit Codes in Conditional Statements in Shell Scripts
  4. Understanding multipath Utility to Configure DM-Multipath
  5. CentOS / RHEL 7 : How to configure VLAN Tagging using nmcli
  6. CentOS / RHEL : How to install a specific version of rpm package using YUM
  7. rpcclient Command Examples in Linux
  8. rankmirrors Command Examples in Linux
  9. sar: command not found
  10. jpegtran Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • batch: Execute commands at a later time when the system load levels permit
  • bat: Print and concatenate files
  • bastet: Clone of the game Tetris in the terminal
  • bashmarks: Save and jump to commonly used directories using 1 character commands

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright