solaris下增加swap空间失败: is not valid for swapping
# ls
bin home net proc u01
dev kernel opt sbin u02
etc lib oradiag_root system usr
export mnt platform tmp var
# mkfile 10m /swapfile
# ls -al swapfile
-rw------- 1 root root 10485760 Oct 14 11:33 swapfile
# swap -a /swapfile
"/swapfile" is not valid for swapping.
It must be a block device or a regular file with the
"save user text on execution" bit set.
哪位高手指点一下!
[解决办法]
它说你那个块设备或者文件必须要设置sticky bit才能作为swap文件系统。
For regular files on some older systems, the
bit saves the program’s text image on the swap device so it will load more quickly
when run; this is called the sticky bit.
所以你可以这么做。
# chmod 1777 /swapfile