{"id":5779,"date":"2016-11-19T21:49:17","date_gmt":"2016-11-19T12:19:17","guid":{"rendered":"https:\/\/agix.com.au\/?p=5779"},"modified":"2022-06-02T12:33:35","modified_gmt":"2022-06-02T03:03:35","slug":"set-inode-limit-etcfstab-tmpfs-centos-redhat-server","status":"publish","type":"post","link":"https:\/\/agix.com.au\/set-inode-limit-etcfstab-tmpfs-centos-redhat-server\/","title":{"rendered":"Set the inode limit in \/etc\/fstab for tmpfs on a CentOS or Redhat server"},"content":{"rendered":"

This article explains how to set the inode limit on a tmpfs on a CentOS or RHEL server. The default inode limit may be too small if you intend to store many small files on it. <\/p>\n

The following will set the tmpfs resource to 2GB with a default inode limit (nr_inodes=174837). The inode limit is calculated based on the size you specify. <\/p>\n

\ntmpfs \t\t\t\/var\/mytmpfs \ttmpfs \tdefaults,size=2048m,nr_inodes=174837 \t0 0\n<\/pre>\n

By changing the “nr_inodes=174837” to be “nr_inodes=1748370” we’ve changed it by a factor of 10. And there fore can fit 10 times more files on it assuming there’s space. <\/p>\n

Note the extra “0” at the end of the “nr_inodes” value in the following example:<\/p>\n

\ntmpfs \t\t\t\/var\/mytmpfs \ttmpfs \tdefaults,size=2048m,nr_inodes=1748370 \t0 0\n<\/pre>\n

Make sure that “\/var\/myrmpfs” exists before mounting the above tmpfs resource. <\/p>\n

You can now umount and mount the above resource to see it take effect. <\/p>\n

TIP: always do the mount first to make sure it works. You don’t want to test this for the first time by rebooting the server because if you’ve made a mistake, you will have a hard time booting into the OS. <\/p>\n","protected":false},"excerpt":{"rendered":"

This article explains how to set the inode limit on a tmpfs on a CentOS or RHEL server. The default inode limit may be too small if you intend to store many small files on it. The following will set the tmpfs resource to 2GB with a default inode limit<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[3,115,114],"tags":[],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/agix.com.au\/wp-json\/wp\/v2\/posts\/5779"}],"collection":[{"href":"https:\/\/agix.com.au\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/agix.com.au\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/agix.com.au\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/agix.com.au\/wp-json\/wp\/v2\/comments?post=5779"}],"version-history":[{"count":1,"href":"https:\/\/agix.com.au\/wp-json\/wp\/v2\/posts\/5779\/revisions"}],"predecessor-version":[{"id":6656,"href":"https:\/\/agix.com.au\/wp-json\/wp\/v2\/posts\/5779\/revisions\/6656"}],"wp:attachment":[{"href":"https:\/\/agix.com.au\/wp-json\/wp\/v2\/media?parent=5779"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/agix.com.au\/wp-json\/wp\/v2\/categories?post=5779"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/agix.com.au\/wp-json\/wp\/v2\/tags?post=5779"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}