Using iocage on Freenas

Since the old jail system on Freenas is soon to be removed, they want users to migrate to iocage instead.

You can only administrate iocage jails via the new (beta) Web UI, with limited functionality however.

Here’s a quick reference on how to create a new jail, add network and mount a dataset in it.

Before I started I created a test-jail in the new Web UI, which downloaded the template for FreeBSD 11.1.

After that has been done (the test jail can be removed) you can run the following commands via the CLI.

Create the Jail:
iocage create -r 11.1-RELEASE -n '[jailname]' (ex. iocage create -r 11.1-RELEASE -n 'backup')

Set IP address for the jail:
iocage set ip4_addr='[interface]|[ipaddress]/24' '[jailname]' (ex. iocage set ip4_addr='lagg0|' backup)

Add a dataset to the jail:
iocage fstab -a [jailname] /mnt/Storage/[dataset] (ex. iocage fstab -a backup /mnt/Storage/Snapshots)
iocage fstab -e [jailname] (change ro to rw in fstab if you want the dataset writable)

Create the folder in the jail for the dataset:
mkdir -p /mnt/Storage/iocage/jails/[jailname]/root/mnt/Storage/[dataset] (ex. mkdir -p /mnt/Storage/iocage/jails/backup/root/mnt/Storage/Snapshots)

Do take note that the mount or jailname should Not have any spaces in the name, if there are spaces in the name the mount/fstab command does not work because nullfs does not support spaces at this moment.

You can now start the jail via the new interface, or via CLI with the command:

iocage start [jailname]

Reflash LSI MegaRAID 9240-8i to 9211-8i

Creating this post for future reference because I can never really remember how to firmware upgrade my raid card LSI MegaRAID SAS 9240-8i, which is now a LSI MegaRAID SAS 9211-8i.

Basically this guide is a rewrite of this forum post.

  1. Created a standard bootable DOS USB Flash Drive.
  2. Download the firmware tools (local mirror) and extract MegaRec.exe and empty.bin to the USB drive.
  3. Download the latest 9211-8i firmware.
  4. Copy the following files to the USB drive:
    – 2118it.bin
    – sas2flsh.exe (DOS-version)
    – mptsas2.rom
  5. Boot from USB.
  6. Backup current sbr with megarec -readsbr 0 backup.sbr
  7. Write an empty sbr with megarec -writesbr 0 empty.bin
  8. Erase controller flash with megarec -cleanflash 0
  9. Restart machine and boot from USB again.
  10. Set controller to 6GB/s mode with sas2flsh -o -e 6
  11. This process will ask for the firmware file. Write 2118it.bin
  12. Flash the controller with the new firmware with IT-mode with sas2flsh -o -f 2118it.bin -b mptsas2.rom
  13. Program SAS address in IT-mode where 500605b********* is the code on the green sticker on your RAID card without the “-” with sas2flsh -o -sasadd 500605b*********

Done for this time! Enjoy your reflashed LSI 9240-8i which is now an LSI 9211-8i!

If you ever need to update the firmware, you can do it like this on (for example) FreeBSD:

  1. Download the latest firmware and installer package from LSI.
  2. Flash with ./sas2flash -o -f 2118it.bin