Article View: muc.lists.freebsd.current
Article #250CFT: iSCSI boot support
From: Hiroki Sato
Date: Sat, 28 Nov 2026 14:39
Date: Sat, 28 Nov 2026 14:39
156 lines
7995 bytes
7995 bytes
----Security_Multipart(Sat_Nov_28_23_39_10_2026_305)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hello, I would appreciate testing and feedback on iSCSI boot support for FreeBSD. FreeBSD already provides iSCSI initiator and target support. This work adds the integration needed to boot from an iSCSI root filesystem: obtaining the boot configuration from firmware, passing it through the loader to the bootstrap userland, and keeping connection recovery independent of access to the iSCSI root. A test kit for a single FreeBSD/amd64 host running bhyve is available at [1]. It includes prebuilt system and boot images, scripts for running the tests, and the corresponding source. The FreeBSD source changes are available at [2]. [1] https://people.allbsd.org/~hrs/FreeBSD/iscsi-boot-test-24e6b3385a79.tar.gz [2] https://github.com/freebsd/freebsd-src/compare/main...hrs-allbsd:freebsd-src:main-hrs-iscsi-boot README.md contains the full instructions. Here is a minimal example using EDK II without authentication. Run the host commands as root from the extracted kit directory, using an unused bridge name and addresses. In terminal 1: # pkg install bhyve-firmware python312 # ifconfig bridge903 create # ifconfig bridge903 inet 192.0.2.1/24 up # sh target.sh targets/none.img 192.0.2.1 After "Target ready" appears, run this in terminal 2: # sh boot.sh edk2 bridge903 The guest should boot FreeBSD with its root filesystem on the iSCSI target. Wait for "ISCSI_LAB_BOOT_PASS", then log in as "root" with an empty password. The guest hostname is iscsi-boot.allbsd.org. You can inspect the iSCSI session and mounted filesystems, then shut down the guest: # iscsictl -L # mount -p # poweroff To test iPXE, run the following after the EDK II guest has shut down, leaving the target running: # sh boot.sh ipxe bridge903 After testing, shut down the guest, press Ctrl-C in terminal 1 to stop the target, and remove the bridge: # ifconfig bridge903 destroy The kit also supports CHAP and mutual CHAP. Please use an isolated test network; the supplied guest permits passwordless root login for testing. Here is how it works. The client needs firmware with iSCSI boot support, or a software implementation such as iPXE. The firmware or iPXE establishes the initial connection to the target and makes the boot configuration available through iBFT, the iSCSI Boot Firmware Table. iBFT describes the initiator network configuration, target, boot LUN, and authentication settings. PXE can be used to load iPXE, which can then perform the iSCSI boot. In the external-image boot path, the client loads four main components from the target: loader.efi, the GENERIC kernel, iscsi_boot.ko, and iscsi-mfs.img. The loader passes the iBFT configuration to FreeBSD. FreeBSD then establishes its own iSCSI connection rather than importing the firmware's existing connection. The kernel implements the iSCSI data path, while iscsid(8) handles operations including login and authentication during initial connection and recovery. Running the recovery daemon from the iSCSI root can create a circular dependency: recovery may require executable pages, libraries, or configuration files on the filesystem whose connection is being recovered. This implementation first boots a small memory-disk UFS root image, iscsi-mfs.img, containing static bootstrap tools. It configures networking, establishes the FreeBSD iSCSI session, identifies and checks the root filesystem, and initiates reroot. A separate RAM-backed recovery environment is prepared and retained across reroot so that the recovery daemon and its required files remain available when the iSCSI root is temporarily inaccessible. An implementation overview is as follows: - UEFI loader: Reads iBFT network, target, LUN, and authentication settings and passes them to FreeBSD when iSCSI boot is explicitly enabled. - iSCSI initiator: Adds the optional `iscsi_boot.ko` module for boot authentication and recovery policy, including login deadlines, retry backoff, and failure handling. - iscsid: Adds support for an inherited device descriptor and a recovery-root chroot. - Bootstrap userland: Configures networking, connects the target, identifies the boot LUN, checks the filesystem, and initiates reroot. The kit includes the bootstrap helpers and test tooling. - init and reroot_seed: Prepare and retain the RAM-backed recovery environment across reroot. - rc scripts: Manage the recovery daemon and preserve the network configuration required by the iSCSI root during startup, service restarts, and shutdown. The GENERIC kernel configuration remains unchanged. The boot module and memory-disk image are supplied separately; the image is not embedded in GENERIC. The target root filesystem also needs the updated init, rc scripts, and iscsid. The supplied system images already include these changes. Testing so far has used UEFI/amd64 guests under bhyve, with both iPXE and EDK II. Feedback on the design, additional test results, and experience with physical systems would be particularly welcome. I plan to submit the changes for review after gathering feedback and addressing any significant concerns. Comments on the approach are welcome even if you cannot test it. Thank you. -- Hiroki ----Security_Multipart(Sat_Nov_28_23_39_10_2026_305)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iMgEABMKAC4WIQRsDSNTJ8+Ax5Ae/dLbsH3Gbx9zfwUCawrnjhAcaHJzQGZyZWVi c2Qub3JnAAoJENuwfcZvH3N/XUUCBjjRv0HjVVel6iA22Sz58Ef+QKMq34x4v3av ejrBy+Ey2t21Gnkvk1QPg5Nj2DwqQscXr48VARmCbBS2E+uTxi2OAgjtIMOH7KO6 8VJWYwy7oe75opkSgLBvE+yAgmjXZA+1BrlN24Ld8Z8HYS89on/oaTPvxE/Lpd9t 1rgEeQXhSjzU9g== =lphh -----END PGP SIGNATURE----- ----Security_Multipart(Sat_Nov_28_23_39_10_2026_305)---- -- Posted automagically by a mail2news gateway at muc.de e.V. Please direct questions, flames, donations, etc. to news-admin@muc.de
Technical Details
Message-ID:
<20261128.233910.1486634226996505367.hrs@FreeBSD.org>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.szaf.org!news.karotte.org!news.muc.de!.POSTED.news.muc.de!not-for-mailShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.szaf.org!news.karotte.org!news.muc.de!.POSTED.news.muc.de!not-for-mail From: Hiroki Sato <hrs@FreeBSD.org> Newsgroups: muc.lists.freebsd.current Subject: CFT: iSCSI boot support Date: Sat, 28 Nov 2026 23:39:10 +0900 (JST) Organization: Newsgate at muc.de e.V. Approved: news-admin@muc.de Distribution: world Message-ID: <20261128.233910.1486634226996505367.hrs@FreeBSD.org> MIME-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha512; boundary="--Security_Multipart(Sat_Nov_28_23_39_10_2026_305)--" Content-Transfer-Encoding: 7bit Injection-Info: news.muc.de; posting-host="news.muc.de:193.149.48.2"; logging-data="96828"; mail-complaints-to="news-admin@muc.de" X-Original-To: current@mlmmj.nyi.freebsd.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1795876813; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lR9HtOq5rLIoOg8B45oxZPX6dI+UL8yVXnMWjUvuVww=; b=Z1qiyNqL8KEMMEvWB/6lAm2q+HfcPi5NcYX7Rg74VPnA6y16Qrfqy7AJ6Hwstdea09UOC8 xacE6f85AA7+hFmii5n4cubLc5g5SYhA1Qgr1vkTh3W89TKRb8bZ0jI2YMZJ3R27ggjQpH k3L9bJtajzev1vAGqf7w91w0p59T6eWx5CgG7x3SfBqzALNWL3VatbiL4s5NJod+1roimR foI6JkHEDH5ptVJMwcrPLGPO4ev/TkZQ2OZOSPyszQ5LYoxr1pwnyEEWxkqiuegsf3Iqd1 qMUm/ra9pK1rfjglOW/cjwYrKqJzaUK4iQiWr2PuPMaFDnL8iUnR/EOCZfyotA== X-Old-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-PGPkey-fingerprint: 6C0D 2353 27CF 80C7 901E FDD2 DBB0 7DC6 6F1F 737F Precedence: list X-Newsgate-Id: f02c70b8849f+ X-No-Archive: Yes