[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Booting netinst via PXE



Lucio Crusca wrote:
> I've followed this guide [1] and now I have my PXE server up and
> running, however that guide doesn't tell how to configure tftp-hpa
> menus for Debian, let alone the netinst version.
> [1]. https://help.ubuntu.com/community/PXEInstallMultiDistro

Note that the guide above does things slightly different than the way
Debian usually suggests to set up a PXE install of Debian.  Note that
I said different not wrong.  There are many good valid ways to do this
task.  But I think that difference may be at the source of the
confusion.

>         APPEND boot=install netboot=nfs \ 
> nfsroot=10.151.44.254:/cache/debian/7/amd64/loop \ 
> initrd=debian/7/amd64/initrd.gz \ 
> method=nfs:10.151.44.254:/cache/debian/7/amd64/loop lang=it keymap=it ip=dhcp\ 
> noipv6 ramdisk_size=10000

The above guide sets up an NFS mount to the installation image.
Basically the machine boots as an NFS disk client.  For Fedora and
OpenSUSE it mounts the installation media that way.  Instead of
booting a local cdrom it is booting a remote nfs mounted cdrom image.
And since those were netinst images the installation proceeds from
there downloading from the network.  I think.  I didn't actually set
it up to try it.  But definitely it sets up an NFS client mount.

The Ubuntu installation in the above guide is yet again different.  It
sets up the NFS client mount again.  But it uses a live cd image for
the system.  The live cd has support for installing Debian and that is
how they are going about it.  Boot what is effectively an NFS diskless
client and then use the running live cd system's launch point for
installing Debian.

> This other guide [2] tell something about Lenny, but I couldn't find the 
> debian-installer folder in the wheezy netinst ISO image.
> [2]. http://www.howtoforge.com/setting-up-a-pxe-install-server-for-multiple-linux-distributions-on-debian-lenny-p2

That article follows the more traditional Debian approach to network
installation.  It is older and written for Lenny 5 and so specific
version numbers and strings have changed but the concepts are still
the same and valid.  In that article there is no NFS used anywhere.

> I've tried adapting the instructions in both guides with a few guesses:

Since those two guides use different strategies to accomplish the task
I think that is the source of the issue.  It is hard to combine the
techniques because they are doing things in such completely different
ways.

> now Debian boots but after asking the language and keyboard tries to
> mount a CDROM (which obviously does not exist) instead of going
> networked, and the show stops.

Yes.  You have mixed strategies.  The installation is part one way and
part another way.

After spending as much time on this as I am sure that you have spent
already I think you will hate me for suggesting this.  I think you
should abandon the nfs diskless client mount strategy.  At least
initially.  It is very useful to have a bootable nfs diskless client.
I definitely have a simple nfs diskless client environment and it is
very useful.  It is a good building block for other things such as FAI
which uses it too.  But the debian-install has built in support for
network installation and doesn't need it.  It is very much simpler to
set up.  You will still use the same tftp server and dhcp server that
you already have set up now.

The official guide is here:

  http://www.debian.org/releases/stable/i386/ch04s05

This uses the redirector to automatically pick a close mirror to you.
Use it to download the netboot.tar.gz file for your architecture.  It
is architecture specific.  You may want to rename it to something with
amd64 in the name so that you can also set up an i386 flavor too.

  wget http://http.debian.net/debian/dists/wheezy/main/installer-amd64/current/images/netboot/netboot.tar.gz

Unpack that into the tftp directory.  This is the instructions from
the second howto reference you were following.  Wherever you have set
up your tftp files that is the directory to unpack the above
netboot.tar.gz file.  I have mine at /srv/tftp (using this in
/etc/default/tftpd-hpa file: TFTP_DIRECTORY="/srv/tftp") and so I end
up with files like this partial list:

  ...
  /srv/tftp/pxeboot/debian-installer/amd64/boot-screens/menu.c32
  /srv/tftp/pxeboot/debian-installer/amd64/initrd.gz
  /srv/tftp/pxeboot/debian-installer/amd64/linux
  /srv/tftp/pxeboot/debian-installer/amd64/pxelinux.0
  ...

Unpack the netboot.tar.gz file so that in your environment the files
are available over tftp.  This could be at /var if you set yours up
that way.  That part does not matter.  I like /srv for such things
rather than /var but it is arbitrary.

> however that guide doesn't tell how to configure tftp-hpa menus for
> Debian, let alone the netinst version.

Then for the menu system the documentation is basically all in the
syslinux and pxelinux documentation.

  http://www.syslinux.org/wiki/index.php/PXELINUX

I am using various menus that I like using.  I have a sub-menu for
installations.  Here is a partial set of snippets from those.

In /srv/tftp/pxeboot/pxelinux.cfg/default file:

label debianinstaller
        TEXT HELP
        Start the Debian Installer in interative mode.
        ENDTEXT
        menu label ^Interactive Debian Installer Choices
        kernel menu.c32
        append pxelinux.cfg/debian-installer.menu

label debianinstallerpreseed
        TEXT HELP
        Start the Debian Installer in automated batch install mode.
        These will automatically delete your current filesystems and
        replace them with an automated installation of Debian.
        ENDTEXT
        menu label ^Automated Debian Install Choices
        kernel menu.c32
        append pxelinux.cfg/debian-installer-preseed.menu

In /srv/tftp/pxeboot/pxelinux.cfg/debian-installer.menu file:

label Main Menu
        menu label ^Return to Main Menu
        kernel menu.c32
        append pxelinux.cfg/default

label installer32
        menu label Interactive Debian Installer 32-bit x86
        config debian-installer/i386/pxelinux.cfg/default

label installer64
        menu label Interactive Debian Installer 64-bit amd64
        config debian-installer/amd64/pxelinux.cfg/default

The above is simple.  I would start there.  But you may want
preseeding too.  So I included a preseed menu entry in the above too.
But ignore it if you don't need it.  For automated installation I use
the following.  Along with many other similar snippets named
differently with different options.

In /srv/tftp/pxeboot/pxelinux.cfg/debian-installer-preseed.menu file:

label Main Menu
        TEXT HELP
        Return to the Main Menu.
        ENDTEXT
        menu label ^Return to Main Menu
        kernel menu.c32
        append pxelinux.cfg/default

label preseed64brs
        TEXT HELP
        Install using a separate /boot partition plus swap.
        ENDTEXT
        menu label Automatically Install 64-bit amd64 ^boot-root-swap
        kernel debian-installer/amd64/linux
        append vga=788 initrd=debian-installer/amd64/initrd.gz keymap=us locale=en_US interface=auto domain=example.com auto url=http://local.example.com/debian/preseed-all-boot-root-swap.cfg --

You will of course need to adjust those "us" centric strings
appropriately for your locale.  And in preseed-all-boot-root-swap.cfg
I have selected specific things such as the disk layout and so forth.

I am hoping those hints above will show you how to set up menus with
syslinux / pxelinux.  I am using the text menus.  I like them best
because they work on all of my hardware.  They are simple for anyone
to understand and use.  But I know that other people don't like text
and like the fancy graphics of the other menus instead.  Choose
whichever you prefer and that works for you.

Start with the interactive installer configuration first.  That one is
easiest.  Plus this topic has been discussed here at length every so
often.  Looking back in the archives would find lots of discussion.

Bob

Attachment: signature.asc
Description: Digital signature


Reply to: