[CentOS] Relocating /boot and /

John Summerfield debian at herakles.homelinux.org
Thu Apr 12 15:08:02 UTC 2007


Mark Hull-Richter wrote:
> On 4/11/07, John Summerfield <debian at 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 at ns ~]# grep swap /etc/fstab
/var/swapfile           swap                    swap    auto
[root at 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.



-- 

Cheers
John

-- spambait
1aaaaaaa at coco.merseine.nu  Z1aaaaaaa at coco.merseine.nu

Please do not reply off-list



More information about the CentOS mailing list