Disabling swap at boot.

Goh Lip g.lip at gmx.com
Fri Feb 18 06:34:11 UTC 2011


On Fri, 18 Feb 2011 13:33:24 +0800, Tom H <tomh0665 at gmail.com> wrote:

> On Thu, Feb 17, 2011 at 11:37 PM, Goh Lip <g.lip at gmx.com> wrote:
>>
>> I wanted to disable swap at boot, so I added "noswap" (besides nomce)  
>> at the
>> linux line of the grub entry. However noted swap is still enabled (at my
>> desktop)......
>>
>> pop at cruz:~$ swapon -s
>> Filename                                Type            Size    Used
>>  Priority
>> /dev/sda6                               partition       2559996 0        
>> -1
>>
>> Is there something I missed out?
>>
>> note: I do not want to disable swap at fstab as this OS (ubuntu with  
>> e17) is
>> on the thumb drive and when at my desktop, I wanted the swap to be  
>> enabled
>> (booted by the desktop grub) and when at other computers (booted by the
>> thumb grub) and obviously unable to use swap, I do not want the system  
>> to
>> search for non-existent swap partition.
>
> The noswap kernel option is a Debianism:
>
> http://www.mjmwired.net/kernel/Documentation/kernel-parameters.txt
>
> On Debian, "/etc/init.d/checkroot.fs" checks for "$NOSWAP" after
> sourcing "/lib/init/vars.sh", which sets "$NOSWAP".
>
> On Ubuntu, "/etc/init/mountall.conf" calls mountall, which "reads
> fstab(5)  and calls fsck(8), mount(8) and swapon(8) in the correct
> order to mount filesystems once the underlying devices have been
> created by udevd(8)" (from man page).
>


Oh, that explains it. Had been trying hard to figure why this doesn't work.
As usual, Tom, your answers are spot on. Thanks again.



> I have two questions though.
>
> 1. Does the search for a swap partition/file take *that* long?! I have
> three VMs where I just track some dev branches where, out of laziness
> and desire for speed, I have sda1 set up as the only ("/") partition
> and I don't see much (if any) of a delay for a search for a swap
> partition at boot.
>

Heh heh, not really. Also I confess I do not see my swap being used at all  
now too, ever since flash doesn't crash firefox some time back. Perhaps I  
am just being fastidious trying to get things set up right and not being  
practical about it. (talking to myself -- fastidious? more like fussy  
querurous cantankerous old fart!  :) ).

> 2. I'm not sure what you're trying to accomplish. What's the thumb
> drive's install's swap line in fstab?
>

Had resumed doing a bit of travelling, and like in the past, just taking  
the thumb instead of the labtop. Computers are everywhere.
# swap was on /dev/sda6 during installation
UUID=409eef4d-2da2-4a06-91aa-21f4bd388b8c none            swap     
sw              0       0


Thanks, regards - Goh Lip
-- 
I used to have an open mind,
but my brains kept falling out.




More information about the ubuntu-users mailing list