Categories




PreviousNext
How do you create and use a swapfile in Linux 2.6?    
 Send mail Views:83
Belongs to : Linux
Facebook Bookmarkbookmark this page Digg Bookmark Delicious BookmarkStumbleupon Bookmarkshare with orkut Post to Google Buzz

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

Pictures and Videos
Online Calculators
embed code


By - Geethalakshmi, On - 2010-05-30
Send This
PreviousNext

User Comments


Add NEW Feedback:

Name :     Email :

 Server Monitoring Web hosting by Hiox India Privacy Policy Terms and Conditions