edit metadata

This commit is contained in:
2025-02-12 15:01:15 +01:00
parent 341b6ed46f
commit 1ce84ebc53
43 changed files with 214 additions and 207 deletions

View File

@@ -4,49 +4,47 @@ tags: [ "basics" ]
---
# Making a Swap File
```bash
```sh
su root
cd /var/cache/
```
```bash
sudo dd if=/dev/zero of=swapfile bs=1K count=4M
dd if=/dev/zero of=swapfile bs=1K count=4M
```
This creates a swapfile of (1k x 4M) 4 Gigs.
Change 4M to XM for an XGig swap.
```bash
sudo chmod 600 swapfile
```sh
chmod 600 swapfile
```
```bash
sudo mkswap swapfile
```sh
mkswap swapfile
```
```bash
sudo swapon swapfile
```sh
swapon swapfile
```
Test it's working with top
```bash
```sh
top -bn1 | grep -i swap
```
or:
```bash
echo "/var/cache/swapfile none swap sw 0 0" | sudo tee -a /etc/fstab
```sh
echo "/var/cache/swapfile none swap sw 0 0" | tee -a /etc/fstab
```
Test it'll work at boot with:
```bash
sudo swapoff swapfile
```sh
swapoff swapfile
```
```bash
sudo swapon -va
```sh
swapon -va
```
# Partition Swaps
@@ -57,13 +55,13 @@ Put this in /etc/fstab:
Then test it works with:
```bash
sudo swapon -va
```sh
swapon -va
```
Test other partitions in fstab with:
```bash
sudo mount -a
```sh
mount -a
```