Results 1 to 6 of 6
Hi,
is it possible to use a swap file instead of a swap partition? How can I do it with Ubuntu?
thanks in advance...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 07-31-2007 #1Just Joined!
- Join Date
- Apr 2007
- Posts
- 47
Swap file
Hi,
is it possible to use a swap file instead of a swap partition? How can I do it with Ubuntu?
thanks in advance
- 07-31-2007 #2forum.guy
- Join Date
- May 2004
- Location
- arch linux
- Posts
- 18,733
I don't think so, but maybe someone else knows differently. Of course, if you have enough RAM, you don't need any SWAP at all.
oz
- 07-31-2007 #3Linux Guru
- Join Date
- Nov 2004
- Posts
- 6,110
It's a long time since Linux used a swapfile rather than a partition. It was once possible but I don't think it is anymore with the current kernels.
The real question is - Why? The partition will perform better than a file on top of a filesystem and the swap file would take up just as much space.
- 07-31-2007 #4Just Joined!
- Join Date
- Apr 2007
- Posts
- 47
I would like to use the swap partition for /tmp. I have four primary partitions:
/, /home, swap and a partition for testing distros. My problem is that I hate logical partitions.
Since Freespire did it (the swap file is in the /boot) is technically feasible.
Of course the easy solution is to buy more ram.
- 07-31-2007 #5How to add Linux Swap file if you don’t have Swap Partition : mypapit gnu/linux blogAssuming you want to put it in “/”, Create an empty 500MB file
$ sudo dd if=/dev/zero of=/swap.img bs=1024k count=512
Format it as a swap file
$ sudo mkswap /swap.img
Add it to your running Linux system
$ sudo swapon /swap.img
Optionally you can add /swap.img to fstab for automatic swap activation.
$ sudo gedit /etc/fstab
Add this line at the end of the file
/swap.img none swap sw 0 0
Run “free -m” command to verify that you’ve added the newly created swap to your Linux based operating system.
Hope that helps!
- 07-31-2007 #6Just Joined!
- Join Date
- Apr 2007
- Posts
- 47


Reply With Quote

