修改目录proc下的tcp_tw_recycle报“只读文件系统”
试图修改tcp_tw_recycle的值时,遇到错误:
# echo 1 > /proc/sys/net/ipv4/tcp_tw_recycle -bash: /proc/sys/net/ipv4/tcp_tw_recycle: 只读文件系统 |
该错误的原因是因为以只读(ro)方式mount了tcp_tw_recycle所在目录,比如因为目录“/proc/sys”以只读方式mount了:
# mount|grep proc proc on /proc type proc (rw,nosuid,nodev,noexec,relatime) proc on /proc/bus type proc (ro,relatime) proc on /proc/fs type proc (ro,relatime) proc on /proc/irq type proc (ro,relatime) proc on /proc/sys type proc (ro,relatime) |
tcp_tw_recycle所在其它层次目录以只读方式mount,也会同样的问题。通常由文件/etc/mtab控制,比如如下一行内容:
proc /proc/sys proc ro,relatime 0 0 |