You are not logged in.

#1 2019-05-30 19:17:59

uruz
Member
Registered: 2018-07-04
Posts: 37

Netboot installation, iPXE, creating bootable media

I'm interested in creating a bootable USB drive for netboot installation so I don't have to download a new .iso each time I want to try a new Arch installation on a computer.  An unchanging USB that could install the latest version would be convenient.

I've made several unsuccessful attempts.  I used dd to write the netboot image to a USB drive, and marking the partition as active.  I've individually tried ipxe.lkrn, ipxe.pxe, and ipxe.efi.

The only progress I made appeared to be with ipxe.lkrn.  It gave an error message that there was no active partition, even after using fdisk to mark it as active.  The other files only gave me a blank screen.

Am I going about this the right way at all?  Is there something obvious I'm missing?

Edit: some info on the motherboard, an MSI B250 PC MATE MS-7A72.  BIOS settings include:
Boot mode select:  LEGACY+UEFI
Onboard LAN Controller:  Enabled
LAN Option ROM:  Enabled
Network stack:  Enabled
Ipv4 PXE Support:  Enabled
Ipv6 PXE Support:  Enabled

Last edited by uruz (2019-05-30 19:50:26)

Offline

#2 2019-05-30 19:43:55

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: Netboot installation, iPXE, creating bootable media

Have you seen https://wiki.archlinux.org/index.php/Netboot?

I've never actually tried this myself but that page says to copy the files to a partition rather than the entire block device.


Jin, Jîyan, Azadî

Offline

#3 2019-05-30 20:16:08

uruz
Member
Registered: 2018-07-04
Posts: 37

Re: Netboot installation, iPXE, creating bootable media

Yes.  My first thought was to follow the UEFI section, because my boot mode was UEFI (only).

ipxe.efi:  I first tried using efibootmgr to "create a boot entry" on my USB drive (I am a newbie), but now I think the purpose of that section is to add an additional boot option to the current installation.  That could be very helpful for making a separate install on the current machine, but wouldn't make a USB drive that I could take to my laptop, for example.

ipxe.pxe:  Frankly, I'm not sure what to do with this.  It looks like I need a PXE environment to begin with.

ipxe.lkrn:  I glossed over this when I saw it involved editing the current system, then simply tried burning the file to my USB.  Now that I'm rereading that section, I think it may be the solution.  I plan to work on it tonight, and give an update.

Offline

#4 2019-05-30 20:39:54

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: Netboot installation, iPXE, creating bootable media

uruz wrote:

ipxe.efi:  I first tried using efibootmgr to "create a boot entry" on my USB drive

The efibootmgr command modifies the NVRAM boot entries on the motherboard.

You might be able to get a standalone USB stick working by copying ipxe.efi to /EFI/BOOT/BOOTX64.EFI on the EFI system partition, that should be loaded automatically by UEFI systems.


Jin, Jîyan, Azadî

Offline

#5 2019-06-04 04:09:46

uruz
Member
Registered: 2018-07-04
Posts: 37

Re: Netboot installation, iPXE, creating bootable media

Thank you.  That worked fine to get the USB to boot.  Makes sense when I think about it.  But then it failed to configure network after booting from the mirror.  Maybe I should have done something else at the Netboot menu.  I’ll include everything here.

The first screen loaded, and eventually looked like this:

iPXE initialising devices...ok

iPXE 1.0.0+ (b6ffe) -- Open Source Network Boot
Features: DNS HTTP HTTPS iSCSI TFTP SRP AoE EFI
Configuring (net0 30:9c:23:9f:a5:bb)............
https://www.archlinux.org/releng/netboot/archlin

Then gave the Arch Linux Netboot menu.  I chose the mirror.

Settings
Architecture: x86_64
Release: 2019.06.01
Mirror: http://mirror.cc.columbia.edu/pub/linux/archlinux/
Boot options: ip=dhcp net.ifnames=0 BOOTIF=01-30:9c:23:9f:a5:bb

Boot Arch Linux
Drop to iPXE shell
Reboot
Exit iPXE

Then I selected "Boot Arch Linux".  Next screen:

Booting Arch Linux x86_64 2019.06.01 from http://mirror.cc.columbia.edu/pub/linux/archlinux/

