Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use tmpfs memory File system in Linux

2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you how to use the tmpfs memory file system in Linux, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

Brief introduction

Tmpfs is a virtual memory file system, not a block device. Is a memory-based file system that is created without initialization such as mkfs.

Because it is all in memory, after reboot, the data will not be dropped, but it is good and fast in memory, so now some Linux distributions mount the / tmp directory to tmpfs by default.

The default mount size is half of the physical memory, or you can specify the size manually

Mounting

You can mount it directly by using the mount command

Mount tmpfs-t tmpfs-o size=2G-o mode=1777 / tmp

You need to write to / etc/fstab when you start up and mount automatically.

Tmpfs / tmp tmpfs defaults,noatime,mode=1777,size=2G 0 0

For a specific mount directory, you can mount it according to the actual situation. The / tmp directory only needs 1777 permission. If it is a directory for other purposes, you can specify other lower permissions.

Dynamic capacity expansion

If it is already being mounted, you can use remount to expand the capacity to ensure that the original data will not be lost.

Mount tmpfs-t tmpfs-o size=4G-o remount / data/tmp is all the contents of the article "how to use tmpfs memory File system in Linux". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report