Solaris10 Swap Adding

To add more swap space, perform. the following steps:

  1. Become superuser.

  2. Create a directory for the swap file, if needed—for example:

       mkdir /moreswap
    
  3. Create the swap file by using the mkfile command, which has the following syntax:

       mkfile  [k|b|m] 

    The specifies the file size in KB, bytes, or MB specified by k, b, or m. For example, to create 500MB swap space, issue the following command:

       mkfile 500m /moreswap/swapFile
    
  4. Activate the swap file by carrying on the same example:

       # /usr/sbin/swap -a /moreswap/swapFile
    

    You must use the absolute path name to specify the swap file. The swap file is now added, and activated. It is available until the file system is unmounted, the system is rebooted, or the swap file is removed. The swap file will be automatically activated each time the system is booted, if you perform. the next step.

  5. Add the following entry for the swap file to the /etc/vfstab file, again using the running example:

       /moreswap/swapFile—- swap—no -
    
  6. Issue the following command to verify that the swap file has actually been added:

       /usr/sbin/swap -l
    

    You can create a swap file without root permissions. However, if root is not the owner of the swap file, it could be easily overwritten by accident. You can remove a swap file by issuing the following command:

       swap -d 

    This will not remove the file, but it will make it unavailable for swapping. However, if you want the space occupied by the file, you can remove it by using the good old rm command:

       rm 

    You should also remove the entry for the removed swap file from the /etc/vfstab file.

    We have used the swap command at several places so far. Now, let's take a look at its syntax:

       swap  []
    

    The options are described here:

    • -a . Activate a swap file whose full path is specified by .

    • -d . Make the file specified by unavailable to swapping without removing the file.

    • -l. Identify the swap space on the system: the device name and the total physical swap space—that is, it does not include any space from the physical memory.

    • -s. Display the allocated, reserved, and available swap space. This swap space may include part of available physical memory (the virtual swap space).

  •  

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/25196159/viewspace-683722/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/25196159/viewspace-683722/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值