SWAP in file: mudanças entre as edições
Ir para navegação
Ir para pesquisar
(→FSTAB) |
|||
Linha 1: | Linha 1: | ||
=Commands= | =Commands= | ||
<syntaxhighlight lang=bash> | <syntaxhighlight lang=bash> | ||
#Create a static file | #Create a static file with 16GB | ||
$ dd if=/dev/zero of=/swapfile bs=1M count=1024 | $ dd if=/dev/zero of=/swapfile bs=1M count=$(expr 16 \* 1024) | ||
16384+0 records in | |||
16384+0 records out | |||
#Fix file mask | #Fix file mask | ||
Linha 15: | Linha 15: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=FSTAB= | =FSTAB= | ||
<syntaxhighlight lang=bash> | <syntaxhighlight lang=bash> | ||
$ echo \/swapfile none swap sw 0 0 >> /etc/fstab | $ echo \/swapfile none swap sw 0 0 >> /etc/fstab | ||
</syntaxhighlight > | </syntaxhighlight > |
Edição das 13h06min de 16 de janeiro de 2020
Commands
#Create a static file with 16GB
$ dd if=/dev/zero of=/swapfile bs=1M count=$(expr 16 \* 1024)
16384+0 records in
16384+0 records out
#Fix file mask
chmod 600 /swapfile
#Prepare the file to use as swap
$ mkswap /swapfile
Setting up swapspace version 1, size = 1048572 KiB
no label, UUID=f75cc8f9-78d2-4ea3-945a-eefbd59568ac
FSTAB
$ echo \/swapfile none swap sw 0 0 >> /etc/fstab