How to add swap on the fly

Suppose you need more swap at the moment, say a 2GB file /swap2gb (Linux only).

# dd if=/dev/zero of=/swap2gb bs=1024k count=2000

# mkswap /swap2gb     # create the swap area

# swapon /swap2gb    # activate the swap. It now in use

# swapoff /swap2gb    # when done deactivate the swap

# rm /swap2gb
Terima kasih telah membaca artikel tentang How to add swap on the fly di blog Tutorial Opensource and Linux jika anda ingin menyebar luaskan artikel ini di mohon untuk mencantumkan link sebagai Sumbernya, dan bila artikel ini bermanfaat silakan bookmark halaman ini di web browser anda, dengan cara menekan Ctrl + D pada tombol keyboard anda.

Artikel terbaru :