ubuntu@local-goods:~$ sudo swapon -show
ubuntu@local-goods:~$ free -h
![](http://fortis.te.ua/wp-content/uploads/2023/07/image-5.png)
ubuntu@local-goods:~$ df -h
![](http://fortis.te.ua/wp-content/uploads/2023/07/image-6.png)
ubuntu@local-goods:~$ sudo fallocate -l 4G /swapfile
ubuntu@local-goods:~$ ls -lh /swapfile
![](http://fortis.te.ua/wp-content/uploads/2023/07/image-7.png)
ubuntu@local-goods:~$ sudo chmod 600 /swapfile
ubuntu@local-goods:~$ ls -lh /swapfile
![](http://fortis.te.ua/wp-content/uploads/2023/07/image-8.png)
ubuntu@local-goods:~$ sudo mkswap /swapfile
![](http://fortis.te.ua/wp-content/uploads/2023/07/image-9.png)
ubuntu@local-goods:~$ sudo swapon /swapfile
ubuntu@local-goods:~$ sudo swapon --show
![](http://fortis.te.ua/wp-content/uploads/2023/07/image-10.png)
ubuntu@local-goods:~$ free -h
![](http://fortis.te.ua/wp-content/uploads/2023/07/image-11.png)