http://mirror.cc.columbia.edu/pub/linux/archlinux/iso/2019.06.01/arch/boot/x86_64/vmlinuz... ok
http://mirror.cc.columbia.edu/pub/linux/archlinux/iso/2019.06.01/arch/boot/x86_64/vmlinuz.ipxe.sig... ok
http://mirror.cc.columbia.edu/pub/linux/archlinux/iso/2019.06.01/arch/boot/intel_ucode.img... ok
http://mirror.cc.columbia.edu/pub/linux/archlinux/iso/2019.06.01/arch/boot/intel_ucode.img.ipxe.sig... ok
http://mirror.cc.columbia.edu/pub/linux/archlinux/iso/2019.06.01/arch/boot/x86_64/archiso.img... ok
http://mirror.cc.columbia.edu/pub/linux/archlinux/iso/2019.06.01/arch/boot/x86_64/archiso.img.ipxe.sig... ok

Then it stopped on the next screen with this text:

:: running early hook [udev]
Starting version 242.29-1-arch
:: running early hook [archiso_pxe_nbd]
:: running hook [udev]
:: Triggering uevents...
:: running hook [memdisk]
:: running hook [archiso]
:: running hook [archiso_loop_mnt] 
:: running hook [archiso_pxe_common]
It ran early hooks, triggered uevents, ran hooks, then I think it got stuck here:
IP-Config: eth0 hardware address 30:9c:23:9f:a5:bb mtu 1500 DHCP
[    5.550806] sd 6:0:0:0: [sdc] No Caching mode page found
[    5.550829] sd 6:0:0:0: [sdc] Assuming drive cache: write through
[    5.614469] hid-generic 0003:0D8C:0319.0004: No inputs registered, leaving
IP-Config: no response after 20 secs - giving up
ERROR; Failed to configure network
  Falling back to interactive prompt
  You can try to fix the problem manually, log out when you are finished
sh: can't access tty; job control turned off
[rootfs ]#

And here I had problems.  Running standard installation commands gave errors:

[rootfs ]# ls /usr/share/kbd/keymaps
ls: usrshare/kbd/keymaps: No such file or directory
[rootfs ]# loadkeys
sh: loadkeys: not found
[rootfs ]# timedatectl
sh: timedatectl: not found
[rootfs ]# ping archlinux.org
ping: bad address ‘archlinux.org’
[rootfs ]# ping http://archlinux.org
ping: bad port spec ‘http://archlinux.org’
[rootfs ]# ping https://archlinux.org
ping: bad port spec ‘https://archlinux.org’
[rootfs ]# fdisk
sh: fdisk: not found
[rootfs ]# mkfs.ext4
sh: mkfs.ext4: not found

Exception:  This command worked fine:

[rootfs ]# ls /sys/firmware/efi/efivars

If you have any suggestion, please let me know.  And while we're on this topic, do you think there's any benefit to doing a Netboot vs. using the normal .iso?  My thought was that it would save time by starting us with the most up-to-date system, but now I think the installer only has to get us to pacstrap.  Then the new system gets the latest packages no matter how we got there.  How old would the .iso image have to be to be "bad"?

Offline

#6 2019-06-04 17:28:55

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: Netboot installation, iPXE, creating bootable media

uruz wrote:
ERROR; Failed to configure network
  Falling back to interactive prompt
  You can try to fix the problem manually, log out when you are finished

^ This is telling you to attempt to connect manually and then log out so try that.

uruz wrote:

do you think there's any benefit to doing a Netboot vs. using the normal .iso?

Not really, the pacstrap command will always download the latest package versions to the new system, as you note.

uruz wrote:

How old would the .iso image have to be to be "bad"?

No idea but probably at least several months.


Jin, Jîyan, Azadî

Offline

#7 2019-06-05 02:44:10

uruz
Member
Registered: 2018-07-04
Posts: 37

Re: Netboot installation, iPXE, creating bootable media

Head_on_a_Stick wrote:
uruz wrote:
ERROR; Failed to configure network
  Falling back to interactive prompt
  You can try to fix the problem manually, log out when you are finished

^ This is telling you to attempt to connect manually and then log out so try that.

I'm willing, but how do I connect manually?  I don't know what I would do at a rootfs prompt to connect, and have tried using the ip command with no success.  If this is very involved or beyond a newbie, I am content to leave it be.

Head_on_a_Stick wrote:
uruz wrote:

How old would the .iso image have to be to be "bad"?

No idea but probably at least several months.

That makes sense.  Also, the Netboot menu offered to use any of the three most recent Arch releases.  I still would like to know how to connect from the rootfs prompt, but for now I plan to just use the .iso like a normal guy.

Offline

#8 2019-06-05 16:49:07

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: Netboot installation, iPXE, creating bootable media

uruz wrote:

I'm willing, but how do I connect manually?  I don't know what I would do at a rootfs prompt to connect, and have tried using the ip command with no success.

What did you try, exactly? https://bbs.archlinux.org/viewtopic.php?id=57855

The dhcpcd program will assign addresses for you, is that available?

uruz wrote:

