> On Feb 22, 2016, at 9:52 AM, Daniel Fussell <[email protected]> wrote: > > On 02/21/2016 06:33 PM, DAN EGLI wrote: >> Hey folks, >> >> Anyone come across any good tutorials on setting up iSCSI to on the >> Workstation side? I've read the tutorials for Gentoo's iSCSI, and that's >> great for setting an iSCSI SERVER up. What I'm looking for is how do I >> configure something like pxelinux or similar to load the iSCSI target? I'd >> need that for both booting and for the initial install of the O/S. >> >> Any help is appreciated! I've looked, and all the tutorials and how-to's >> that I've come across deal with setting up the server and don't touch on the >> client either at all, or hardly at all. > > You might look at iPXE (ipxe.org). It seems to support iscsi, AoE, > http, etc.
Yes, iPXE is the way to go if your motherboard/BIOS doesn't have iSCSI support built in (and sometimes even if it does, since it has a richer feature set). While booting, a Linux box usually connects to an iSCSI target two different times. You need to be aware of both: 1) In either the BIOS or the iPXE config file (which is typically tftp-loaded early in the PXE boot, see iPXE documentation). This allows the system to connect to the volume and either load GRUB (or some other bootloader if you're adventurous) or the kernel and initramfs directly. It seems counter-intuitive but you're usually better off with the extra step of just loading your bootloader from the iSCSI volume. This has at least two advantages: a) It's compatible with native (BIOS-supported, non-PXE) iSCSI booting b) You don't have to do anything extra when you upgrade your kernel or want to change kernel parameters. The kernel, GRUB and grub.cfg are all on the iSCSI volume and accessible by the OS once it is running. (Conversely, if you load your kernel from pxelinux, you have to update the pxelinux config file on your TFTP server to load a different kernel or supply different parameters.) 1a) GRUB piggybacks on the BIOS or iPXE connection to the iSCSI target to load itself, grub.cfg and the kernel and initramfs. 2) initramfs / dracut / kernel arguments. Once the kernel is running the initramfs needs to connect to the iSCSI target again before the real root filesystem can be mounted. You need to pass appropriate arguments on the kernel command line so dracut knows how to do this. Usually the simplest thing is to tell dracut to read and re-apply the BIOS parameters which are normally stored in the IBFT (iSCSI Boot Firmware Table). Appending something like "rd.iscsi.firmware=1 rd.iscsi.ibft=1 netroot=iscsi:ibft" should do it. Alternatively, you can explicitly specify the initiator name, target IP/port and target name/LUN. See the dracut documentation. If not using IBFT you also need to configure the network on the interface to be used for iSCSI on the kernel command line. 2a) Once dracut does its thing, the iSCSI volume is natively connected via the running kernel and the rest of the system can come up. Just remember not to take your iSCSI interface down or you will have an inaccessible filesystem. On redhat derivatives adding a "NETBOOT=yes" to an interface's ifcfg file hints the system about this state of affairs. Dracut normally does this for you (and in fact re-writes the ifcfg file every time you boot). Have fun, JN /* PLUG: http://plug.org, #utah on irc.freenode.net Unsubscribe: http://plug.org/mailman/options/plug Don't fear the penguin. */
