Differences
This shows you the differences between two versions of the page.
linux_wiki:swap_files [2015/02/05 22:12] billdozor |
linux_wiki:swap_files [2019/05/25 23:50] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Swap Files ====== | ||
- | Description: | ||
- | |||
- | ==== Create a Swap File with DD ==== | ||
- | |||
- | Create a block file called " | ||
- | |||
- | <code bash> | ||
- | dd if=/ | ||
- | </ | ||
- | |||
- | Explanation: | ||
- | * bs: write 1024 bytes at a time (or 1K) | ||
- | * count: 1024K * 1024K = 1048576K (or 1GB) | ||
- | |||
- | ==== Format the File ==== | ||
- | |||
- | <code bash> | ||
- | mkswap / | ||
- | </ | ||
- | |||
- | ==== Enable the Swap ==== | ||
- | |||
- | <code bash> | ||
- | swapon / | ||
- | </ | ||
- | |||
- | ==== Verify Swap is Used ==== | ||
- | |||
- | <code bash> | ||
- | swapon -s | ||
- | </ | ||
- | |||
- | ==== Enable this Swap File After a Reboot ==== | ||
- | |||
- | Edit /etc/fstab and add: | ||
- | <code bash> | ||
- | / | ||
- | </ |