Pavnay

 
  • Increase font size
  • Default font size
  • Decrease font size
FrançaisEnglish

[System] Creating a swap file

Print
System

It can be possible that a server has a lack of swap because it seemed to be useless or if it exists it's too small.
It's possible to add swap via the following command :


touch /swap
dd if=/dev/zero of=/swap bs=1024 count=262144  
sync 
mkswap -c /swap 262144 
sync 
swapon /swap

swapoff /swap


Some explanations :
  • Swap file creation
  • Filling the file with the wanted size in ko ( count * bs ) (here 1024ko * 262144 = 256Mo)
  • Filesystem synchronization
  • Formating the file into swap filesystem (with siez in ko)
  • Filesystem synchronization
  • Swap on
  • Swap off


Comments
Add New
+/-
Write comment
Name:
Email:
 
Title:
 
:D:):(:0:shock::confused:8):lol::x:P:oops::cry:
:evil::twisted::roll::wink::!::?::idea::arrow:
 

3.26 Copyright (C) 2008 Compojoom.com / Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."

 

Actualités


AddThis Social Bookmark Button