This article will cover a very basic setup where a FreeBSD server is configured as an iSCSI Target, and another FreeBSD server is configured as the iSCSI Initiator. The iSCSI Target will export a single disk drive, and the initiator will create a filesystem on this disk and mount it locally. Advanced topics, such as multipath, ZFS storage pools, failover controllers, etc. are not covered. Please refer to the following documentation on iSCSI for more information:
- RFC 3720 – Internet Small Computer Systems Inferface (iSCSI)
- FreeBSD Handbook – iSCSI Targets and Initiators
- Mikhail E. Zakharov’s excellent article in BSD Magazine titled “FreeBSD Based Dual-Controller Storage System Concept”
Now to get started…
iSCSI Target Test Setup
The disk drive which should be shared on the network is /dev/ada0, a 5G SATA disk created in VMWare that I attached to the system before starting it up. With FeeBSD, iSCSI is controled by the ctld daemon, so this needs to be enabled on the system. While at it, why not go ahead and enable it at boot time too?