I am moving our iSCSI target over to FreeBSD. Our iSCSI servers are generally used as the “disk drives” for Xen virtual servers. NFS with File Backed Devices (FBD) is really too slow when several virtuals are running at the same time, but iSCSI appears to fix this issue.
This document will describe how it is built.
Most of this was taken from
#! /usr/bin/env bash # Note that this is a BASH script. The looping instructions # in this script will not work under sh, which is the default # for FreeBSD. # Change the following two options for your system SUBNET='192.168.0.0/254' NFS_OPTIONS='rw,sync,no_subtree_check,no_root_squash' # enable (but don't start) NFSv4 daemon echo nfs_server_enable="YES" >> /etc/rc.conf echo nfsv4_server_enable="YES" >> /etc/rc.conf echo nfsuserd_enable="YES" >> /etc/rc.conf # create a place to store the NFS exported data mkdir /media/nfs zfs create storage/nfs zfs set mountpoint=/media/nfs storage/nfs # build the exported directory structure, and insert each # export into the /etc/exports file for subdir in xen-store xen-configs xen-images do mkdir /media/nfs/$subdir echo '/media/nfs/$subdir $SUBNET($NFS_OPTIONS)' >> /etc/exports done # start (or restart) the service service nfsd restart