swap.rst
author Oleksandr Gavenko <gavenkoa@gmail.com>
Tue, 07 Feb 2023 00:53:39 +0200
changeset 2555 70383fa8bf12
parent 1912 8b81a8f0f692
permissions -rw-r--r--
About copying SSH pubkey.

.. -*- coding: utf-8; -*-

======
 Swap
======
.. contents::
   :local:

Enable swap in file
===================

Create large file and set up a Linux swap area, enable file for paging and
swapping::

  $ dd if=/dev/zero of=/swapfile bs=1024 count=524288
  $ mkswap -v1 /swapfile
  $ sudo swapon /swapfile
  $ sync

Insure that all fine::

  $ dmesg | tail
  ...
  $ cat /proc/swaps
   ...

Add line to /etc/fstab::

  /swapfile   swap        swap    defaults    0   0