Monday, October 24, 2016

Create new swap file to Linux

to add new swap file to Linux just follow the below steps , in my case i will add 32GB and i am not using LVM :-
  • just create file by the below command :-
    • touch /new.swap
  • Write on the file :-
    •  dd if=/dev/zero of=/new.swap bs=1024 count=33554432
  • Format the file :-
    • mkswap /new.swap
  • Add the file to the system as a swap file.
    • swapon /new.swap
  • finally add it to fstab :-
    • /new.swap none swap sw 0 0
Thanks
Osama

3 comments:

  1. Replies
    1. Sometimes SA configured SWAP with small size, this size will generate an error so you have to add extra swap size

      Delete