2

I have read many forum posts but still can't PXE boot image files.

usb-image.dd is my image file. Instead of using USB sticks I would like to boot live Linux by using PXE.

DEFAULT menu.c32
PROMPT 0
timeout 300

MENU TITLE PXE Menu

LABEL memtest86
 MENU LABEL Memtest86+ 5.01
 KERNEL /memtest/memtest86+-5.01

LABEL Live Linux
 MENU LABEL Live Linux test
 KERNEL memdisk
 APPEND initrd=/test/usb-image.dd

PXE Menu is working and I can boot Memtest86+ but Live Linux test fails and I can't see why. Menu is reloaded instantly.

I'm using Ubuntu 16.04 LTS.

How should I proceed?

Edit 1: Information about my usb-image.dd.

user@PXE-server:/var/lib/tftpboot/test$ fdisk -l usb-image.dd
Disk usb-image.dd: 3 GiB, 3270508544 bytes, 6387712 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 597F78FB-1090-4C9B-A779-1DC99DDAC259

Laite           Start   Loppu Sektorit  Size Tyyppi
usb-image.dd1    2048  450559   448512  219M EFI System
usb-image.dd2  450560 6371327  5920768  2,8G Microsoft basic data
usb-image.dd3 6371328 6385663    14336    7M Linux filesystem

Edit 2:

I disabled the menu and saw the error message.

Loading /test/usb-image.dd...failed: Bad file number
JPX
  • 151
  • 2
  • 2
  • 7
  • Is the memdisk kernel you are attempting to load actually present on your TFTP server? It's not a magic invocation - you still need to provide the kernel. Also, consider that a linux ISO is **extremely** large to be loading for PXE boot over TFTP. Consider using the lpxelinux variant to support loading of resources over http and serve the files from a webserver instead. – Carcer Mar 30 '17 at 08:41
  • I have copied _memdisk_ from /usr/lib/syslinux/ to /var/lib/tftpboot/ . When choosing Live Linux Test I can see flashing text _Loading memdisk...ok_ but cannot see what ne next text line is. If I get this working I will try HTTP but now it is simplier to use TFTP. – JPX Mar 30 '17 at 09:10
  • Actually, depending on your TFTP implementation your files may be too large to serve. If your server does not support blocksize negotiation the largest file it could serve would be 32MB. With blocksize, it could be up to 4GB, but your image should be smaller than that. – Carcer Mar 30 '17 at 09:14
  • I have _enable-tftp_ and _tftp-root_ in dnsmasq.conf. Now saw something like _Bad file number_ flashing in boot menu. I have this tftpd installed http://packages.ubuntu.com/search?keywords=tftpd . – JPX Mar 30 '17 at 10:29
  • I assume that the tftp retrieve for the image is failing immediately, and it's not the case that you see it take a while to retrieve the file and it then falls over. Maybe double-check that the permissions are correct on the tftp host, and the tftpd user (whatever that is) actually has permission to read the image file? – Carcer Mar 30 '17 at 12:17
  • I got little further by using _append harddisk_. Now i got errors _Loading boot sector... booting..._, _Multible active partitions_, _FATAL: INT18: BOOT FAILURE_. – JPX Mar 30 '17 at 14:01

1 Answers1

2

First of all, ensure memdisk is actually present on your TFTP server and can be served to clients. It's not a magic invocation, memdisk is a separate component of syslinux.

Secondly, loading ISOs in this way usually requires that you pass more parameters to the memdisk kernel, specifically the "iso" and often also the "raw" parameters. Try the following:

KERNEL memdisk
INITRD /test/usb-image.dd
APPEND iso raw

If your image is an isohybrid image (which it presumably is in order to load from a USB stick) and therefore has an MBR, you can probably treat it as a hard disk, as well:

KERNEL memdisk
INITRD /test/usb-image.dd
APPEND harddisk

Thirdly, consider that TFTP is very inefficient and may not necessarily support serving large files (which your image of a Linux LiveUSB certainly is). If the blocksize negotiation is not supported by your TFTP server, it cannot serve anything larger than 32MB - it is possible you are using an implementation, or an old version of an implementation, which does not support this. Consider replacing pxelinux with the lpxelinux variant instead, which supports loading additional resources over HTTP, and serve your kernel/image files from a webserver. It will be considerably faster.

KERNEL http://webserver.mydomain/memdisk
INITRD http://webserver.mydomain/test/usb-image.dd
APPEND harddisk
Carcer
  • 957
  • 6
  • 12