From e0ff5de7463b559b1f1d8ca6ccca378a08823cfe Mon Sep 17 00:00:00 2001 From: JMARyA Date: Tue, 17 Dec 2024 14:24:37 +0100 Subject: [PATCH] add tmpfs --- technology/linux/filesystems/Filesystems.md | 1 + technology/linux/filesystems/tmpFS.md | 30 +++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 technology/linux/filesystems/tmpFS.md diff --git a/technology/linux/filesystems/Filesystems.md b/technology/linux/filesystems/Filesystems.md index 6477868..a1ad939 100644 --- a/technology/linux/filesystems/Filesystems.md +++ b/technology/linux/filesystems/Filesystems.md @@ -14,6 +14,7 @@ obj: meta/collection - [MergerFS](MergerFS.md) - [LVM](./LVM.md) - [LUKS](./LUKS.md) +- [tmpFS](./tmpFS.md) ## Network - [SSHFS](SSHFS.md) diff --git a/technology/linux/filesystems/tmpFS.md b/technology/linux/filesystems/tmpFS.md new file mode 100644 index 0000000..23e9bf7 --- /dev/null +++ b/technology/linux/filesystems/tmpFS.md @@ -0,0 +1,30 @@ +--- +obj: filesystem +wiki: https://en.wikipedia.org/wiki/Tmpfs +arch-wiki: https://wiki.archlinux.org/title/Tmpfs +--- + +# tmpFS +tmpfs is a temporary filesystem that resides in memory and/or swap partition(s). Mounting 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. + +## Usage + +**Create a tmpfs**: +`mount -t tmpfs -o [OPTIONS] tmpfs [MOUNT_POINT]` + +**Resize a tmpfs**: +`mount -t tmpfs -o remount,size= tmpfs [MOUNT_POINT]` + +### Options + +| **Option** | **Description** | +| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `size=bytes` | Specify an upper limit on the size of the filesystem. Size is given in bytes, rounded up to entire pages. A `k`, `m`, or `g` suffix can be used for Ki, Mi, or Gi. Use `%` to specify a percentage of physical RAM. Default: 50%. Set to `0` to remove the limit. | +| `nr_blocks=blocks` | Similar to `size`, but in blocks of `PAGE_CACHE_SIZE`. Accepts `k`, `m`, or `g` suffixes, but not `%`. | +| `nr_inodes=inodes` | Sets the maximum number of inodes. Default is half the number of physical RAM pages or the number of lowmem RAM pages (whichever is smaller). Use `k`, `m`, or `g` suffixes, but `%` is not supported. Set to `0` to remove the limit. | +| `noswap` | Disables swap. Remounts must respect the original settings. By default, swap is enabled. | +| `mode=mode` | Sets the initial permissions of the root directory. | +| `gid=gid` | Sets the initial group ID of the root directory. | +| `uid=uid` | Sets the initial user ID of the root directory. | +| `huge=huge_option` | Sets the huge table memory allocation policy for all files (if `CONFIG_TRANSPARENT_HUGEPAGE` is enabled). Options: `never` (default), `always`, `within_size`, `advise`, `deny`, or `force`. | +| `mpol=mpol_option` | Sets NUMA memory allocation policy (if `CONFIG_NUMA` is enabled). Options: `default`, `prefer:node`, `bind:nodelist`, `interleave`, `interleave:nodelist`, or `local`. Example: `mpol=bind:0-3,5,7,9-15`. |