{
    "content": [
        {
            "type": "text",
            "text": "# tmpfs (man)\n\n## NAME\n\ntmpfs - a virtual memory filesystem\n\n## DESCRIPTION\n\nThe  tmpfs  facility allows the creation of filesystems whose contents reside in virtual mem‐\nory.  Since the files on such filesystems typically reside in RAM, file access  is  extremely\nfast.\n\n## Sections\n\n- **NAME**\n- **DESCRIPTION** (1 subsections)\n- **VERSIONS**\n- **NOTES**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "tmpfs",
        "section": "",
        "mode": "man",
        "summary": "tmpfs - a virtual memory filesystem",
        "synopsis": null,
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [
            {
                "name": "df",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/df/1/json"
            },
            {
                "name": "du",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/du/1/json"
            },
            {
                "name": "memfdcreate",
                "section": "2",
                "url": "https://www.chedong.com/phpMan.php/man/memfdcreate/2/json"
            },
            {
                "name": "mmap",
                "section": "2",
                "url": "https://www.chedong.com/phpMan.php/man/mmap/2/json"
            },
            {
                "name": "setmempolicy",
                "section": "2",
                "url": "https://www.chedong.com/phpMan.php/man/setmempolicy/2/json"
            },
            {
                "name": "shmopen",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/shmopen/3/json"
            },
            {
                "name": "mount",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/mount/8/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 21,
                "subsections": [
                    {
                        "name": "Mount options",
                        "lines": 86
                    }
                ]
            },
            {
                "name": "VERSIONS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "NOTES",
                "lines": 19,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 6,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "tmpfs - a virtual memory filesystem\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "The  tmpfs  facility allows the creation of filesystems whose contents reside in virtual mem‐\nory.  Since the files on such filesystems typically reside in RAM, file access  is  extremely\nfast.\n\nThe  filesystem is automatically created when mounting a filesystem with the type tmpfs via a\ncommand such as the following:\n\n$ sudo mount -t tmpfs -o size=10M tmpfs /mnt/mytmpfs\n\nA tmpfs filesystem has the following properties:\n\n•  The filesystem can employ swap space when physical memory pressure demands it.\n\n•  The filesystem consumes only as much physical memory and swap  space  as  is  required  to\nstore the current contents of the filesystem.\n\n•  During a remount operation (mount -o remount), the filesystem size can be changed (without\nlosing the existing contents of the filesystem).\n\nIf a tmpfs filesystem is unmounted, its contents are discarded (lost).\n",
                "subsections": [
                    {
                        "name": "Mount options",
                        "content": "The tmpfs filesystem supports the following mount options:\n\nsize=bytes\nSpecify an upper limit on the size of the filesystem.  The size is given in bytes, and\nrounded up to entire pages.  The limit is removed if the size is 0.\n\nThe  size may have a k, m, or g suffix for Ki, Mi, Gi (binary kilo (kibi), binary mega\n(mebi), and binary giga (gibi)).\n\nThe size may also have a % suffix to limit this instance to a percentage  of  physical\nRAM.\n\nThe default, when neither size nor nrblocks is specified, is size=50%.\n\nnrblocks=blocks\nThe same as size, but in blocks of PAGECACHESIZE.\n\nBlocks may be specified with k, m, or g suffixes like size, but not a % suffix.\n\nnrinodes=inodes\nThe  maximum number of inodes for this instance.  The default is half of the number of\nyour physical RAM pages, or (on a machine with  highmem)  the  number  of  lowmem  RAM\npages, whichever is smaller.  The limit is removed if the number is 0.\n\nInodes may be specified with k, m, or g suffixes like size, but not a % suffix.\n\nnoswap(since Linux 6.4)\nDisables  swap.   Remounts must respect the original settings.  By default swap is en‐\nabled.\n\nmode=mode\nSet initial permissions of the root directory.\n\ngid=gid (since Linux 2.5.7)\nSet the initial group ID of the root directory.\n\nuid=uid (since Linux 2.5.7)\nSet the initial user ID of the root directory.\n\nhuge=hugeoption (since Linux 4.7.0)\nSet the huge table memory allocation policy for all files in this  instance  (if  CON‐\nFIGTRANSPARENTHUGEPAGE is enabled).\n\nThe hugeoption value is one of the following:\n\nnever  Do not allocate huge pages.  This is the default.\n\nalways Attempt to allocate huge pages every time a new page is needed.\n\nwithinsize\nOnly  allocate  huge page if it will be fully within isize.  Also respect fad‐\nvise(2) and madvise(2) hints\n\nadvise Only allocate huge pages if requested with fadvise(2) or madvise(2).\n\ndeny   For use in emergencies, to force the huge option off from all mounts.\n\nforce  Force the huge option on for all mounts; useful for testing.\n\nmpol=mpoloption (since Linux 2.6.15)\nSet the NUMA memory allocation policy for all files in this instance  (if  CONFIGNUMA\nis enabled).\n\nThe mpoloption value is one of the following:\n\ndefault\nUse the process allocation policy (see setmempolicy(2)).\n\nprefer:node\nPreferably allocate memory from the given node.\n\nbind:nodelist\nAllocate memory only from nodes in nodelist.\n\ninterleave\nAllocate from each node in turn.\n\ninterleave:nodelist\nAllocate from each node of in turn.\n\nlocal  Preferably allocate memory from the local node.\n\nIn  the  above,  nodelist is a comma-separated list of decimal numbers and ranges that\nspecify NUMA nodes.  A range is a pair of hyphen-separated decimal numbers, the small‐\nest and largest node numbers in the range.  For example, mpol=bind:0-3,5,7,9-15.\n"
                    }
                ]
            },
            "VERSIONS": {
                "content": "The tmpfs facility was added in Linux 2.4, as a successor to the older ramfs facility,  which\ndid not provide limit checking or allow for the use of swap space.\n",
                "subsections": []
            },
            "NOTES": {
                "content": "In  order  for user-space tools and applications to create tmpfs filesystems, the kernel must\nbe configured with the CONFIGTMPFS option.\n\nThe tmpfs filesystem supports extended attributes (see xattr(7)), but user  extended  attrib‐\nutes are not permitted.\n\nAn  internal  shared  memory  filesystem  is  used for System V shared memory (shmget(2)) and\nshared anonymous mappings (mmap(2)  with  the  MAPSHARED  and  MAPANONYMOUS  flags).   This\nfilesystem is available regardless of whether the kernel was configured with the CONFIGTMPFS\noption.\n\nA  tmpfs filesystem mounted at /dev/shm is used for the implementation of POSIX shared memory\n(shmoverview(7)) and POSIX semaphores (semoverview(7)).\n\nThe amount of memory consumed by all tmpfs  filesystems  is  shown  in  the  Shmem  field  of\n/proc/meminfo and in the shared field displayed by free(1).\n\nThe tmpfs facility was formerly called shmfs.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "df(1), du(1), memfdcreate(2), mmap(2), setmempolicy(2), shmopen(3), mount(8)\n\nThe   kernel   source   files   Documentation/filesystems/tmpfs.txt   and   Documentation/ad‐\nmin-guide/mm/transhuge.rst.\n\nLinux man-pages 6.7                          2023-10-31                                     tmpfs(5)",
                "subsections": []
            }
        }
    }
}