查看SWAP
root@aml:/media/data0# swapon -s
Filename Type Size Used Priority
/media/data0/swap file 2097148 0 -1
Code language: PHP (php)
使用dd,创建空SWAP文件
root@aml:/media/data0# dd if=/dev/zero of=/media/data0/swap bs=1024M count=2
2+0 records in
2+0 records out
2147483648 bytes (2.1 GB, 2.0 GiB) copied, 311.252 s, 6.9 MB/s
Code language: PHP (php)
格式化SWAP
root@aml:/media/data0# mkswap swap
mkswap: swap: insecure permissions 0644, 0600 suggested.
Setting up swapspace version 1, size = 2 GiB (2147479552 bytes)
no label, UUID=d7f71a57-7fee-4796-8930-a0f77f2d4034
Code language: PHP (php)
启用SWAP文件
root@aml:/media/data0# swapon swap
Code language: PHP (php)
自动加载SWAP
# vim /etc/fstab
/media/data0/swap swap swap defaults 0 0
Code language: PHP (php)
了解 Starx's Home 的更多信息
Subscribe to get the latest posts sent to your email.
0 条评论