Disabling swap at boot.

Tom H tomh0665 at gmail.com
Fri Feb 18 05:33:24 UTC 2011


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).

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.

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




More information about the ubuntu-users mailing list