dd if=/dev/zero of=/swapfile bs=1k count=524288 && mkswap /swapfile && sync && swapon /swapfile Question is, As My ram is 2 GB I need a swap partition of at least 4 GB (It is stated on that site). What'll be the necessary changes to turn that 512 MB into 4GB file?
You not _need_ any swap at all.
You have no way of saying that. I have 8GB machines that swap regularly. It depends upon the applications and the work load.
Plus the 2X rule is for Windows (3.x), not Linux.
It was often repeated in the context of UNIX admin articles and
training.
--
Adam Tauno Williams