{"id":6672,"date":"2017-05-08T12:34:59","date_gmt":"2017-05-08T04:34:59","guid":{"rendered":"http:\/\/rmohan.com\/?p=6672"},"modified":"2017-05-08T12:34:59","modified_gmt":"2017-05-08T04:34:59","slug":"why-centos-rhel-7-have-many-tmpfs-6-tmpfs-filesystem-and-what-is-their-purpose","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=6672","title":{"rendered":"Why CentOS \/ RHEL 7 have many tmpfs (6 tmpfs filesystem), and what is their purpose"},"content":{"rendered":"<p>Question: Why CentOS 7 \/ RHEL 7 have many tmpfs (6 tmpfs filesystem), are these tmpfs mandatory for OS? What are the mount \/run\/user\/1000, \/run\/user\/0, \/run\/user\/45, \/sys\/fs\/cgroup for?<\/p>\n<p>Answer:<\/p>\n<p>If you run df -hP in RHEL 7 system you would find many tmpfs file systems mounted.<\/p>\n<p># df -hP<br \/>\nFilesystem                     Size  Used Avail Use% Mounted on<br \/>\n\/dev\/mapper\/vg_os-lv_root      296G   33G  248G  12% \/<br \/>\ndevtmpfs                       126G     0  126G   0% \/dev<br \/>\ntmpfs                          126G  631M  126G   1% \/dev\/shm<br \/>\ntmpfs                          126G  1.3G  125G   2% \/run<br \/>\ntmpfs                          126G     0  126G   0% \/sys\/fs\/cgroup<br \/>\n\/dev\/sda1                      976M  112M  797M  13% \/boot<br \/>\ntmpfs                           26G     0   26G   0% \/run\/user\/0<br \/>\ntmpfs                           26G     0   26G   0% \/run\/user\/5006<br \/>\ntmpfs \t\t\t\t9.5G\t68K 9.5G  1% \/run\/user\/1000<br \/>\ntmpfs is a temporary filesystem that resides in memory and\/or your swap partition(s), depending on how much you fill it up.<br \/>\nMounting directories as tmpfs can be an effective way of speeding up accesses to their files, or to ensure that their contents are automatically cleared upon reboot.<\/p>\n<p>\/dev<\/p>\n<p>\/dev contains device files which are created and removed automatically by the udev daemon, as hardware is added or removed etc.<br \/>\n(devtmps is just a tmpfs that was created specially by the kernel early in the boot process, which contains the core devices pre-created so that the boot process has something to work with before udevd is loaded.)<\/p>\n<p>\/dev\/shm<\/p>\n<p>\/dev\/shm is used by the POSIX shared memory facilities.<\/p>\n<p>\/run<\/p>\n<p>\/run contains resource locks and PID files etc. which are relevant to currently-running daemons. \/var\/run and \/var\/lock are symlinks back to \/run for compatibility reasons.<\/p>\n<p>\/media<\/p>\n<p>\/media contains the mount-points of removable media (e.g. optical discs and USB drives), which are created and removed automatically.<\/p>\n<p>\/sys\/fs\/cgroup<\/p>\n<p>\/sys\/fs\/cgroup contains details for the cgroup system, which is used (mainly by systemd) to divide processes into groups for resource sharing etc.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Question: Why CentOS 7 \/ RHEL 7 have many tmpfs (6 tmpfs filesystem), are these tmpfs mandatory for OS? What are the mount \/run\/user\/1000, \/run\/user\/0, \/run\/user\/45, \/sys\/fs\/cgroup for?<\/p>\n<p>Answer:<\/p>\n<p>If you run df -hP in RHEL 7 system you would find many tmpfs file systems mounted.<\/p>\n<p># df -hP Filesystem Size Used Avail Use% Mounted [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[73],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6672"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6672"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6672\/revisions"}],"predecessor-version":[{"id":6673,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6672\/revisions\/6673"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6672"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6672"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6672"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}