Reski's hobbies blog place…

This is not just about me, but also bout my family
April 2nd, 2012

Performance of Western Digital Green w/ OpenIndiana

I can't believe the performance of western digital green when I'm trying to copy my 56GB data using OpenIndiana
The performance so s***s...too many 0 in the IOPS
and am thinking, would it be better if I install new ZIL in this machine?

capacity operations bandwidth
pool alloc free read write read write
---------- ----- ----- ----- ----- ----- -----
Pool3 949G 3.14T 0 1 769 38.2K
Pool3 949G 3.14T 0 0 0 0
Pool3 949G 3.14T 0 0 0 0

Pool3 949G 3.14T 0 187 0 20.3M
Pool3 949G 3.14T 0 195 0 24.5M
Pool3 949G 3.14T 0 182 0 9.55M
Pool3 949G 3.14T 0 0 0 0
Pool3 949G 3.14T 0 0 0 0

Pool3 949G 3.14T 0 213 0 23.6M
Pool3 949G 3.14T 0 351 0 31.0M
Pool3 949G 3.14T 0 0 0 0
Pool3 949G 3.14T 0 0 0 0
Pool3 949G 3.14T 0 0 0 0

Pool3 949G 3.14T 0 175 0 18.6M
Pool3 949G 3.14T 0 265 0 33.2M
Pool3 949G 3.14T 0 123 0 2.54M
Pool3 949G 3.14T 0 0 0 0
Pool3 949G 3.14T 0 0 0 0

Pool3 949G 3.14T 0 173 0 18.6M
Pool3 949G 3.14T 0 433 0 35.7M
Pool3 949G 3.14T 0 0 0 0
Pool3 949G 3.14T 0 0 0 0
Pool3 949G 3.14T 0 0 0 0

February 26th, 2012

What I learn today….

Big day of using OpenSolaris as one of my toy to play. My plan very simple.
I have 2 system using OpenIndiana o148, and both using the same storage system which is zfs
I want to do automatically snapshot every 15min,hour,day,month or event yearly on my primary system, but on my 2nd system, i want it have only the hourly snapshot from system 1.

First thing first, you have setup time-slider which enabled snapshot based on certain time. You can see my post

http://hobby.keluargareski.net/2012/02/11/openindiana-time-slider/

Then step up quickly, connection passwordless to system 2. You can see my post here http://hobby.keluargareski.net/2012/02/26/bypass-password-authentication-for-sshscpstfp

After that, the next problem is that you have to make custom script since I dont want to use time-slider config to send incremental from primary server to 2nd server. So I create this small script to take the incremental update

#! /bin/bash
filecontent=`zfs list -H -t snapshot |grep data|grep hourly | tac | cut -f 1 |head -n 2`;
splitArray=(${filecontent//;/ })
zfs send -i ${splitArray[1]} ${splitArray[0]} | ssh reski@Server2 /usr/sbin/zfs receive DV/Sn03

if you forgot how to send incremental snapshot,check it here http://hobby.keluargareski.net/2012/02/12/zfs-send-receive/

And if you sucessfully test it, just plug it into crontab so you can execute it whatever you like

Reference
- Crontab : http://www.devdaily.com/linux/unix-linux-crontab-every-minute-hour-day-syntax
- Bash :
-- http://www.thegeekstuff.com/2010/06/bash-array-tutorial/
-- http://stackoverflow.com/questions/918886/split-string-based-on-delimiter-in-bash

February 21st, 2012

How to Delete ZFS Snapshot

To Delete ZFS Snapshot

zfs destroy $snapshot

To make it easy, following is the bash script to delete all the zfs snapshot with single shot

#!/bin/bash
for snapshot in `zfs list -H -t snapshot | cut -f 1`;
do
zfs destroy $snapshot;
done

February 12th, 2012

ZFS Send & Receive

ZFS have abilities to save snapshot as file object or save snapshot to other remote.
As I will focus on save snapshot to other remote, only two simple commands that involve here which are zfs send, zfs receive.

The basic concept is send snapshot that you want to send to other remote by ssh protocol and make the remote understand that you gonna give the snapshot

so the commands will be

zfs send [name of the snapshot] | ssh [username]@[remote (ip or hostname)] zfs receive [name of zfs volume]

for example

zfs send DV/Sn03 | ssh reski@zfsserver zfs receive DV/Sn03

If you receive error such as zfs command not found, the solution is that you write full path of zfs in the remote size.

zfs send DV/Sn03 | ssh reski@zfsserver /usr/sbin/zfs receive DV/Sn03

if you receive error such as cannot receive new filesystem stream: permission denied, the solution is that you have to assigned some kind of some ACL permissions to that ZFS volume (remote side). Basic permissions for this remote replication are mount, create and receive

zfs allow everyone mount,create,receive DV/Sn03

* as prerequisite : you should define DV/Sn03 first before you do zfs allow

Additional notes, to send incremental updates, just modify above command

zfs send - [name of the first snapshot] [name of the second snapshot] | ssh [username]@[remote (ip or hostname)] zfs receive [name of zfs volume]

for example

zfs send -i DV/Sn03@1 DV/Sn03@2 | ssh reski@zfsserver zfs receive DV/Sn03

additional note:
if you find message like this

cannot receive new filesystem stream: destination 'VD03/dataVM' exists
must specify -F to overwrite it

it means you have to do it like this

zfs send -i DV/Sn03@1 DV/Sn03@2 | ssh reski@zfsserver zfs receive -F DV/Sn03

Reference :

      http://docs.huihoo.com/opensolaris/solaris-zfs-administration-guide/html/ch06s03.html
      http://www.markround.com/archives/38-ZFS-Replication.html
      http://docs.oracle.com/cd/E19082-01/817-2271/gfwqj/index.html
February 11th, 2012

OpenIndiana & Time-Slider

By default, if you install OpenIndiana Operating System with server installation either USB or CD mode installation, you will never get time-slider features. So what's the beauty of time-slider.

Time Slider is one of ZFS feature that introduce for OpenSolaris Operating system which utilized the ZFS ability to do multiple snapshot. With time-slider, you can forward or backward, your file condition as easy as count 1-2-3

So, how to check whether you have it or not?

You can check it by

reski@nas2:~# svcs -a |egrep "auto-snap|slider"
disabled 4:44:46 svc:/application/time-slider:default
disabled 4:44:46 svc:/application/time-slider/plugin:rsync
disabled 4:44:46 svc:/application/time-slider/plugin:zfs-send
disabled 4:44:46 svc:/system/filesystem/zfs/auto-snapshot:monthly
disabled 4:44:46 svc:/system/filesystem/zfs/auto-snapshot:daily
disabled 4:44:46 svc:/system/filesystem/zfs/auto-snapshot:weekly
disabled 4:44:46 svc:/system/filesystem/zfs/auto-snapshot:hourly
disabled 4:44:46 svc:/system/filesystem/zfs/auto-snapshot:frequent

if you got, any messages above, it means you have it. You can use it straight away.

But if you don't, install it by using following commands

 pkg set-publisher -p http://pkg.openindiana.org/sfe

pkg install time-slider

After you install it again, please make sure you check it again by do above command.
To active it via non gui a.k.a console, please check Jason Matthews blogs (http://broken.net/openindiana/how-to-configure-time-slider-without-using-the-gui)

Reference
- http://blog.allanglesit.com/2011/04/zfs-snapshot-management/
- http://borrellstudios.com/2011/07/enabling-time-slider-on-solaris-11-express/