Installing Debian via network-inst / PXE

I had a bit of a challenge over the weekend. Oldest sons computer, an Intel Atom 330-based machine, refuses to boot from USB-sticks. It doesn’t have a normal CD/DVD reader, so I hooked one up that I found on the scrapheap in the basement, burnt a DVD with Linux Mint Debian Edition (my new favourite) and installed everything. Forgot just one thing before I removed the DVD and put the whole box back together…. to make the harddrive partition I used for installing bootable.

When I’d spent five minutes putting the box back together, I didn’t feel like dismantling it again. So… instead I took a virtual Debian server I’d installed a while earlier and installed a tftp-server on it, to make it possible for my sons computer to boot the installation from that.

So, I basically followed this Debian Installation guide, but skipping over the unnecessary parts.

Logging on to the virtual server, these are the commands I entered.


root@debbie:~# apt-get install tftpd-hpa
root@debbie:~# update-inetd --enable bootps
root@debbie:~# /etc/init.d/inetd reload
root@debbie:~# /etc/init.d/tftpd-hpa restart
Restarting HPA's tftpd: in.tftpd.

Then I downloaded the start package needed to get the installation going.

root@debbie:~# cd /srv/tftp/
root@debbie:/srv/tftp# wget http://ftp.nl.debian.org/debian/dists/squeeze/main/installer-i386/current/images/netboot/pxelinux.0

Adding the Debian network installation tar.gz package…

root@debbie:/srv/tftp# wget http://ftp.nl.debian.org/debian/dists/squeeze/main/installer-i386/current/images/netboot/netboot.tar.gz
--2011-12-10 23:38:10-- http://ftp.nl.debian.org/debian/dists/squeeze/main/installer-i386/current/images/netboot/netboot.tar.gz

… giving me the following directory content:

root@debbie:/srv/tftp# ls -lrt
total 8730
-rw-r--r-- 1 root root 8910860 Oct 5 23:02 netboot.tar.gz
-rw-r--r-- 1 root root 26816 Oct 5 23:09 pxelinux.0

I then unpacked the netboot tar.gz package.


root@debbie:/srv/tftp# tar xvfz netboot.tar.gz
root@debbie:/srv/tftp# ls -lrt
total 8705
lrwxrwxrwx 1 root root 34 Oct 5 23:02 pxelinux.cfg -> debian-installer/i386/pxelinux.cfg
lrwxrwxrwx 1 root root 32 Oct 5 23:02 pxelinux.0 -> debian-installer/i386/pxelinux.0
drwxr-xr-x 3 root root 1024 Oct 5 23:02 debian-installer
-rw-r--r-- 1 root root 69 Oct 5 23:02 version.info
-rw-r--r-- 1 root root 8910860 Oct 5 23:02 netboot.tar.gz

On my main server, which runs DHCP and other services, I made the following changes:


root@duosol:~# vi /etc/dhcp3/dhcpd.conf
...
# TFTP options
allow booting;
allow bootp;
...
group {
next-server 192.168.16.52;
host tftpclient {
# tftp client hardware address
hardware ethernet 00:1C:C0:DA:FF:D5;
filename "pxelinux.0";
}
}

“next-server” gives the IP-address of my TFTP server, while the “hardware ethernet” is the MAC-address of the machine that’s to use the TFTP-server to find its installation medium, in my case my sons computer. I found this written on the screen when just starting the machine as it tried to find the TFTP server. I guess there’s an option to allow all that ask for it to use the same, but… I couldn’t be bothered to find out. 😉

I then restarted the DHCP server.


root@duosol:~# /etc/init.d/dhcp3-server restart

When booting the client (after having turned on “allow network boot” in the BIOS), it got its IP address assigned and booted the Debian installation program at once.

When I got to the partitioning of the harddrive, I just selected “Manual partitioning”, set the partition that Linux Mint was already installed to as “bootable”, and quit the Debian installation program.

Rebooted, and… got the familiar Linux Mint startup screen.

Maybe a complex way to solve a trivial problem, but now I’ve got a TFTP-server set up and a way to install other clients and servers with Debian should the need arise. A good excuse for tinkering with “stuff” when there was nothing good on the TV anyhow. 😉

Advertisements

About magvar

Technical guy, worked with computers since I was twelve, complete nerd, but managed to get married and am now the happy father of three kids.
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s