TK1入门教程软件篇-实现扩展swap交换区大小
TK1入门教程软件篇-实现扩展swap交换区大小
说明:
- 介绍如何扩展TK1的swap交换区大小
步骤:
- 下载脚本:
cd ~
git clone https://gist.github.com/jetsonhacks/b80d6130066e3f351bc8
cd b80d6130066e3f351bc8
- 脚本内容如下:
#!/bin/bash
#NVIDIA Jetson TK1
#Create a swapfile for Ubuntu at the current directory location
fallocate -l 4G swapfile
#List out the file
ls -lh swapfile
# Change permissions so that only root can use it
chmod 600 swapfile
#List out the file
ls -lh swapfile
#Set up the Linux swap area
mkswap swapfile
#Now start using the swapfile
swapon swapfile
#Show that it's now being used
swapon -s
- 设置权限:
chmod +x createSwapFile.sh
- 执行:
sudo ./createSwapFile.sh
- 创建swap为4G大小swap文件。
- 设置开机生效:
$ sudo gedit /etc/fstab
- 内容如下:
/media/ubuntu/JetsonSSD/swapfile none swap sw 0 0
- 这里使用放在ssd硬盘里,要确保在之前已经加载ssd硬件。
参考:
- http://www.jetsonhacks.com/2014/10/04/creating-swapfile-ubuntu-nvidia-jetson-tk1/
获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号