summaryrefslogtreecommitdiffstats
path: root/content/posts/swap-file-linux.md
diff options
context:
space:
mode:
authorbreadcat2020-08-27 01:22:58 +0100
committerbreadcat2020-08-27 01:22:58 +0100
commit94efd69c339d1b5eae972107b7e4f7b5ae342dc4 (patch)
treeb522bac874e8b4c53ab4cb446a2da1e69f12c098 /content/posts/swap-file-linux.md
parentc4182ad2a013e76f8c78bc79206f20ed1b1b5428 (diff)
downloadblog.minskio.co.uk-94efd69c339d1b5eae972107b7e4f7b5ae342dc4.tar.gz
blog.minskio.co.uk-94efd69c339d1b5eae972107b7e4f7b5ae342dc4.tar.bz2
blog.minskio.co.uk-94efd69c339d1b5eae972107b7e4f7b5ae342dc4.zip
Fallocate changes
Diffstat (limited to 'content/posts/swap-file-linux.md')
-rw-r--r--content/posts/swap-file-linux.md5
1 files changed, 4 insertions, 1 deletions
diff --git a/content/posts/swap-file-linux.md b/content/posts/swap-file-linux.md
index e2dc626..9b45cf6 100644
--- a/content/posts/swap-file-linux.md
+++ b/content/posts/swap-file-linux.md
@@ -1,6 +1,7 @@
---
title: "Creating a Swap File on Linux"
date: 2019-06-10T10:03:00
+lastmod: 2020-08-27T01:15:00
tags: ["Formats", "Guides", "Linux", "Servers", "Snippets", "Software"]
---
@@ -12,7 +13,7 @@ The notes here work with a 1GB swap file, but feel free to change these if need
Firstly we're going to create the file, set permissions and enable the swap file:
```
-sudo fallocate -l 1G /swap
+sudo dd if=/dev/zero of=/swap bs=1M count=1024 status=progress
sudo chmod 600 /swap
sudo mkswap /swap
sudo swapon /swap
@@ -37,3 +38,5 @@ To make this change permanent, you'll need to write the value to your `sysctl.co
```
echo "vm.swappiness=10" | sudo tee -a /etc/sysctl.conf
```
+
+* **Edit 2020-08-27:** Replaced `fallocate` instructions with `dd`, caused issues when trying to `swapon`. \ No newline at end of file