RobotKernal-UESTC/Code/MowingRobot/pibot_ros/pibot_create_swap.sh

11 lines
283 B
Bash

#!/bin/bash
sudo mkdir /opt/image
cd /opt/image/
sudo touch swap
sudo dd if=/dev/zero of=/opt/image/swap bs=1024 count=2048000
sudo mkswap /opt/image/swap
sudo swapon /opt/image/swap
echo "add \"/opt/image/swap /swap swap defaults 0 0\" to \"/etc/fstab\" to make swap effecive"