我正在尝试安装/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
。