Flashing IBM M1115 (SAS 9223) with LSI SAS 9211-8i firmware to use with ESXi 5 (FreeNAS guest w/RDM)

I bought an IBM M1115 6 Gbps SAS controller card from ebay and cross flashed it with the LSI 9211-8i firmware to use with VMware ESXi 5.

The cross flashing tutorial:

IBM ServeRAID M1015 Part 4: Cross flashing to a LSI9211-8i in IT or IR mode

Everything works fine in ESXi and I have a FreeNAS 9 guest directly using my HDD through Raw Device Mapping (RDM).

There are two ESXi configuration changes needed for the FreeNAS guest to work properly:

  1.  Raw Device Mapping option is grayed out (1017704)
  2.  Configuring promiscuous mode on a virtual switch or portgroup (1004099)

The first change allows selecting local drives via RDM and the latter is to access the plugin jail ip address (e.g. Tranmission).

Configure mailgun on Ubuntu (bsd-mailx / postfix)

1) Install bsd-mailx

aptitude install bsd-mailx

Select Internet Site in the Postfix Configuration screen.

If you missed it or want do reconfigure do:

dpkg-reconfigure postfix

2) Add mailgun configuration

Edit /etc/postfix/main.cf

relayhost = smtp.mailgun.org
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = static:[email protected]:password
smtp_sasl_security_options = noanonymous

3) Restart the postifx service

service postfix restart

Source: https://www.jamroom.net/brian/documentation/guides/1312/set-up-postfix-with-mailgun-for-reliable-e-mail-delivery

My GitLab CE notes (Ubuntu .deb installation)

They only way I found to keep my changes after a git-lab reconfigure is by editing default.rb and production.rb, please leave a comment if you know an alternative.

1) Installation

Install omnibus-gitlab from: https://www.gitlab.com/downloads/

sudo dpkg -i gitlab_6.6.5-omnibus-1.ubuntu.12.04_amd64.deb

2) Change Unicorn port and email addresses

Edit /opt/gitlab/embedded/cookbooks/gitlab/attributes/default.rb

# I am running Jenkins on 8080 so I need to change Unicorn port to 9292.
default['gitlab']['gitlab-rails']['internal_api_url'] = "http://localhost:9292"
default['gitlab']['unicorn']['port'] = 9292

# Change default emails
default['gitlab']['user']['git_user_email'] = "[email protected]"
default['gitlab']['gitlab-rails']['gitlab_email_from'] = "[email protected]"
default['gitlab']['gitlab-rails']['gitlab_support_email'] = "[email protected]"

3) (optional) Configure smtp

UPDATE: I decided to configure mailgun directly on my server, see: https://blog.gimpe.com/2014/04/configure-mailgun-on-ubuntu-bsd-mailx-postfix/

Edit /opt/gitlab/embedded/service/gitlab-rails/config/environments/production.rb

# use mailgun for emails
  config.action_mailer.delivery_method = :smtp
  config.action_mailer.perform_deliveries = true
  config.action_mailer.raise_delivery_errors = true
  config.action_mailer.smtp_settings = {
    :address => "smtp.mailgun.org",
    :port => 587,
    :domain => "",
    :authentication => :plain,
    :user_name => "",
    :password => "",
    :enable_starttls_auto => true
  }

4) Keep backup for 1 week

Note: I use a ZFS partition with daily snapshots.

Edit /opt/gitlab/embedded/cookbooks/gitlab/attributes/default.rb

default['gitlab']['gitlab-rails']['backup_keep_time'] = 604800

See commit: Merge branch ‘allow_setting_backup_keep_time’ into ‘master’

edit /opt/gitlab/embedded/cookbooks/gitlab/templates/default/gitlab.yml.erb

# uncomment backup keep time
 keep_time: 604800 # default: 0 (forever) (in seconds)

5) Use a NFS mount for backups

Edit /etc/fstab

host:/mnt/vol1/backup/gitlab /var/opt/gitlab/backups nfs _netdev,auto  0  0

6) Schedule daily backups in crontab

Type sudo crontab -e

0 2 * * * gitlab-rake gitlab:backup:create

7) (optional) Change hostname

Edit /var/opt/gitlab/gitlab-rails/etc/gitlab.yml

# change hostname (if needed)
    host: gitlab.local

8) Reconfigure!

sudo gitlab-ctl reconfigure

andyleonard.com – zfs-snapshot.sh

Here’s a nice script found on thinking sysadmin. I slightly modified it to use the real mount point instead of assuming “/”, my changes are highlighted below:

#!/usr/local/bin/bash
# FROM: http://andyleonard.com/2010/04/07/automatic-zfs-snapshot-rotation-on-freebsd/

# Path to ZFS executable:
ZFS=/sbin/zfs

# Parse arguments:
TARGET=$1
SNAP=$2
COUNT=$3

# Function to display usage:
usage() {
scriptname=`/usr/bin/basename $0`
echo "$scriptname: Take and rotate snapshots on a ZFS file system"
echo
echo " Usage:"
echo " $scriptname target snap_name count"
echo
echo " target: ZFS file system to act on"
echo " snap_name: Base name for snapshots, to be followed by a '.' and"
echo " an integer indicating relative age of the snapshot"
echo " count: Number of snapshots in the snap_name.number format to"
echo " keep at one time. Newest snapshot ends in '.0'."
echo
exit
}

# Basic argument checks:
if [ -z $COUNT ] ; then
usage
fi

if [ ! -z $4 ] ; then
usage
fi

