Debian netinst with preseeding

About two weeks ago I “killed” one of our clusters in California by rebooting the main server – which itself is kind of ridiculous :oogle: However, as the cluster was mainly dead and the installed version of CentOS was really messed up (and no big fan of CentOS is working here anymore), we decided to switch those machines to Debian. As I was the one killing it and I’m also the one desperatly needing some of those machines now, I took the burden to set them up again. So I had – actually I’m still having :mrgreen: – a lot of fun with CentOS, Debian, netinst and preseeding during the last days!

For the whole setup I could mainly follow the installation guide on debian.org but some things just didn’t work out as expected. At least locally I now figured them out and the installation is working end-to-end :)
The main issue was to get the preseed.cfg to the client without having to alter the initrd. According to the manual (and tons of blogs), you just have to pass it as a kernel parameter. That’s just half of the truth. What’s missing in there is that you also have to send some more parameters right away so that the installation gets to the point where it loads the preseed.cfg (example). So if you ever have to set up something like that, don’t forget to pass in these parameters in your pxelinux.cfg/default:

append vga=normal initrd=debian-installer/i386/initrd.gz preseed/url=http://path/to/preseed.cfg debian-installer/locale=en_US console-keymaps-at/keymap=us netcfg/get_hostname=debian netcfg/get_domain=unassigned netcfg/choose_interface=eth1 -

(Don’t forget to check the interface in the last parameter. You can also skip it completely if you just have one network interface.)
My whole entry for the default Debian netinst looks like this now:

LABEL lenny
kernel debian-installer/i386/linux
append vga=normal initrd=debian-installer/i386/initrd.gz preseed/url=http://path/to/preseed.cfg debian-installer/locale=en_US console-keymaps-at/keymap=us netcfg/get_hostname=debian netcfg/get_domain=unassigned netcfg/choose_interface=eth1 -

This is enough for us right now because the cluster just has 5 machines so it’s easy to handle and we don’t intend to reinstall it that often. So there is no need for a bigger solution but if you have a big cluster with a lot of machines and you’re changing a lot of things all the time, you might want to take a look at FAI ;)

3 comments

Leave a Reply