How do you create and use a swapfile in Linux 2.6?
by Geethalakshmi[ Edit ] 2010-05-30 03:30:25
How do you create and use a swapfile in Linux 2.6?
Make the swapfile as big as the internal memory.
root@host:/# dd if=/dev/zero of=/swapfile bs=1M count=256
root@host:/# mkswap /swapfile
Edit /etc/fstab, add:
/swapfile none swap defaults 0 0
root@host:/# swapon -a
Be sure to mount the swapfile after regular file systems is mounted (in your startup scripts):
/bin/mount -n -o remount,rw
/bin/rm -f /etc/mtab*
/bin/mount -a -O no_netdev
swapon -a