swap.rst
author Oleksandr Gavenko <gavenkoa@gmail.com>
Wed, 05 Aug 2015 23:55:34 +0300
changeset 1729 22ffd80639c0
parent 899 7b4265c8d324
permissions -rw-r--r--
Make centered content design with adoption for mobile devices. Highlight TOC.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
899
7b4265c8d324 Set fill-column as directory local var.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 735
diff changeset
     1
-*- mode: outline; coding: utf-8; -*-
154
906b793ee3c3 Enable swap in file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     2
906b793ee3c3 Enable swap in file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     3
* Enable swap in file.
906b793ee3c3 Enable swap in file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     4
906b793ee3c3 Enable swap in file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     5
Create large file and set up a Linux swap area, enable file for paging and swapping:
906b793ee3c3 Enable swap in file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     6
906b793ee3c3 Enable swap in file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     7
  $ dd if=/dev/zero of=/swapfile bs=1024 count=524288
906b793ee3c3 Enable swap in file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     8
  $ mkswap -v1 /swapfile
906b793ee3c3 Enable swap in file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     9
  $ sudo swapon /swapfile
906b793ee3c3 Enable swap in file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    10
  $ sync
906b793ee3c3 Enable swap in file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    11
906b793ee3c3 Enable swap in file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    12
Insure that all fine:
906b793ee3c3 Enable swap in file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    13
906b793ee3c3 Enable swap in file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    14
  $ dmesg | tail
906b793ee3c3 Enable swap in file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    15
 ...
906b793ee3c3 Enable swap in file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    16
  $ cat /proc/swaps
906b793ee3c3 Enable swap in file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    17
 ...
906b793ee3c3 Enable swap in file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    18
906b793ee3c3 Enable swap in file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    19
Add line to /etc/fstab:
906b793ee3c3 Enable swap in file.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    20
/swapfile   swap        swap    defaults    0   0