Check swap status.
--- a/swap.rst Wed May 28 06:57:10 2025 +0300
+++ b/swap.rst Thu May 29 22:47:01 2025 +0300
@@ -6,16 +6,33 @@
.. contents::
:local:
+Check swap status
+=================
+
+::
+
+ free
+ cat /proc/swaps
+ sudo swapon --show
+
Enable swap in file
===================
-Create large file and set up a Linux swap area, enable file for paging and
-swapping::
+Create a large file::
+
+ sudo fallocate -l 1G /swapfile
+ sudo dd if=/dev/zero of=/swapfile bs=1024 count=524288
+
+with proper permissions::
- $ dd if=/dev/zero of=/swapfile bs=1024 count=524288
- $ mkswap -v1 /swapfile
- $ sudo swapon /swapfile
- $ sync
+ sudo chown root:root /swapfile
+ sudo chmod 600 /swapfile
+
+enable file for paging and swapping::
+
+ mkswap /swapfile
+ sudo swapon /swapfile
+ sync
Insure that all fine::