Recently in the ready to run on the mobile side of the deep learning training model, on the RK3399 board installed scipy times wrong. Online check, because of insufficient memory, make a swap partition is done. So how do you swap partitions? Talk not much, directly open the.
--------------------------------------------------------------------------------------------------------------- ----------------------
To create a swap file with the fallocate command
fallocate
A program is the best way to immediately create a pre-allocated file size.
The following command will create a 1GB size /swapfile
.
sudo fallocate-l 1g/swapfile
Check to see if the file you created is the correct size.
ls -lh/swapfile11. 0G June 7:/swapfile
Set the file's permissions so that 600
only the root user can access the file.
sudo chmod /swapfile
Convert this file to a swap file by running the following command.
sudo mkswap/11024x768 MiB (1073737728 bytes) No label, UUID= cda50e0e-41f3-49c7-af61-b8cb4a33a464
Make the swap file effective by running the following command.
sudo swapon/swapfile
Add the newly created interchange file to fstab
the file, so that changes to the swap partition space can take effect even after a restart.
vi /etc/fstab/swapfile swap swap defaults 00
Check the newly created interchange file.
$ swapon--showname TYPE SIZE used PRIO/dev/sda5 partition 657.8M - 1 file 1024M 0B -2
Now I can see a new 1GB /swapfile1
file. Restart the system for the new swap file to take effect.
Excerpt part of:
Compiled from: http://www.2daygeek.com/add-extend-increase-swap-space-memory-file-partition-linux/ 2daygeek
Original: LCTT https://linux.cn/article-8699-1.html Translator: Cinlen Chan
--------------------------------------------------------------------------------------------------------------- ----------------------
Focus: Above just describes how to create a swap partition, on the RK3399 board, I actually created a 4G swap partition!!!
Look at my situation.
Free-H
Linux environments Create swap partitions