Friday, December 24, 2010

An Ode to a putty and screen. Also keeping green

I love the simple things in life, especially those that make life simple.

I was requested to build two Solaris 10 servers remotely, Setup SUNWjet & template (very straight forward these days)
One putty session over VPN, loaded with screen utility with named split screens.

I didn't use any carbon travelling to site, but shouldn't I get some bonus points for low bandwidth as well!!

Screen Options

^AA = to name a session
^As = Split screen
^ATAB = Switch split screen

Putty Setting's, SSH2, Compression and Blowfish encryption.

Wednesday, September 15, 2010

OpenIndiana - First install

Curious on how this will evolve. OpenSolaris life outside of Oracle/Sun is uncertain, will the community strength or fold?

Can you use Solaris wanboot to boot a system into single user mode?

Can you use Solaris wanboot to boot a system into single user mode?

Google or Sun Docs didn't have the definitive answer for me.

Answer is YES

T5240, No Keyboard
Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
OpenBoot 4.30.7, 8192 MB memory available, Serial #xxxxxx.
Ethernet address 0:ff:ff:ff:f:ff, Host ID: 8xxxxxx.

{0} ok

{0} ok setenv network-boot-arguments host-ip=,router-ip=,subnet-mask=,hostname=hostname-gd,file=
network-boot-arguments =  host-ip=,router-ip=,subnet-mask=,hostname=hostname-gd,file=
{0} ok boot net -s
Boot device: /virtual-devices@100/channel-devices@200/network@0  File and args: -s

Wed Sep 15 14:04:06 wanboot info: WAN boot messages->
SunOS Release 5.10 Version Generic_141444-09 64-bit
Copyright 1983-2009 Sun Microsystems, Inc.  All rights reserved.
Use is subject to license terms.
Booting to milestone "milestone/single-user:default".
Configuring devices.
Network interface was configured manually.
Requesting System Maintenance Mode
# ls /dev/dsk
c0d0s0  c0d0s1  c0d0s2  c0d0s3  c0d0s4  c0d0s5  c0d0s6  c0d0s7
# mount /dev/dsk/c0d0s0 /a
# ls /a
bin         etc         lost+found  proc        tmp
boot        export      mnt         root        usr
dev         kernel      opt         sbin        var
devices     lib         platform    system

Sunday, July 11, 2010

Reduce Swap in Red Hat 5

Red Hat recommended SWAP to be no larger than 4Gb,

1) Show current swap
swapon -s

2) Unmount Swap
swapoff /dev/mapper/VolGroup00-LogVol01

3) Reduce from 54Gb to 4Gb (Each LV Extent is 32Mb)
lvreduce -l -1600 /dev/VolGroup00/LogVol01

4) Reformat swap
mkswap /dev/VolGroup00/LogVol01

5) Mount swap as defined in /etc/fstab
swapon -a

Saturday, February 20, 2010

VMware vMA - UK setup

VMware's vMA is an execllet tool for managing ESXi environments and comes as a pre-built Virtual machine (Appliance).

My method of setting it up for the UK, thus my cronjobs run in GMT/BST.

Setup Authentification to vCenter/ESX hosts
sudo vifp addserver <>
vifp listservers
Test it works
vicfg-nics -l --vihost 

Update vMA
$ sudo vi /etc/vmware/esxupdate/vimaupdate.conf
 proxy = http://
 proxyport = 
$ sudo vima-update scan
$ sudo vima-update update

Setup SSH Keys
$ mkdir ~/.ssh
$ vi ~/.ssh/authorized_keys2
$ chmod 700 ~/.ssh/authorized_keys2

Set Time and local
$ sudo mv /etc/localtime /etc/
$ sudo ln -s /usr/share/zoneinfo/Europe/London /etc/localtime
$ sudo vi /etc/sysconfig/keyboard
$ sudo vi /boot/grub/menu.1st
title Red Hat Enterprise Linux Server (2.6.18-164.el5)
       root (hd0,0)
       kernel /vmlinuz-2.6.18-164.el5 ro root=/dev/VolGroup00/root quiet notsc divider=10
      initrd /initrd-2.6.18-164.el5.img 
$ sudo vi /etc/ntp.conf
comment out lines
#fudge stratum 10
add lines
server <1st NTPSERVER FQDN/IP>
server <2nd NTPSERVER FQDN/IP>
$ sudo vi /etc/ntp/step-tickers

Scheduled network capture on Windows using Wireshark (tshark.exe)

A customer had an iSCSI issue and was required to capture network packets at a specific time on a Windows 2008 server.

I came up with simple method using Wireshark's tshark.exe and Windows scheduler "AT".


type c:\capture.bat
rem Capture WireShark example
rem Andy Paton
rem WTL
rem use AT to run batch
rem example at 01:50 cmd /c c:\capture.bat

rem debug at issues
rem example at 09:50 /interactive cmd /k c:\capture.bat

rem -a duration:1200 in seconds
rem -B Buffer Size - default is 1Mb
rem -i Interface number - use "tshark.exe -D" to list interface numbers
rem -n don't resolve IP addresses
rem -q Quiet output
rem -w output file
rem capture filter "host "

c:\"Program Files"\Wireshark\tshark -a duration:1200 -B 2 -i 4 -n -q -w c:\network.out host

Saturday, February 06, 2010

ZFS Compression Vs Deduplication (dedup)

Been playing with ZFS dedupe for the last two weeks and just wanted to share my findings.  

Setup OpenSolaris build 131
Sun X4200, 2 x Dual Core Opteron 2.6Ghz, 8Gb Ram, 4 x 73Gb SAS 10Krpm

root@osol:~# zfs list
NAME                       USED  AVAIL  REFER  MOUNTPOINT
compress                    72K  66.9G    21K  /compress
dedupe                      72K  66.9G    21K  /dedupe

root@osol:~# zfs set compression=on compress
root@osol:~# zfs set dedup=on dedupe

Wanted to see how much real data would dedupe.

I loaded the my company  project/Software folders, 68,000 files (Visio/PDF/Project/Word/OpenOffice/Excel,ISO's... ) total of 38.9Gb

Load times, copying files from local UFS filesystem to ZFS dataset.

root@osol:/ufs# ptime tar cf - iso projects software | pv | ( cd /dedupe/ ; tar xf - )
real    19:51.930407394
user        5.807881662
sys      1:48.025965013
38.8GB 0:19:51 [33.3MB/s]

root@osol:/ufs# ptime tar cf - iso projects software | pv | ( cd /compress/ ; tar xf - )
real    18:46.544321180
user        3.368262960
sys      1:52.065809786
38.8GB 0:18:46 [35.3MB/s]

The deupe ZFS volume was 66 seconds slower than the compress volume.

Let see how much space we saved for both methods

root@osol:/ufs# zpool list
compress    68G  36.1G  31.9G    53%  1.00x  ONLINE  -
dedupe      68G  38.4G  29.6G    56%  1.02x  ONLINE  -
rpool       67G  49.8G  17.2G    74%  1.00x  ONLINE  -

root@osol:/ufs# zfs get compressratio compress
compress  compressratio  1.08x  -

The compressed volume did a better job than dedupe and saving an extra 6% storage.

There isn't any advantages for dedupe on a general home file share, slight slower performance and less space saved when compared to compression.

Now why would you want to dedupe ? Well just look at my dedupe ratio of 2.28 for a NFS share with VMware, now this is exciting!

root@osol:~$ zpool list vm-dedupe
vm-dedupe  68G   16.1G  51.9G    23%  2.28x  ONLINE  -

Therefore I can only say "Some data is more equal than others."

 (Minor edit  7.02.10)