mkswap

来源:互联网 发布:19岁网络女主播萱萱 编辑:程序博客网 时间:2024/06/06 18:56
[root@hnl /]# dd if=/dev/zero of=/swapfile bs=1M count=10241024+0 records in1024+0 records out1073741824 bytes (1.1 GB) copied, 0.650588 s, 1.7 GB/s[root@hnl /]# mkswap /swapfilemkswap: /swapfile: warning: don't erase bootbits sectors        on whole disk. Use -f to force.Setting up swapspace version 1, size = 1048572 KiBno label, UUID=204fb22f-ba2d-4240-a4a4-5edf953257ba[root@hnl /]# free -m             total       used       free     shared     buffers     cachedMem:          7768       1662       6105          0          28       1246-/+ buffers/cache:        388       7379Swap:         9951          0       9951[root@hnl /]# swapon /swapfile[root@hnl /]# free -m             total       used       free     shared     buffers     cachedMem:          7768       1659       6108          0          28       1246-/+ buffers/cache:        385       7382Swap:        10975          0      10975fuser -m 挂载点:查看哪些id的进程在使用该挂载点。建立虚拟内存fdisk 选择n添加新分区t 改变分区格式,改为82w 保存#partprobe 告诉系统分区表改变。格式化 swap 分区 ----mkswap 设备名free或者swapon -s 查看虚拟内存大小让虚拟内存立即生效两种方法改 /etc/fstabswapon -a 让虚拟内存生效,该命令会读取fstab2.swapon /dev/sdax 让虚拟内存生效 swapoff /dev/sdax 失效。
0 0
原创粉丝点击