Matt Connolly's Blog

my brain dumps here…

Monthly Archives: March 2011

Mac OS X SnowLeopard upgrading RubyGems

I looked around for a while on how to upgrade ruby gems to >= 1.3.6 so I could install rails 3 on Mac OS X 10.6 Snow Leopard.

It’s actually really easy:

$ sudo gem install rubygems-update
Successfully installed rubygems-update-1.6.2
Successfully installed rubygems-update-1.6.2
1 gem installed
Installing ri documentation for rubygems-update-1.6.2...
Installing RDoc documentation for rubygems-update-1.6.2...
$ sudo gem update --system
Updating RubyGems
Updating rubygems-update
Successfully installed rubygems-update-1.6.2
Updating RubyGems to 1.6.2
Installing RubyGems 1.6.2
RubyGems 1.6.2 installed

=== 1.6.2 / 2011-03-08

Bug Fixes:

* require of an activated gem could cause activation conflicts.  Fixes
  Bug #29056 by Dave Verwer.
* `gem outdated` now works with up-to-date prerelease gems.


RubyGems installed the following executables:

$ gem -v

Done. Easy as.

Replacing a mirror boot drive in ZFS

My OpenIndiana backup server is a simple ZFS setup, being a mirror between two drives.

Here’s the steps I did to replace my failed Western Digital Green with a Seagate Barracuda Green:

#cfgadm -c unconfigure sata1/1
#zpool detach rpool c8t1d0s0
#cfgadm -c configure sata1/1

Here I chose fdisk and formatted the disk with 100% Solaris partition.
Then I chose partition, and created slice 0 to start at cylinder 1 and use the rest of the disk.

# zpool attach rpool c8t0d0s0 c8t1d0s0
invalid vdev specification
use '-f' to override the following errors:
/dev/dsk/c8t1d0s0 overlaps with /dev/dsk/c8t1d0s2
# zpool attach -f rpool c8t0d0s0 c8t1d0s0
Make sure to wait until resilver is done before rebooting.
# installgrub -m /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c8t1d0s0

It does seem odd to me that the recommended way to set up the slices has slice 0 starting at cylinder 1 and overlapping with slice 8 which is the whole disk – resulting in the overlap error above and forcing the user to use the `zpool attach -f` option. Anyway. It’s done, and 20 hours later, it was fully resilvered.

ZFS = Data integrity

So, for a while now, I’ve been experiencing crappy performance of a Western Digital Green drive (WD15EARS) I have an a zfs mirror storing my time machine backups (using OpenIndiana and Netatalk).

Yesterday, the drive started reporting errors. Unfortunately, the system hung – that’s not so cool – ZFS is supposed to keep working when a drive fails… Aside from that, when I rebooted, the system automatically started a scrub to verify data integrity, and after about 10 minutes:

  pool: rpool
 state: DEGRADED
status: One or more devices is currently being resilvered.  The pool will
        continue to function, possibly in a degraded state.
action: Wait for the resilver to complete.
 scan: resilver in progress since Thu Mar 10 10:19:42 2011
    1.68G scanned out of 1.14T at 107M/s, 3h5m to go
    146K resilvered, 0.14% done

        NAME          STATE     READ WRITE CKSUM
        rpool         DEGRADED     0     0     0
          mirror-0    DEGRADED     0     0     0
            c8t1d0s0  DEGRADED     0     0    24  too many errors  (resilvering)
            c8t0d0s0  ONLINE       0     0     0
          c12d0s0     ONLINE       0     0     0

errors: No known data errors

Check it out. It’s found 24 errors on the Western Digital Drive, but so far no data errors have been found, because they were correct on the other drive.

That’s obvious, right? But what other operating systems can tell the difference between the right and wrong data when they’re both there??? Most raid systems only detect a total drive failure, but don’t deal with incorrect data coming off the drive !!

Sure backing up to a network (Time Machine’s sparse image stuff) is *way* slower than a directly connected firewire drive, but in my opinion, it’s well worth doing it this way for the data integrity that you don’t get on a single USB or Firewire drive.

Thank you ZFS for keeping my data safe. B*gger off Western Digital for making crappy drives. I’m off to get a replacement today… what will it be? Samsung or Seagate?

Building Netatalk from source on OpenIndiana

On my OpenIndiana backup server, I’ve built quite a few packages from source over the last year. Today I went to try building netatalk. It required a few more things to get it going:

# pkg install developer/build/libtool
# pkg install developer/build/automake-110

Now, for some reason, the automake package installs `aclocal-1.10` but not `aclocal` which the netatalk bootstrap script looks for.

# ln -s /usr/bin/aclocal-1.10 /usr/bin/aclocal
# ln -s /usr/bin/automake-1.10 /usr/bin/automake

Then I can proceed with the normal build process:
$ ./bootstrap
$ ./configure
$ make
$ sudo make install