If this is very involved or beyond a newbie, I am content to leave it be.

There will be no surrender in this thread! mad


Jin, Jîyan, Azadî

Offline

#9 2019-06-05 21:33:25

uruz
Member
Registered: 2018-07-04
Posts: 37

Re: Netboot installation, iPXE, creating bootable media

Head_on_a_Stick wrote:

There will be no surrender in this thread! mad

Yes, sir!  big_smile

Head_on_a_Stick wrote:
uruz wrote:

I'm willing, but how do I connect manually?  I don't know what I would do at a rootfs prompt to connect, and have tried using the ip command with no success.

What did you try, exactly? https://bbs.archlinux.org/viewtopic.php?id=57855

The dhcpcd program will assign addresses for you, is that available?

No:

[rootfs ]# dhcpcd
sh: dhcpcd: not found

I followed the 7 points here:  https://wiki.archlinux.org/index.php/Ne … connection

1. Your network interface is listed and enabled.

[rootfs ]# ip link show dev eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel qlen 1000
    link/ether 30:9c:23:9f:a5:bb brd ff:ff:ff:ff:ff:ff

2. You are connected to the network. The cable is plugged in or you are connected to the wireless LAN.
(The cable is plugged in.)

3. Your network interface has an IP address.

[rootfs ]# ip address show
1: lo: <LOOPBACK> mtu 65536 qdisc noop qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel qlen 1000
    link/ether 30:9c:23:9f:a5:bb brd ff:ff:ff:ff:ff:ff
    inet6 2600:6c40:7e7f:f08a:329c:23ff:fe9f:a5bb/64 scope global dynamic
       valid_lft 365489sec preferred_lft 365489sec
    inet6 fd64:5071:1daa:0:329c:23ff:fe9f:a5bb/64 scope global dynamic
       valid_lft 7107sec preferred_lft 3507sec
    inet6 fe80::329c:23ff:fe9f:a5bb/64 scope link
       valid_lft forever preferred_lft forever

4. Your routing table is correctly set up.

[rootfs ]# ip route show
[rootfs ]# ip route add default via default dev eth0
[rootfs ]# ip route show
default dev eth0

I entered "default" for "PREFIX" and "address" in the second command (ip route add PREFIX via address dev interface).

5. You can ping a local IP address (e.g. your default gateway).
6. You can ping a public IP address (e.g. 8.8.8.8).
Unsure of these.  Would local IP address be 127.0.0.0?  In any case, I pinged google.com.

[rootfs ]# ping www.google.com
ping: bad address ‘www.google.com’

7. Check if you can resolve domain names (e.g. archlinux.org).

[rootfs ]# getent hosts archlinux.org
sh: getent: not found

A final question is, at the end of this, what do I do to get out of rootfs if I'm successful? 

[rootfs ]# logout
sh: logout: not found
[rootfs ]# reboot
[rootfs ]# 
[rootfs ]# exit

Produces a long bit of output including a kernel panic, which I can copy if needed, but then the system is stuck.  Nothing happens for minutes.  CTRL+ALT+DEL does nothing.  I have to hold the power button to shut down.

If I don't type the exit command, I can reboot with CTRL+ALT+DEL.

Offline

#10 2019-06-06 13:31:28

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,177

Re: Netboot installation, iPXE, creating bootable media

Booting Arch Linux x86_64 2019.06.01 from http://mirror.cc.columbia.edu/pub/linux/archlinux/

http://mirror.cc.columbia.edu/pub/linux/archlinux/iso/2019.06.01/arch/boot/x86_64/vmlinuz... ok
http://mirror.cc.columbia.edu/pub/linux/archlinux/iso/2019.06.01/arch/boot/x86_64/vmlinuz.ipxe.sig... ok
http://mirror.cc.columbia.edu/pub/linux/archlinux/iso/2019.06.01/arch/boot/intel_ucode.img... ok
http://mirror.cc.columbia.edu/pub/linux/archlinux/iso/2019.06.01/arch/boot/intel_ucode.img.ipxe.sig... ok
http://mirror.cc.columbia.edu/pub/linux/archlinux/iso/2019.06.01/arch/boot/x86_64/archiso.img... ok
http://mirror.cc.columbia.edu/pub/linux/archlinux/iso/2019.06.01/arch/boot/x86_64/archiso.img.ipxe.sig... ok

Those indicate you have  a working connection at that time.

Step 3 and 4 as well as the ip-config output indicate after booting the kernel your network card can't find a dhcp server.

Since PXE / Netboot needs to contact a dhcp server also, it seems strange that it works from netboot image, but not from live kernel .

What kind of network are you on ?

Last edited by Lone_Wolf (2019-06-06 13:32:00)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#11 2019-06-06 15:33:16

uruz
Member
Registered: 2018-07-04
Posts: 37

Re: Netboot installation, iPXE, creating bootable media

I'm at home, with a wired connection:
computer --> router --> cable modem --> ISP

I'll try going directly from computer to modem, in case that matters.

Offline

#12 2019-06-06 18:58:14

uruz
Member
Registered: 2018-07-04
Posts: 37

Re: Netboot installation, iPXE, creating bootable media

I tried plugging the computer directly into the modem, used the Netboot USB, and got slightly different results on two occasions.  Thinking there was some inconsistent internet connection because of unplugging/replugging, I made sure my current Arch installation had a good internet connection to the modem before rebooting and trying again.  Here is the result:

IPXE initialising devices...ok

iPXE 1.0.0+ (b6ffe) –- Open Source Network Boot
Features: DNS HTTP HTTPS iSCSI TFTP SRP AoE EFI
Configuring (net0 30:9c:23:9f:a5:bb)...... ok
https://www.archlinux.org/releng/netboot/archlin
............. Connection timed out (http://ipxe.
iPXE> help

Available commands:

autoboot
boot
chain
choose
clear
config
cpuid
dhcp
echo
exit
goto
help
ibstat
ifclose
ifconf
ifopen
ifstat
imgargs
imgexec
imgfetch
imgfree
imgload
imgselect
imgstat
imgtrust
imgverify
inc
initrd
iseq
isset
item
iwlist
iwstat
kernel
login
menu
module
prompt
pxebs
read
reboot
route
sanboot
sanhook
sanunhook
set
shell
show
sleep
sync

Type “<command> --help” for further information

iPXE>

The initial block of text is cut off because it appears close to the right edge of the monitor.  The available commands didn't appear in any obvious order, so I alphabetized them here.

Offline

#13 2019-06-09 18:34:26

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: Netboot installation, iPXE, creating bootable media

Apologies for the delayed response.

uruz wrote:

Available commands:

[...]
dhcp

^ Try that.

You have an IPv6 router and I have no idea how to assign static addresses for that, sorry.

It is "safe" to hold the power button down btw, the filesystems aren't mounted and so cannot be damaged.


Jin, Jîyan, Azadî

Offline

#14 2019-06-10 04:59:07

uruz
Member
Registered: 2018-07-04
Posts: 37

Re: Netboot installation, iPXE, creating bootable media

No problems at all with a delay.  I’m happy to have any help.
Good to know about holding the power button.  Thanks for explaining about the file systems.

This is what I got when running dhcp at an iPXE shell:

iPXE> ifconf
Configuring (net0 30:9c:23:9f:a5:bb)...... ok
iPXE> dhcp
Configuring (net0 30:9c:23:9f:a5:bb)...... ok
iPXE> ifstat
net0: 30:9c:23:9f:a5:bb using i219v-2 on 0000:00:1f.6 (open)
 [Link:up, TX:24 TXE:1 RX:174 RXE:120]
 [TXE: 1 x “Operation not supported (http://ipxe.org/3c654083)”]
 [RXE: 113 x “Operation not supported (http://ipxe.org/3c654083)”]
 [RXE: 7 x “The socket is not connected (http://ipxe.org/3c654083)”]
iPXE> exit

This sent me back to the BIOS boot select menu.  I couldn’t think of any other command.  Nothing was different when I netbooted again.  This iPXE prompt gave the same result whether I netbooted with the computer plugged directly into the modem, or if the computer was plugged into the router and I selected “Drop to iPXE shell” from the Arch Linux Netboot menu described above.

To recap, plugging directly into the modem drops me to an iPXE prompt.  Plugging into the router leads me to the Arch Linux Netboot menu where I have essentially two options:
1.  Drop to an iPXE shell, which appears to me to be the same as when I bypass the router.
2.  Select “Boot Arch Linux” from that menu to get a rootfs prompt, where I haven’t made any progress.

In case it matters, this is the result when I type help from the rootfs prompt:

[rootfs ]# help
Built-in commands:
        . : [ [[ alias bg break cd chdir command continue echo eval exec
        exit export false fg getopts hash help history jobs kill let
        local printf pwd read readonly return set shift source test times
        trap true type ulimit umask unalias unset wait
[rootfs ]# dhcp
sh: dhcp: not found

No commands stand out to me as being helpful, but I'm willing to try any ideas.

Since I’m trying with and without the router, should I try assigning a static address?  The dhcp command returned “ok” but nothing else I could see.  Is there another method?
Also, is there a target or expected audience for netbooting?  I wonder if others have had any problems, or if my situation is unusual.

Offline

Board footer

Powered by FluxBB