Show Table of Contents
4.3.2. 暫時性儲存空間
Red Hat Enterprise Linux 7 提供使用
/tmp 做為掛載點,以作為暫時性檔案儲存系統(tmpfs)的功能。
當啟用時,此暫時性儲存裝置會以掛載的檔案系統顯示,不過卻會將其內容存放在揮發性記憶體中,而非在一個永續性的儲存裝置上。除非記憶體不足,否則
/tmp 中不會有檔案儲存在硬碟上,在此情況下 swap 空間將會被使用。這代表 /tmp 的內容在重新開機後便會遺失。
若要啟用這項功能,請執行以下指令:
# systemctl enable tmp.mount
若要停用這項功能,請執行以下指令:
# systemctl disable tmp.mount
Red Hat 建議在 Red Hat Enterprise Linux 7 中,以下列方式使用各種類型的暫時性儲存空間。
- 高優先權的程序(例如 daemon)應使用
/run/processname來儲存暫時性的資料。 - 會儲存大量資料,或是需要暫時性資料在重新開機後還能保留的程序,應使用
/var/tmp。 - 所有其它程序則應使用
/tmp來儲存暫時性的資料。

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.