3

I’ve configured a computer with pxelinux and I am able to boot from DHCP/TFTP. I can receive the bootloader and then boot from a local hdd or ssd. But I want to choose with the bootloader from which device it should boot. For example, on a computer with two devices, I want to choose from which device it should boot. I’ve fiddled around with the config from pxelinux and read the documentation, but it seems it only mentions the net boot process. Here is my example config file (default)

default ssd
prompt 1
ONTIMEOUT local
timeout 3000

MENU TITLE PXE Menu

LABEL hdd
    MENU LABEL Boot local hard drive
    root= (hd0,2)
    kernel /boot/vmlinuz-3.11.6-4-desktop
    initrd=(hd0,2)/boot/initrd-3.11.6-4-desktop

LABEL ssd
    MENU LABEL Boot local hard drive
    LOCALBOOT -1

It has pxelinux 6.0.3 and I’ve tried nearly every combination, but the only answer is always that it can’t find the kernel or initrd file, no matter if I say /dev/sda2 or (hd0,2) or something.

Am I missing something, or is this task not possible with pxelinux?


For every option, the answer is always something is "No such file or directory", except for option "two", that boots ok. (I couldn't get a log from the console). tftp from client to server is working without any problems.

default menu.c32
prompt 0
ONTIMEOUT local
timeout 3000

MENU TITLE PXE Menu

LABEL one
        MENU LABEL Boot local hard drive
    root= hd0 2
    kernel /boot/vmlinuz-3.11.6-4-desktop

LABEL two
        MENU LABEL Boot local hard drive
        LOCALBOOT 0

LABEL three
        MENU LABEL Boot local hard drive
    root=/dev/sda2
    kernel vmlinuz-3.11.6-4-desktop
    initrd=/boot/initrd-3.11.6-4-desktop.gz

LABEL four
        MENU LABEL VIER
    root=/dev/sda2 rw
        KERNEL ftp://179.99.99.1/chain.c32

LABEL five
    MENU LABEL Hole chain.c32 uebers Netz
    root hd0 2
    KERNEL chain.c32

LABEL six
        MENU LABEL VIER
    root=(hd0,2) rw
        KERNEL /boot/chain.c32

LABEL seven
    MENU LABEL Hole chain.c32 uebers Netz
    root hd0 2
    KERNEL /boot/chain.c32
    initrd=/boot/initrd-3.11.6-4-desktop.gz 

The status of the xinetd daemon shows that the client tftp is requesting the files from the server. It seems, as if the client is getting the files from the server. But why does it not process it...

xinetd.service - Xinetd A Powerful Replacement For Inetd
   Loaded: loaded (/usr/lib/systemd/system/xinetd.service; enabled)
   Active: active (running) since Wed 2016-06-29 16:08:46 CEST; 21min ago
 Main PID: 1536 (xinetd)
   CGroup: /system.slice/xinetd.service
           |-1536 /usr/sbin/xinetd -stayalive -dontfork
           `-2938 in.tftpd -s /rde/installation/tftpboot -vvv

Jun 29 16:21:47 uaewg-srv in.tftpd[4161]: RRQ from ::ffff:199.99.99.10 filename menu.c32
Jun 29 16:22:32 uaewg-srv in.tftpd[4279]: RRQ from ::ffff:199.99.99.10 filename chain.c32
Jun 29 16:22:32 uaewg-srv in.tftpd[4280]: RRQ from ::ffff:199.99.99.10 filename chain.c32
Jun 29 16:22:36 uaewg-srv in.tftpd[4288]: RRQ from ::ffff:199.99.99.10 filename chain.c32
Jun 29 16:24:17 uaewg-srv in.tftpd[4544]: RRQ from ::ffff:199.99.99.10 filename pxelinux.0
Jun 29 16:24:17 uaewg-srv in.tftpd[4545]: RRQ from ::ffff:199.99.99.10 filename ldlinux.c32
Jun 29 16:24:17 uaewg-srv in.tftpd[4556]: RRQ from ::ffff:199.99.99.10 filename pxelinux.cfg/default
Jun 29 16:24:17 uaewg-srv in.tftpd[4558]: RRQ from ::ffff:199.99.99.10 filename menu.c32
Jun 29 16:24:34 uaewg-srv in.tftpd[4580]: RRQ from ::ffff:199.99.99.10 filename chain.c32
Jun 29 16:24:38 uaewg-srv in.tftpd[4588]: RRQ from ::ffff:199.99.99.10 filename chain.c32
2
  • @Mongrel: Please use more descriptive comments when you suggest edits. Jun 24, 2016 at 6:38
  • in none of your options (one to seven) have you done what I suggested in my answer. Get rid of the root= and just have a KERNEL chain.c32 and APPEND hd0 0 (to chainload the MBR of hd0. alternatively APPEND HD0 2 to chainload whatever boot-loader may be in partition 2, if any). if chain.c32 is not in the top-level tftp directory, then include the tftp path.
    – cas
    Jun 29, 2016 at 21:04

2 Answers 2

2

I found out, how to configure pxelinux for my needs. tftp was already running and working, i made a "tail -f /var/log/messages" to discover that chain.c32 was not working (it was loading, but nothing happened):

2016-06-29T16:15 uaewg-srv xinetd[1536]: START: tftp from=::ffff:172.99.199.9
2016-06-29T16:15 uaewg-srv in.tftpd[2939]: RRQ from ::ffff:172.99.199.9 filename chain.c32
2016-06-29T16:18 uaewg-srv sshd[3183]: Accepted keyboard-interactive/pam for uae_wg_sim from 127.0.0.1 port 54948 ssh2

Then i could try it with the other files, i provided the vmlinuz and initrd files in the ../tftpboot/pxelinux.cfg/default config file:

prompt 0
ONTIMEOUT local
timeout 3000

MENU TITLE PXE Menu

LABEL local
        MENU LABEL Boot local hard drive
        LOCALBOOT 0

LABEL hdd
      kernel vmlinuz-3.11.6-4-desktop
      APPEND initrd=initrd-3.11.10-21-desktop  root=/dev/sda2

chain.c32, menu.c32 did either not worked on the system, i don´t know why, maybe i try to find out if i have time left, i am glad that it is now working. /var/log/messages is a good help for error diagnostic, it was not clear, who was responsible for the tftpd, but i found out that it presumably was started by xinetd and not systemd. I changed the content of /etc/xinetd.d/tftp to :

service tftp
{
#   per_source      = 11
    cps         = 100 2
    socket_type     = dgram
    protocol        = udp
    wait            = yes
    user            = root
    server          = /usr/sbin/in.tftpd
    server_args     = -s /rde/installation/tftpboot -vvv
    flags           = IPv6 IPv4
}

regards and thanks to cas for his help!

4
  • chain.c32 didn't work because you weren't using it right. It needs arguments (the disk and partition to chainload), which are provided by the APPEND keyword....same as the vmlinuz kernel needs args (like an initrd filename and root filesystem device/label/uuid) which are provided by the APPEND keyword. LOCALBOOT is probably better.
    – cas
    Jun 30, 2016 at 15:11
  • Hello cas, maybe i am too dull, but i can try what i want, i couldn´t get this chain.c32 running. I´ve configured as you advised (KERNEL /path/to/chain.c32 APPEND hd0 2, where hd0,2 is /dev/sda2), and the chain.c32 is found on the server and served, /var/log/messages: 2016-07-01T08:00:23. hostsrv in.tftpd[11275]: RRQ from ::ffff:172.21.143.10 filename chain.c32, but the hosts says"failed to load com32 file chain.c32". I suppose that there is something odd with my chain.c32 in conjunction with the loader, maybe it needs an update, but i can´t do this here. Thank you for your suggestions
    – Coliban
    Jul 1, 2016 at 6:18
  • have you installed a boot loader (like grub) in /dev/sda2? almost certainly not - you've probably installed it into the MBR on /dev/sda. so APPEND hd0 0, not hd0 2.
    – cas
    Jul 1, 2016 at 9:34
  • It doesn´t run with different disks either, maybe, there is something fundamental wrong but i can´t figure it out now because i can´t change the test system now. Maybe, if i set up a new system it is working. Thanks
    – Coliban
    Jul 1, 2016 at 10:43
1

You need to use the chain loader (chain.c32) from syslinux. As with the other syslinux modules there are different versions for BIOS, efi32, and efi64.

LABEL local
    MENU DEFAULT
    MENU LABEL Boot from Local Hard Disk
    KERNEL /path/to/chain.c32
    APPEND hd0 2

That's adapted slightly from my /srv/tftp/default file - my version has KERNEL http://ip.ip.ip.ip/tftp/chain.c32 (my httpd is configured to serve /tftp/ from /srv/tftp - tftp would work just as well) and APPEND hd0 0.

10
  • Thanks, cas. But it seems, it is not working here. I tried only the path (/usr/share/syslinux/chain.c32) or path with device (hd0,2)/usr/share/syslinux/chain.c32, nothing works, all the time pxelinux is complaining that he can´t find the file. When i interrupt the bootprocess at the boot-command prompt (with e), and do a "ls (hd0,2)/usr/share/syslinux/chain.c32" it finds that file. It is a mystery...
    – Coliban
    Jun 24, 2016 at 6:47
  • try serving chain.c32 via tftp or http. that way you don't need to have it pre-installed on every machine.
    – cas
    Jun 24, 2016 at 7:20
  • since i do not install a web-service, i try to do it with tftp but until now, i could not find the description for pxelinux default config. I continue to do some research
    – Coliban
    Jun 24, 2016 at 9:09
  • While tftp is working and i can get the chain.c32 manual from remote with tftp, it is not working with pxelinux: LABEL vier MENU LABEL VIER root=(hd0,2) KERNEL tftp://172.21.143.1/chain.c32
    – Coliban
    Jun 24, 2016 at 9:23
  • try just KERNEL chain.c32 (assuming chain.c32 is in the top-level directory of your tftp server - e.g. /srv/tftp/. BTW, it's probably best to just have APPEND hd0 and rely on whatever boot-loader is in the MBR of the first disk.
    – cas
    Jun 24, 2016 at 9:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .