当前位置: 首页> 文旅> 美景 > 石家庄房产信息网站_html中秋节网页制作代码_不属于网络推广方法_河南平价的seo整站优化定制

石家庄房产信息网站_html中秋节网页制作代码_不属于网络推广方法_河南平价的seo整站优化定制

时间:2025/7/12 6:52:40来源:https://blog.csdn.net/yjkhtddx/article/details/144372478 浏览次数:0次
石家庄房产信息网站_html中秋节网页制作代码_不属于网络推广方法_河南平价的seo整站优化定制

Ubuntu20.04调整swap分区大小笔记

参考:https://blog.csdn.net/sunyuhua_keyboard/article/details/142485764

第一步 禁用swap

$ cat /etc/fstab 
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda2 during installation
UUID=bbc5a35b-b700-4792-a9ba-7d643a95f9c5 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda1 during installation
UUID=7CDB-0C3D  /boot/efi       vfat    umask=0077      0       1
/swapfile                                 none            swap    sw              0       0
UUID=9bfb904b-d2b4-43aa-ba49-916e6c4d6320 /root/workspace ext4    defaults        0       0$ swapon --show
NAME      TYPE SIZE USED PRIO
/swapfile file   2G   1G   -2$ free -h总计         已用        空闲      共享    缓冲/缓存    可用
内存:        15Gi       1.0Gi       7.2Gi        45Mi       7.3Gi        14Gi
交换:       2.0Gi       1.0Gi       983Mi$ swapoff -a$ swapon --show$ free -h          总计         已用        空闲      共享    缓冲/缓存    可用
内存:        15Gi       2.0Gi       6.1Gi        73Mi       7.4Gi        13Gi
交换:          0B          0B          0B

第二步 切换swapfile文件

$ rm /swapfile$ ls -al / | grep swapfile$ fallocate -l 16G /swapfile$ ls -al / | grep swapfile
-rw-r--r--   1 root root 17179869184 1210 14:13 swapfile$ chmod 600 /swapfile$ ls -al / | grep swapfile
-rw-------   1 root root 17179869184 1210 14:13 swapfile$ mkswap /swapfile
正在设置交换空间版本 1,大小 = 16 GiB (17179865088  个字节)
无标签, UUID=8127980c-6104-424c-952b-d394bbce95e5$ ls -al / | grep swapfile
-rw-------   1 root root 17179869184 1210 14:16 swapfile

第三步 启用新的swap

$ swapon /swapfile  $ swapon --show   
NAME      TYPE SIZE USED PRIO
/swapfile file  16G   0B   -2$ free -h                 总计         已用        空闲      共享    缓冲/缓存    可用
内存:        15Gi       2.0Gi       6.8Gi        73Mi       6.6Gi        13Gi
交换:        15Gi          0B        15Gi$ cat /etc/fstab            
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda2 during installation
UUID=bbc5a35b-b700-4792-a9ba-7d643a95f9c5 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda1 during installation
UUID=7CDB-0C3D  /boot/efi       vfat    umask=0077      0       1
/swapfile                                 none            swap    sw              0       0
UUID=9bfb904b-d2b4-43aa-ba49-916e6c4d6320 /root/workspace ext4    defaults        0       0
关键字:石家庄房产信息网站_html中秋节网页制作代码_不属于网络推广方法_河南平价的seo整站优化定制

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: