Difference between revisions of "Netboot"

From ArchWiki
Jump to navigation Jump to search
(style; wording; wikilinks)
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
[[Category:Installation process]]
 
[[Category:Installation process]]
 +
[[Category:Arch projects]]
 
[[ja:Netboot]]
 
[[ja:Netboot]]
 
[[lt:Netboot]]
 
[[lt:Netboot]]
Line 17: Line 18:
 
* Create MBR partition table on the device.
 
* Create MBR partition table on the device.
 
* Create a primary partition with [[FAT32]] file system and flag it as active.
 
* Create a primary partition with [[FAT32]] file system and flag it as active.
* Mount partition, create {{ic|boot/syslinux}} directory there and copy {{ic|ipxe.lkrn}} to it
+
* Mount partition, create {{ic|boot/syslinux}} directory there and copy {{ic|ipxe.lkrn}} to the {{ic|boot}} directory.
  
 
  # mount /dev/sdc /mnt
 
  # mount /dev/sdc /mnt
Line 25: Line 26:
 
* Create config for syslinux
 
* Create config for syslinux
  
{{hc|/mnt/boot/syslinux/syslinux.cfg |2=
+
{{hc|/mnt/boot/syslinux/syslinux.cfg|2=
 
DEFAULT arch_netboot
 
DEFAULT arch_netboot
 
   SAY Booting Arch over the network.
 
   SAY Booting Arch over the network.
Line 38: Line 39:
 
* Install Syslinux MBR and Syslinux itself
 
* Install Syslinux MBR and Syslinux itself
  
  # ms-sys --mbrsyslinux /dev/sdc
+
  # dd bs=440 count=1 conv=notrunc if=/usr/lib/syslinux/bios/mbr.bin of=/dev/sdc
 
  # syslinux --directory /boot/syslinux/ --install /dev/sdc1
 
  # syslinux --directory /boot/syslinux/ --install /dev/sdc1
  
Line 53: Line 54:
 
== UEFI ==
 
== UEFI ==
  
The {{ic|ipxe.efi}} image can be used to launch Arch Linux netboot in UEFI mode. Only 64-bit UEFI is supported. The {{ic|ipxe.efi}} image can be added as a boot option via [[efibootmgr]], launched from a [[boot manager]], like [[systemd-boot]], or directly from the [[Unified Extensible Firmware Interface#UEFI Shell|UEFI shell]].
+
The {{ic|ipxe.efi}} image can be used to launch Arch Linux netboot in UEFI mode. Only 64-bit UEFI is supported. The {{ic|ipxe.efi}} image can be added as a boot option via [[efibootmgr]], launched from a [[boot manager]], like [[systemd-boot]] or [[rEFInd]], or directly from the [[Unified Extensible Firmware Interface#UEFI Shell|UEFI shell]].
  
 
=== Installation with efibootmgr ===
 
=== Installation with efibootmgr ===
Line 66: Line 67:
 
Then you can create a boot entry as follows:
 
Then you can create a boot entry as follows:
  
  # efibootmgr --create --disk /dev/sda --part 1 --loader /EFI/arch_netboot/arch_netboot.efi --label "Arch Linux Netboot"
+
  # efibootmgr --create --disk /dev/sda --part 1 --loader /EFI/arch_netboot/arch_netboot.efi --label "Arch Linux Netboot" --verbose

Latest revision as of 08:03, 16 March 2019

Netboot images are small (< 1 MiB) images that can be used to download the latest Arch Linux release on the fly upon system boot. It is unnecessary to update the netboot image, the newest release will be available automatically. Netboot images can be downloaded from the Arch Linux website.

BIOS

To use netboot on a BIOS-based computer, you need either the ipxe.lkrn or ipxe.pxe image.

Using ipxe.lkrn

The ipxe.lkrn image can be booted like a Linux kernel. Any Linux boot loader (like GRUB or Syslinux) can be used to load it from your hard drive, a CD or a USB drive. For example, the Syslinux wiki gives instructions to install[1] and configure[2] Syslinux on a bootable medium.

You can make flash drive that boots ipxe.lkrn with the following steps:

  • Find out your device path using lsblk. Let us assume it is /dev/sdc.
  • Create MBR partition table on the device.
  • Create a primary partition with FAT32 file system and flag it as active.
  • Mount partition, create boot/syslinux directory there and copy ipxe.lkrn to the boot directory.
# mount /dev/sdc /mnt
# mkdir -p /mnt/boot/syslinux
# cp ipxe.lkrn /mnt/boot
  • Create config for syslinux
/mnt/boot/syslinux/syslinux.cfg
DEFAULT arch_netboot
   SAY Booting Arch over the network.
LABEL arch_netboot
   KERNEL /boot/ipxe.lkrn
  • Unmount partition
# umount /mnt
  • Install Syslinux MBR and Syslinux itself
# dd bs=440 count=1 conv=notrunc if=/usr/lib/syslinux/bios/mbr.bin of=/dev/sdc
# syslinux --directory /boot/syslinux/ --install /dev/sdc1
  • Now you should be able to boot your usb stick with ipxe.lkrn.

Alternatively, you can also try the image with QEMU by running the following command:

$ qemu-system-x86_64 -enable-kvm -m 2G -kernel ipxe.lkrn

Using ipxe.pxe

The ipxe.pxe image is a PXE image. It can be chainloaded from an existing PXE environment. This allows configuring a DHCP server such that booting from the network will always boot into Arch Linux netboot.

UEFI

The ipxe.efi image can be used to launch Arch Linux netboot in UEFI mode. Only 64-bit UEFI is supported. The ipxe.efi image can be added as a boot option via efibootmgr, launched from a boot manager, like systemd-boot or rEFInd, or directly from the UEFI shell.

Installation with efibootmgr

First install the efibootmgr package, then download the UEFI netboot image.

Assuming your EFI system partition (ESP) is mounted under esp, you should move it as follows - let us also give it a more friendly name:

# mkdir esp/EFI/arch_netboot
# mv ipxe.*.efi esp/EFI/arch_netboot/arch_netboot.efi

Then you can create a boot entry as follows:

# efibootmgr --create --disk /dev/sda --part 1 --loader /EFI/arch_netboot/arch_netboot.efi --label "Arch Linux Netboot" --verbose