Discussion:
No swap for Debian preseed automated installation
ML mail
2012-08-24 12:22:01 UTC
Permalink
Hi,

I am currently creating a preseed file to get my server installed automatically over the network with PXE boot. This server will have no swap space but I have the problem that if I do not specify a swap space in my preseed configuration file the automated Debian installation stops and opens a dialog for configuring swap space.

I deduct here that it is not possible to have a fully automated installation without a swap space. Am I right? Or are there any tricks to overcome this necessity of swap space?

Cheers,
ML
Brian
2012-08-24 12:41:57 UTC
Permalink
Post by ML mail
I am currently creating a preseed file to get my server installed
automatically over the network with PXE boot. This server will have no
swap space but I have the problem that if I do not specify a swap
space in my preseed configuration file the automated Debian
installation stops and opens a dialog for configuring swap space.
I deduct here that it is not possible to have a fully automated
installation without a swap space. Am I right? Or are there any tricks
to overcome this necessity of swap space?
No tricks involved. Download the partman-basicfilesystems udeb and
search for 'no_swap' in the templates file.
ML mail
2012-08-24 12:55:49 UTC
Permalink
That's good news, I didn't see that option in the Debian sample preseed config files. So as you recommended I checked the partman-basicfilesystems package from Ubuntu and found the template which does that. Now added the following to my debian preseed file:

d-i partman-basicfilesystems/no_swap boolean false

and am going to test it right now :)




----- Original Message -----
From: Brian <***@cityscape.co.uk>
To: debian-***@lists.debian.org
Cc:
Sent: Friday, August 24, 2012 2:41 PM
Subject: Re: No swap for Debian preseed automated installation
Post by ML mail
I am currently creating a preseed file to get my server installed
automatically over the network with PXE boot. This server will have no
swap space but I have the problem that if I do not specify a swap
space in my preseed configuration file the automated Debian
installation stops and opens a dialog for configuring swap space.
I deduct here that it is not possible to have a fully automated
installation without a swap space. Am I right? Or are there any tricks
to overcome this necessity of swap space?
No tricks involved. Download the partman-basicfilesystems udeb and
search for 'no_swap' in the templates file.
--
To UNSUBSCRIBE, email to debian-user-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Archive: http://lists.debian.org/***@desktop
Christofer C. Bell
2012-08-25 12:55:37 UTC
Permalink
Post by ML mail
d-i partman-basicfilesystems/no_swap boolean false
and am going to test it right now :)
I'd ask you to keep in mind that even "unused swap" (meaning, you do
not expect the system to need to swap) is still useful and valuable.
Sometimes processes ask for more memory than is available in the
system. The kernel will not allow the process to run unless there's
sufficient virtual memory to fulfill the request, even if the swap is
never used.

For example, you have 250MB free RAM in the machine and start an
application that asks for 500MB but will only use 150MB. Without
swap, the kernel will tell you the system is out of memory and will
not start the process. If you have sufficient swap (in this case, at
least 250MB) the process will start, your swap space will never be
used, and you'll still have 100MB free RAM. But without that swap,
you'd end up with nothing.

I just want to make sure you're aware of the consequences of not
configuring any swap space even if you do not anticipate the system
will ever need to actually page out to it.
--
Chris
Bob Proulx
2012-08-25 13:47:17 UTC
Permalink
Post by Christofer C. Bell
I'd ask you to keep in mind that even "unused swap" (meaning, you do
not expect the system to need to swap) is still useful and valuable.
Agreed.
Post by Christofer C. Bell
Sometimes processes ask for more memory than is available in the
system. The kernel will not allow the process to run unless there's
sufficient virtual memory to fulfill the request, even if the swap is
never used.
That depends upon the Linux kernel setting of vm.overcommit_memory. I
have ranted about this on a number of occasions. But the Linux kernel
default is to overcommit. In which case swap is not used in the
traditional way. Of course that setting isn't sane for serious
systems, the OOM killer might kill processes I don't want killed, and
so I always set it to not allow overcommit which is the traditional
Unix behavior. In which case swap is used in the traditional way.

And newly part of the environment is now a /tmp mounted as a tmpfs.
That use of tmpfs will probably need swap as a backing store for it.
So now swap is doubly important.

http://lists.debian.org/debian-user/2007/08/msg00022.html

http://lists.debian.org/debian-user/2008/04/msg02554.html
Post by Christofer C. Bell
I just want to make sure you're aware of the consequences of not
configuring any swap space even if you do not anticipate the system
will ever need to actually page out to it.
Agreed.

Bob
Christofer C. Bell
2012-08-25 17:47:08 UTC
Permalink
Post by Bob Proulx
That depends upon the Linux kernel setting of vm.overcommit_memory. I
have ranted about this on a number of occasions. But the Linux kernel
default is to overcommit. In which case swap is not used in the
traditional way. Of course that setting isn't sane for serious
systems, the OOM killer might kill processes I don't want killed, and
so I always set it to not allow overcommit which is the traditional
Unix behavior. In which case swap is used in the traditional way.
And newly part of the environment is now a /tmp mounted as a tmpfs.
That use of tmpfs will probably need swap as a backing store for it.
So now swap is doubly important.
http://lists.debian.org/debian-user/2007/08/msg00022.html
http://lists.debian.org/debian-user/2008/04/msg02554.html
Bob, thanks for posting these links again. You've reminded me of the
default setting of 0 and I've once again followed your advice and set
it to 2 (just in the last few minutes). I don't like the current
default, either! :)
--
Chris
Loading...