This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
linux:general:swap [2018/08/22 11:24] – created lunetikk | linux:general:swap [2019/02/12 14:45] (current) – lunetikk | ||
---|---|---|---|
Line 9: | Line 9: | ||
Create a swapfile with blocksize 1024 and 2GB | Create a swapfile with blocksize 1024 and 2GB | ||
< | < | ||
- | < | ||
Format the file and set permissions | Format the file and set permissions | ||
< | < | ||
mkswap / | mkswap / | ||
- | chown root:root /tmp/swapfile | + | chown root:root /swap/swapfile |
chmod 600 / | chmod 600 / | ||
</ | </ | ||
Add the swapfile to swap | Add the swapfile to swap | ||
- | swapon /tmp/swapfile | + | < |
+ | swapon /swap/swapfile | ||
+ | </ | ||
=== Remove a swapfile from swap === | === Remove a swapfile from swap === | ||
- | Turn off the swapfile (used swap will be moved to other swap or memory, might take a while) | + | List the swapfiles |
- | swapoff /swap/swap | + | < |
+ | swapon -s | ||
+ | </ | ||
+ | Turn off the swapfile (used swap will be moved to other swap or memory, might take a while)\\ | ||
+ | < | ||
+ | swapoff /swap/swapfile | ||
+ | </ | ||
\\ | \\ | ||
\\ | \\ | ||
- | ~~DISCUSSION~~ | + | ~~DISCUSSION:closed~~ |