ゴジラ

Adding swap to Linux after install

Calculate count value

Count for 512 MB = 1024 * 512 MB = 524288
Count for 1024 MB = 1024 * 1024 MB = 1048576

Adding 512 MB Swap,

dd if=/dev/zero of=/swap1 bs=1024 count=524288

Fix file permissions,

chown root:root /swap1
chmod 0600 /swap1

Setup the file as a swap file,

mkswap /swap1

Activate the swap,

swapon /swap1

Now, check free -m for the updated swap value.


Last modified: December 06 2019 14:21:55