*Tags*: dev:swap
Newsgroups: comp.os.linux.misc
>How can I mount swap in /tmp? >I used to have a linuxswap partition for the swap, but now since I >noticed that my swap utilization is extremly low, I want to change it for >/tmp volume. Please also provide some comments or tips on this.
You don't really want to go without swap. Linux without swap will run rather slowly, especially if you don't have much RAM. You don't necessarily need a partition dedicated for swap, however. You can turn your swap partition into an ext2 partition (and keep some swap around) by doing the following things. This assumes your swap partition is /dev/hda6 ; modify for your actual setup:
Edit /etc/fstab. Remove the previous entry for swap, and replace it with the following 2 lines:
/swapfile swap swap defaults 0 0 /dev/hda6 /tmp ext2 defaults 1 2
HTH, good luck.
Matt G
dd if=/dev/zero of=/tmp/.todel/swapfile bs=1M count=64 && sync && sync
creates a 64M swapfile in /tmp/.todel
mkswap /tmp/.todel/swapfile # (initializes /swapfile) swapon /tmp/.todel/swapfile # (turn on new swap)
add the following to /etc/fstab:
/tmp/.todel/swapfile swap swap defaults 0 0