killed or swap space

来源:互联网 发布:python爬虫爬去图片 编辑:程序博客网 时间:2024/06/06 14:25
1、Ubuntu下增加swap空间的命令如下:
# 生成swap镜像文件sudo dd if=/dev/zero of=/mnt/512Mb.swap bs=1M count=512# 对该镜像文件格式化sudo mkswap /mnt/512Mb.swap# 挂载该镜像文件 sudo swapon /mnt/512Mb.swap
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

至此,使用free -m 即可查看到swap空间已经增加成功。

2、in linux there is swap space in partitions or in files. Once the disk is partitioned the easiest way to grow the swap space is creating aswap file in one of your partitions. Type df -h and check which one has free space. Say you find free GB in/home:

First create a file. In this example we add around 1GB of space. Login as root in a terminal.

# dd if=/dev/zero of=/home/swap1 bs=1024 count=1024000

Make this file owned by the root user and allow only root to read and write to it:

# chown root:root /home/swap1# chmod 0600 /home/swap1

Turn it into a swap file

# mkswap /home/swap1

Try it right now. This activates the new swap space without rebooting:

# swapon /home/swap1

Add it to the fstab file so it works when you reboot. Be carefull with the next command, do not forget there are two>

echo "/home/swap1 none swap sw 0 0" >> /etc/fstab

Check the new space is being used typing this:# swapon --show


原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 中暑怎么办三字步骤 中暑了头疼恶心怎么办 龙猫重度中暑怎么办 小孩中暑后咳嗽怎么办 狗重度中暑昏迷怎么办 孩子中暑了呕吐怎么办 一岁宝宝中暑怎么办 骑摩托车下雨了怎么办 棉袄脏了不想洗怎么办 棉袄袖口特别脏怎么办 没有扣眼的腰带怎么办 消防部队改革士兵怎么办 84洗衣服手剥皮怎么办 羊毛裤水洗了怎么办 小公司开支亏损怎么办 带上耳塞后耳鸣怎么办 鞋子拉链磨脚怎么办 科目三系统误判怎么办 遇到障碍物老熄火怎么办 高速上遇到动物怎么办 高速上有障碍物怎么办 雨刮器工作遇到障碍物怎么办 高速路上遇到障碍物怎么办 开车撞到柱子怎么办 喝酒撞了护栏怎么办 漏电保护器过载怎么办 不停有国外电话怎么办 身体铅含量高怎么办 洗衣机买大了怎么办 三角插头坏了怎么办 移动硬盘读不出来怎么办 高压线断落地面怎么办 水冷螺杆机制热怎么办 施工升降机突然停电怎么办 高压锅煮饭响了怎么办 美的高压锅漏气怎么办 电压力锅盖漏气怎么办 电饭锅焦粘锅底怎么办 电饭锅煮焦了怎么办 九阳压力锅漏气怎么办 高压锅排气阀漏气怎么办