Wiki GeRgOsNet Notes d’administration système, réseau et domotique

Creer Une partition Swap apres install

Ajout partition swap apres une install

Mis à jour le 20 mars 2020 1 min de lecture Historique

Si je veux ajouter 4Go :

sudo fallocate -l 4G /swapfile STEP 4: SWAP file is created. Let’s give root-only permissions to it.

sudo chmod 600 /swapfile

STEP 5: Mark the file as SWAP space:

sudo mkswap /swapfile

STEP 6: Finally enable the SWAP.

sudo swapon /swapfile

STEP 7: You can now check using the same swapon command to check if SWAP is created.

sudo swapon --show

STEP 8: Also recheck the final partition structure.

free -h

STEP 9: Once everything is set, you must set the SWAP file as permanent, else you will lose the SWAP after reboot. Run this command:

echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab

Ancien titre MediaWiki : Creer_Une_partition_Swap_apres_install