Squashed 'temp-repo/' content from commit 6688605
git-subtree-dir: temp-repo git-subtree-split: 6688605ad41f49d1eccead8d29421c658cad0100
This commit is contained in:
commit
ecdfa2f7c4
1258 changed files with 42112 additions and 0 deletions
59
Homelab/Increase Linux Swap file size.md
Executable file
59
Homelab/Increase Linux Swap file size.md
Executable file
|
@ -0,0 +1,59 @@
|
|||
---
|
||||
type: ressource
|
||||
date: 2025-03-06T10:13
|
||||
maturity: graine
|
||||
---
|
||||
|
||||
To increase the size of your swap file on Linux Mint, follow these steps:
|
||||
### Look how much swap you currently have
|
||||
|
||||
```sh
|
||||
free -h
|
||||
```
|
||||
### Turn off the current swap file
|
||||
```bash
|
||||
sudo swapoff /swapfile
|
||||
```
|
||||
|
||||
### Resize the swap file
|
||||
Replace `XG` with the desired new size (e.g., `4G` for 4 GB):
|
||||
```bash
|
||||
sudo fallocate -l XG /swapfile
|
||||
```
|
||||
If `fallocate` is not supported, use:
|
||||
```bash
|
||||
sudo dd if=/dev/zero of=/swapfile bs=1M count=4096
|
||||
```
|
||||
(for 4 GB, adjust `count` accordingly)
|
||||
|
||||
### Set the correct permissions
|
||||
```bash
|
||||
sudo chmod 600 /swapfile
|
||||
```
|
||||
|
||||
### Format the swap file
|
||||
```bash
|
||||
sudo mkswap /swapfile
|
||||
```
|
||||
|
||||
### Enable the new swap file
|
||||
```bash
|
||||
sudo swapon /swapfile
|
||||
```
|
||||
|
||||
### Verify swap space
|
||||
```bash
|
||||
free -h
|
||||
```
|
||||
|
||||
### Make it permanent
|
||||
Ensure the swap file is reactivated on reboot by adding this line to `/etc/fstab`:
|
||||
```bash
|
||||
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
|
||||
```
|
||||
|
||||
Your swap size is now increased.
|
||||
|
||||
|
||||
# Sources
|
||||
ChatGPT
|
Loading…
Add table
Add a link
Reference in a new issue