我正在嘗試安裝/tmp
到 Ubuntu 伺服器(14.04)上的 RAM:
echo "tmpfs /tmp tmpfs rw,nosuid,nodev,noatime 0 0" | tee -a /etc/fstab
這行似乎沒問題,它被添加到/etc/fstab
,並在系統重新啟動後/tmp
按預期安裝。
但是當我嘗試即時應用此更改(無需重新啟動系統)時:
mount -o remount /tmp
我收到此錯誤:未安裝或選項錯誤
怎麼了?
答案1
從mount
線上說明頁:
remount Attempt to remount an already-mounted filesystem. This is commonly used to change the mount flags for a filesystem, especially to make a readonly filesystem writeable. It does not change device or mount point.
由於/tmp
您嘗試時尚未安裝mount -o remount /tmp
,因此失敗。要使其在尚未安裝時工作,您需要這樣做mount /tmp
。