[root@2zlinux ~]# free -m
total used free shared buff/cache available
Mem: 974 108 734 7 132 714
Swap: 1535 0 1535
[root@2zlinux ~]# dd if=/dev/zero of=/tmp/newdisk bs=1M count=100
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 4.19475 s, 25.0 MB/s
[root@2zlinux ~]# du -h /tmp/newdisk
100M /tmp/newdisk
[root@2zlinux ~]# mkswap -f /tmp/newdisk
Setting up swapspace version 1, size = 102396 KiB
no label, UUID=be191027-d09e-4db7-9364-5afb6de0a03e
[root@2zlinux ~]# swapo
swapoff swapon
[root@2zlinux ~]# swapon /tmp/newdisk
swapon: /tmp/newdisk: insecure permissions 0644, 0600 suggested.
[root@2zlinux ~]# free -m
total used free shared buff/cache available
Mem: 974 108 630 7 235 698
Swap: 1635 0 1635
[root@2zlinux ~]#
4.9手动添加swap空间
猜你喜欢
转载自blog.csdn.net/hx_7_8_9/article/details/83116850
今日推荐
周排行