Index: en_US.ISO8859-1/books/handbook/boot/chapter.xml =================================================================== --- en_US.ISO8859-1/books/handbook/boot/chapter.xml +++ en_US.ISO8859-1/books/handbook/boot/chapter.xml @@ -903,4 +903,57 @@ a module or statically compiled into a custom kernel. + + + Root Remount + + + Root remount, or reroot, + functionality is supported beginning with + &os; 11.0-RELEASE. + + + Mounting the root filesystem sometimes requires additional + steps which can only be done from an already-working userspace. + One example of this is booting from an iSCSI + LUN: setting up an iSCSI + session requires the presence of &man.iscsid.8; and + &man.iscsictl.8;, which are not available at boot. This + presents a chicken and egg problem. The solution is to boot + with a temporary root filesystem on a memory disk image + preloaded by &man.loader.8;, set up the kernel state as + necessary, replace the temporary root file system with the + proper one, and then continue booting as usual. + + The first step is to create a temporary root + filesystem: + + makefs /boot/reroot.img /usr/share/examples/reroot/manifest + + Then configure &man.loader.8; to preload the reroot image + in /boot/loader.conf: + + reroot_load="YES" +reroot_type="md_image" +reroot_name="/boot/reroot.img" + + The rc script contained in the image is + configured with &man.kenv.1; variables: + reroot_iface, + reroot_ifconfig, + reroot_sh, + reroot_iscsi_target, + reroot_iscsi_portal, and + reroot_mountfrom. + These can be set in /boot/loader.conf or + manually from the &man.loader.8; prompt. + + As an example, to mount root from an + iSCSI volume: + + reroot_iface=em0 +reroot_iscsi_target=iqn.2012-06.com.example:target0 +reroot_iscsi_portal=192.168.1.5 +reroot_mountfrom=ufs:/dev/da0 +