Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision Next revision Both sides next revision | ||
linux_wiki:swap_files [2015/02/03 23:41] billdozor created |
linux_wiki:swap_files [2015/03/09 22:52] billdozor |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Swap Files ====== | ====== Swap Files ====== | ||
- | Description: | + | **General Information** |
- | ==== Create a Swap File with DD ==== | + | Swap can be increased by resizing partitions, adding new partitions formatted as swap, or by creating swap files. Swap files are useful if you need to utilize existing volumes and cannot resize the swap partition. |
+ | |||
+ | **Checklist** | ||
+ | * Distros: All | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Create a Swap File with DD ===== | ||
Create a block file called " | Create a block file called " | ||
<code bash> | <code bash> | ||
- | dd if=/ | + | dd if=/ |
</ | </ | ||
- | ==== Format the File ==== | + | Explanation: |
+ | * bs: write 1024 bytes at a time (or 1K) | ||
+ | * count: 1024K * 1024K = 1048576K (or 1GB) | ||
+ | |||
+ | ===== Format the File ===== | ||
<code bash> | <code bash> | ||
Line 17: | Line 28: | ||
</ | </ | ||
- | ==== Enable the Swap ==== | + | ===== Enable the Swap ===== |
<code bash> | <code bash> | ||
Line 23: | Line 34: | ||
</ | </ | ||
- | ==== Verify Swap is Used ==== | + | ===== Verify Swap is Used ===== |
<code bash> | <code bash> | ||
swapon -s | swapon -s | ||
+ | |||
+ | Filename Type Size Used Priority | ||
+ | / | ||
+ | / | ||
</ | </ | ||
- | ==== Enable this Swap File After a Reboot ==== | + | ===== Enable this Swap File After a Reboot |
Edit /etc/fstab and add: | Edit /etc/fstab and add: |