# Get the TARGET mountpoint
TARGET_MOUNT=$($ZFS get -H -o value mountpoint $TARGET)

# Snapshots are number starting at 0; $max_snap is the highest numbered
# snapshot that will be kept.
max_snap=$(($COUNT -1))

# Clean up oldest snapshot:
if [ -d ${TARGET_MOUNT}/.zfs/snapshot/${SNAP}.${max_snap} ] ; then
$ZFS destroy -r ${TARGET}@${SNAP}.${max_snap}
fi

# Rename existing snapshots:
dest=$max_snap
while [ $dest -gt 0 ] ; do
src=$(($dest - 1))
if [ -d ${TARGET_MOUNT}/.zfs/snapshot/${SNAP}.${src} ] ; then
$ZFS rename -r ${TARGET}@${SNAP}.${src} ${TARGET}@${SNAP}.${dest}
fi
dest=$(($dest - 1))
done

# Create new snapshot:
$ZFS snapshot -r ${TARGET}@${SNAP}.0

Thanks Andy!

Steam: Install a single game on a different hard drive

I have a small ssd (c:) so I installed my Steam client on my hdd (d:). But there is a game I wanted to be on my ssd (c:), here are the steps to do it:

  1. Close Steam
  2. Move the game to the new location
    e.g.: from “d:Steamsteamappscommonfallout new vegas” to “c:Program Files (x86)Steamsteamappscommonfallout new vegas”
  3. Open a command prompt
    go in –> “Start Menu” –> “Run..” –> type “cmd”
  4. Create a Windows symlink
    type: mklink /J “d:Steamsteamappscommonfallout new vegas” “c:Program Files (x86)Steamsteamappscommonfallout new vegas”
    output: Junction created for d:Steamsteamappscommonfallout new vegas <==> c:Program Files (x86)Steamsteamappscommonfallout new vegas

Now start your Steam client and the game will run from its new location.

NOTE: Dead Money DLC didn’t install while using a symlink, I had to move the game back in its original location to download and install the DLC.

How to Install Virtualbox 3.1.6 on NexentaStor 3.0.4

Get: VirtualBox-3.1.6-59338-SunOS.tar.gz
Get: VBoz.zip

Unzip and RENAME python-lib-3.1.8.tar.bz2 TO python-lib.tar.bz2

Put everything in the same dir.

VirtualBox-3.1.6-59338-SunOS.tar.gz
solaris-lib.tar.bz2
sunwvbox-1.0-20100217.diff.gz
python-lib.tar.bz2

And now:
[bash]
# add required packages
aptitude install alien g11n-minimal-uiu8 lib64gcc1 lib64stdc++6 lib64z1 libfontconfig1 libfreetype6 libgcc1 libice6 libpng12-0 libsm6 libstdc++6 libxau6 libxdmcp6 libxmuu1 libxrender1 python python-dev sunwcsl sunwcslr sunwlibm zlib1g

# untar & prepare VirtualBox
tar -xzf VirtualBox-3.1.6-59338-SunOS.tar.gz
alien -d -s -c –reloc_root=/ VirtualBox-3.1.6-SunOS-r59338.pkg

# patch it
gzip -d -c sunwvbox-1.0-20100217.diff.gz | patch -p0

# build it
cd sunwvbox-1.0
./debian/rules binary

# install the .deb package
cd ..
dpkg -i sunwvbox_1.0-1_solaris-i386.deb
[/bash]

That’s it! Many thanks to Ernst Gill!

SOURCES:
http://www.nexenta.org/boards/1/topics/142

VirtualBox useful commands (VBoxManage/VBoxHeadless)

[bash gutter=”false”]
# change VirtualBox disk and machine default location
VBoxManage setproperty hdfolder /volumes/data/vbox
VBoxManage setproperty machinefolder /volumes/data/vbox

# create a VM
VBoxManage createvm –name "U10.4-base" –ostype Ubuntu –register
# add some ram, network card, DVD-ROM
VBoxManage modifyvm "U10.4-base" –memory 128 –acpi on –boot1 dvd –nic1 bridged
# create a HDD
VBoxManage createhd –filename U10.4-base.vdi –size 10000 –register

# attach storage controllers to it
VBoxManage storagectl "U10.4-base" –name "IDE Controller" –add ide
VBoxManage storageattach "U10.4-base" –storagectl "IDE Controller" –port 1 –device 0 –type dvddrive –medium none

# remove .iso
VBoxManage closemedium dvd /volumes/data/exchange/mini-ubuntu-10.04-server-i386.iso

# start VM
VBoxHeadless –startvm "U10.4-base"

# stop VM (requires package acpid)
VBoxManage controlvm "U10.4-base" acpipowerbutton

# view VM information
VBoxManage showvminfo "U10.4-base"
[/bash]

How to Install Transmission 2.01 on NexentaStor 3.0.3

Install required packages
[bash]
aptitude install libssl-dev libcurl4-openssl-dev intltool
[/bash]

Install libevent
[bash]
wget http://monkey.org/~provos/libevent-1.4.13-stable.tar.gz
tar -xzf libevent-1.4.13-stable.tar.gz
cd libevent-1.4.13-stable
./configure
make && make install
[/bash]

Install Transmission
[bash]
wget http://mirrors.m0k.org/transmission/files/transmission-2.01.tar.bz2
tar -xjf transmission-2.01.tar.bz2
cd transmission-2.01
./configure LIBEVENT_LIBS="-L/usr/local/lib -levent"
make && make install
[/bash]

Continue reading “How to Install Transmission 2.01 on NexentaStor 3.0.3”