Skip to content

Instantly share code, notes, and snippets.

@sam
sam / gist:1607465
Created January 13, 2012 16:50
GeminaboxPlus Setup on OSX/JRuby
brew install redis
redis-cli hset services resque '["localhost"]'
jgem install rack -v1.3.6
jgem install jruby-rack -v1.1.1
jgem install trinidad -v1.2.3
git clone git://github.com/sam/geminaboxplus.git
cd geminaboxplus
bundle install --path vendor
rake resque:work &
GEMINABOX_DATA="$(pwd)/data" jruby -S trinidad
@sam
sam / gist:1622208
Created January 16, 2012 18:32
Creating a swap volume for SmartOS
# Make sure that the swap volume is the same size as your available RAM or
# you'll have trouble starting as many guests as you think you should have
# RAM for.
zfs create -oprimarycache=none -osecondarycache=none -V256G zones/swap
@sam
sam / gist:1622225
Created January 16, 2012 18:35
Move a single-disk zpool to another disk
# Attach your new "spare" device (c0t1d0 in this example)
# to your existing device (c0t0d0) as a mirror:
zpool attach zones c0t0d0 c0t1d0
# Wait until `zpool status` says resilvering is complete, then:
zpool detach zones c0t0d0
@sam
sam / gist:1622239
Created January 16, 2012 18:37
Move dump device to a dedicated disk
dumpadm -d /dev/dsk/c0t2d0
@sam
sam / gist:1622242
Created January 16, 2012 18:38
Create new, target spool for guests with "backup" name.
zpool create backup \
spare c1t0d0 c1t1d0 c1t2d0 \
raidz2 c1t3d0 c1t4d0 c1t5d0 c1t6d0 c1t7d0 c1t8d0 c1t9d0 \
raidz2 c1t10d0 c1t11d0 c1t12d0 c1t13d0 c1t14d0 c1t15d0 c1t16d0 \
raidz2 c1t17d0 c1t18d0 c1t19d0 c1t20d0 c1t21d0 c1t22d0 c1t23d0
@sam
sam / gist:1622261
Created January 16, 2012 18:42
Backup your "zones" spool.
zfs snapshot -r zones@backup
zfs send -R zones@backup | zfs recv -Fd backup
@sam
sam / gist:1622264
Created January 16, 2012 18:43
Destroy existing zones zpool
zpool destroy -f zones
# If that doesn't work because some filesystems are still in use, run:
zfs destroy -fr zones
# That will force unmount and destroy all the filesystems.
# Then try destroying the zpool again.
@sam
sam / gist:1622268
Created January 16, 2012 18:44
Rename a pool by exporting it and reimporting under a new name.
zpool export backup
zpool import backup zones
@sam
sam / gist:1622273
Created January 16, 2012 18:45
Add a spare to a zpool
zpool add zones spare c1t0d0
@sam
sam / gist:1622279
Created January 16, 2012 18:46
Example spool status
[root@f0-4d-a2-3c-f4-a0 ~]# zpool status
pool: zones
state: ONLINE
scan: none requested
config:
NAME STATE READ WRITE CKSUM
zones ONLINE 0 0 0
raidz2-0 ONLINE 0 0 0
c1t3d0 ONLINE 0 0 0