Friday, October 23, 2009

Creating/Adding Swap on Fly

Source is from here.

  1. sudo dd if=/dev/zero of=/swap_file bs=1M count=1000
  2. sudo chown root:root /swap_file
  3. sudo chmod 600 /swap_file
  4. sudo mkswap /swap_file
  5. sudo swapon /swap_file
  6. sudo gedit /etc/fstab
  • /swap_file none swap sw 0 0

Comments:
  1. create a file named "swap_file" with size 1000MB
  2. change the ownership to "root"
  3. change the access so that it can be read and write by owner only
  4. make it be to "swap" type
  5. turn on the swap
  6. edit the sytem file so that the swap is mounted when system is started

0 comments:

Post a Comment