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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • 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. Linux OS Service ‘yppasswdd’
  2. git annotate: Show commit hash and last author on each line of a file
  3. taskset: command not found
  4. amass enum – Find subdomains of a domain (Command Examples)
  5. dget Command Examples in Linux
  6. grex Command Examples
  7. “git credential” Command Examples
  8. bashmarks: Save and jump to commonly used directories using 1 character commands
  9. rpm: Command Examples in Linux
  10. initctl Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright