Skip to content
HN On Hacker News ↗

Stop making swap partitions

▲ 151 points 251 comments by jenders 2w ago HN discussion ↗

Pangram verdict · v3.3

We believe that this entire text is human-written.

0 %

AI likelihood · overall

Human
100% human-written 0% AI-generated
SEGMENTS · HUMAN 1 of 1
SEGMENTS · AI 0 of 1
WORD COUNT 152
PEAK AI % 0% · §1
Analyzed
Sep 11
backend: pangram/v3.3
Segments scanned
1 windows
avg 152 words each
Distribution
100 / 0%
human / AI fraction
Verdict
Human
Pangram v3.3

Article text · 152 words · 1 segments analyzed

Human AI-generated
§1 Human · 0%

Star (2) You must be signed in to star a gist Fork (1) You must be signed in to fork a gist Save joshenders/c4960cec9c63a7b7d68ffa9543356c43 to your computer and use it in GitHub Desktop. Stop making swap partitions Stop making swap partitions—use swap files instead! Swap files have had the same performance characteristics as swap partitions for more than 20 years and yet, linux distributions continue to encourage the use of swap partitions during install. Swap files are easier to use/add/remove/modify/extend after installation. They're better in every way––use swap files! Create a swap file. 💡 You can use dd for this too but if your filesystem supports it, fallocate is faster. fallocate -l 4G /swapfile Only root should be able to write to the swap file. chmod 0600 /swapfile Format the swap file. mkswap /swapfile Enable it. swapon /swapfile Make it persist across boots. echo "/swapfile none swap defaults 0 0" >> /etc/fstab