Mark Hull-Richter wrote:
On 4/11/07, John Summerfield debian@herakles.homelinux.org wrote:
There is no advantage*, with Linux 2.6 kernels, to having a swap partition over having a swap file. Swap files are more flexible, easier to manage. As a Linux Kernel Engineer, you should know that;-)
- unless you're using suspend to disk, I'm not sure about that.
That's my title - I'm still working my way into it, and I'm learning as fast as I can.
Actually, no, I didn't know that. The last kernel I was familiar with (for about six months) was pre-2.0.
Does that mean (and this applies to another thread along this line that's also going on around here I think) that we don't need a swap partition at all? Is the swap file automatic, or do we have to specify it (yeah, I know, rtfm, but where is t.f.m.?).
I mostly do not have swap partitions, I do need to create them manually. Typically this: cd /var dd if=/dev/zero of=swapfile bs=$((1*1024*1024)) count=512 mkswap swapfile swapon swapfile
You can (with a luck) do this when you find you need (more) swap.
Then this: [root@ns ~]# grep swap /etc/fstab /var/swapfile swap swap auto [root@ns ~]# so it's on next time.
Note that you can specify priorities, so one swap area's fully used before another is started. This is useful under VM where Linux often swaps to a ramdisk first, then real disk second. One organises alarms to go off to see why the penguin's behaving badly.