|FAQ: PXE booting NexentaStor|
PXE-Boot Installation of NexentaStor
The Preboot eXecution Environment (PXE, pronounced pixie) is used to boot computers using a network interface, with a bootable image located at a remote specified location. PXE employs a combination of DHCP and TFTP, to locate the bootable image, and boot from it.
1.NexentaStor ISO image.
3.DHCP server with the ability to modify the scope options.
NOTE: For this tutorial our TFTP and NFS services are running on the same host with IP <host-ip>. The NFS export defined in /etc/exports is referred to as <nfs-root> and the root TFTP directory is referred to as <tftpboot>.
Copy the NexentaStor ISO image to your server and mount the ISO using the loop device.
mount -o loop <path-to-iso> <mnt-point>
Copy the contents of the ISO to a folder that is exported via NFS.
cp -r <mnt-point>/* <nfs-root>/nexenta
Create the following directories in <tftpboot>.
mkdir -p <tftpboot>/boot/grub
mkdir -p <tftpboot>/platform/i86pc
mkdir -p <tftpboot>/platform/i86pc/kernel
Copy the kernel, miniroot and loader from the ISO image to the tftpboot directory.
cp -r <mnt-point>/platform/i86pc/kernel/* <tftpboot>/platform/i86pc/kernel/
cp <mnt-point>/platform/i86pc/miniroot <tftpboot>/platform/i86pc/
cp <mnt-point>/boot/grub/pxegrub <tftpboot>/boot/grub/
Create the boot loader menu, menu.lst, in the <tftpboot>/boot/grub/ directory. The menu.lst file defines the grub boot options.
Add the following text to the boot loader menu, menu.lst.
title Nexenta PXE Installation
kernel$ /platform/i86pc/kernel/$ISADIR/unix -B iso_nfs_path=<host-ip>:<nfs-root>/nexenta
Configure the DHCP server scope options to point to your TFTP server and the appropriate boot file.
If you are running a Windows DHCP server navigate to Start->Administrative Tools->DHCP and expand your DHCP scope. Right click on the Scope Options and select 'Configure Options…'. Add the following options and values.
066 Boot Server Host Name -> <host-ip>
067 Bootfile Name -> /boot/grub/pxegrub
If you are running a Linux DHCP server using ISC DHCP then you must modify the /etc/dhpc3/dhcpd.conf file and add the follwing options to the scope.
option grubmenu "/boot/grub/menu.lst";
After modifying dhcpd.conf you must restart the dhpcd service.
Enable PXE on your client NIC and power on the system. The client should boot to a grub menu with the 'Nexenta PXE Installation' option.
Appendix 1 - Modifying miniroot
The kernel path in the pxegrub menu is read during multiple stages of the bootstrap processes. The path relative to the root of the tftp directory and the miniroot image must be identical for the boot process to proceed successfully. The user may want to define their own directory structure on the TFTP server so the miniroot image and kernel from multiple NexentaStor releases can be hosted on the same system. The following instructions describe how to modify the miniroot image with a new kernel path.
The following procedures must be executed on a Solaris based system.
Uncompress the miniroot image.
#> mv miniroot miniroot.gz
#> gunzip miniroot.gz
Mount the uncompressed miniroot image.
#> lofiadm -a miniroot
#> mount /dev/lofi/<x> /mnt/miniroot
Create a symbolic link from the root of the filesystem that matches the path from the root of your TFTP server to the kernel directory.
#> mkdir -p /<new>/<path>
#> ln -s /platform/i86pc/kernel/ /<new>/<path>/.
Unmount the miniroot image.
#> umount /mnt/miniroot
#> lofiadm -d /dev/lofi/<x>
Compress the miniroot image.
#> gzip miniroot
#> gzip -t miniroot.gz
#> mv miniroot.gz miniroot
You can now replace the default miniroot image included with the NexentaStor release with the updated image. With these procedures you can store the kernel files in any directory on your TFTP server.
Appendix 2 - Loading pxegrub From pxelinux
Many users already have an existing pxelinux based PXE server configured in their environment. Unfortunately pxelinux cannot load the Solaris based installer; however, you can configure pxelinux to chain load pxegrub. The following instructions detail how to add a menu option to pxelinux to chain load pxegrub.
Copy the pxegrub loader from the ISO image to tftpboot root directory.
cp <mnt-point>/boot/grub/pxegrub <tftpboot>/pxegrub.0
NOTE: You must append '.0' to the end of the file name otherwise pxelinux will not load the file.
Add the following clause to your pxelinux menu.