tmpfs 使用 RAM 和 swap,kernel 設定是 CONFIG_TMPFS
建立 tmpfs 檔案系統只需要直接掛載它
mount -t tmpfs name mount_point
name 只是顯示在 /proc/mounts,或指令 mount 或 df 的名稱。
mount_point 是掛載點
tmpfs 檔案系統動態調整大小,預設上限是 RAM 的一半,size=nbytes 選項可限制上限。
除了作為一般檔案系統,tmpfs 有兩種特殊用途:
- kernel 內部掛載一個不可見的 tmpfs 作為 System V shared memory (TLPI §48) 和 shared anonymous memory mappings (TLPI §49)。
- 掛載在 /dev/shm 的 tmpfs 作為 glibc 實作的 POSIX shared memory 和 POSIX semaphores。
TLPI §14.10
沒有留言:
張貼留言