Criar Swap no Linux

1. Verificar Swap Existente

Execute:

swapon --show

Se não houver saída, não há swap ativo.

2. Criar Arquivo de Swap

Use o comando:

sudo fallocate -l 2G /swapfile

*(Aqui o tamanho é 2 GB, ajuste conforme necessário)*

3. Definir Permissões

sudo chmod 600 /swapfile

4. Configurar como Swap

sudo mkswap /swapfile

5. Ativar Swap

sudo swapon /swapfile

6. Verificar Ativação

swapon --show

7. Tornar Permanente

Edite o arquivo:

sudo nano /etc/fstab

Adicione a linha:

/swapfile none swap sw 0 0
 
dic_swap_linux.txt · Última modificação: 2026/05/21 17:34 por andre.golfetto
 
Exceto onde for informado ao contrário, o conteúdo neste wiki está sob a seguinte licença:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki