Tuesday, December 29, 2009

Windows recognised iscsi drive as RAW (no longer as NTFS)

After connecting my iscsi F-drive from one pc to another it was no longer recognised being formatted as NTFS so Windows asked if I wanted to format the F-drive (strange because I did not touch the data ...)
I went to the command prompt and did:
D:\> CONVERT F: /fs:ntfs
Where F: is a name of the drive you want to convert. It reported back that the drive was already NTFS.
I than ran: chkdsk F: /F which fixed it. After that it was immediately accessible as a normal Drive including all the data.

Monday, December 28, 2009

realtime monitoring your zfs pool

I use the following command to see real time transaction per 5 sec on my pool extra:
# zpool iostat -v extra 5
               capacity     operations    bandwidth
pool        alloc   free   read  write   read  write
----------  -----  -----  -----  -----  -----  -----
extra       8.87G  28.4G    134      0  9.47M      0
  c7d0      8.87G  28.4G    134      0  9.47M      0
----------  -----  -----  -----  -----  -----  -----
(note: this was during a file copy over 100Mb/s LAN, reaching the max throughput of such a LAN)

To check local disk performance on my zpool I used:
# time (mkfile 2g /extra/foo)
real    2m7.349s
user    0m0.017s
sys     0m1.247s
(this creates a random file foo of 2GB  in my zpool extra and shows the time to complete)

Sunday, December 27, 2009

package manager failed with update from snv_129 to snv_130

I had my pkg publishers as followed:
dev                   http://pkg.opensolaris.org/dev/   
opensolaris.org  http://pkg.opensolaris.org/release/

But this just results in pkg refresh failing:
-To correct the repository origin, execute the following command as a privileged user:

pkg set-publisher -O opensolaris-dev

To add a new publisher using this publisher's repository origin, execute the following command as a privileged user:

pkg set-publisher -O http://pkg.opensolaris.org/dev/

After the new publisher has been added, this one should be removed by executing the following command as a privileged user:

pkg unset-publisher opensolaris-dev


I tried to follow the suggestions but to no avail.
Then I read it was mentioned to have only 1 publisher opensolaris.org as Preferred and delete dev resulting in the following pkg publisher:
opensolaris.org   http://pkg.opensolaris.org/dev/ 

But still the package manager failed to upgrade to 130 as did pkg refresh
In the forum (http://www.pubbs.net/opensolaris/200912/32545/) it was mentioned to use "pkg image-update -f"  due to errors related to release snv-128 and 129 (Option -f bypasses SUNWipkg)

Update succeeded to 130.

Friday, December 18, 2009

3com 3C200-T Gigabit network card (tcge)

I was not happy with the throughput using the onboard NIC so I installed the 3com Gigabit NIC which supports jumbo frames. NIC is not recognized by OS as standard so you have to get the driver from Asustek:
http://dlsvr01.asus.com/pub/ASUS/lan/3com/3c940/046_Solaris.zip

Just follow the instructions provided and your NIC will be recognized and fully functional.

Thursday, December 17, 2009

iscsi performance

Besides the settings mentioned in the iSCSI uguide from Microsoft: Setting TcpAckFrequency =1

Someone mentioned lack of performance was solved by disabling the "receive Windows auto tuning". See: http://support.microsoft.com/kb/947239

Tuesday, December 15, 2009

Server refused to allocate pty snv_128 and 129

after upgrade to snv_129 I was not able to login using ssh.

this is a known bug which can be solved by editing /etc/minor_perm
add the following:
"clone:ptmx 0666 root sys" to /etc/minor_perm

After reboot you can login again with ssh
(source: http://defect.opensolaris.org/bz/show_bug.cgi?id=12380)

Sunday, November 29, 2009

Nagle Algorithm

Please take a look at the node where the iSCSI Initiator is running and determine if the following parameter is being set.

[ /kernel/drv/iscsi.conf ] add the following:
#
# Disable Nagle within the iSCSI Initiator
#
tcp-nodelay=1;

The tcp-nodelay setting, alters the iSCSI Initiators socket options by setting the well-known option TCP_NODELAY, or more specifically turning off the "Nagle Algorithm". For performance reasons, this setting is hard-coded in the iSCSI Target and also Availability Suite's SNDR, both being TCP/IP based data movers of disk blocks.

For both iSCSI and SNDR, the Nagle algorithm interacts badly when using TCP delayed acknowledgments, of which both iSCSI and SNDR relies upon. These performance issues have been noted by many others, including the author John Nagle. See link at bottom of this page: http://en.wikipedia.org/wiki/Nagle's_algorithm

For Windows check the Microsoft ISCSI User Guide to change TCPIP parameter
in registry: "TcpAckFrequency=1"
(http://download.microsoft.com/download/A/E/9/AE91DEA1-66D9-417C-ADE4-92D824B871AF/uGuide.doc)

iscsi performance

(Source: http://opensolaris.org/jive/thread.jspa?threadID=78965)
Sidenote: Today we made eight network/iSCSI related tweaks that, in aggregate, have resulted in dramatic performance improvements (some I just hadn't gotten around to yet, others suggested by Sun's Mertol Ozyoney)...

- disabling the Nagle algorithm on the head node

- setting each iSCSI target block size to match the ZFS record size of 128K
- disabling "thin provisioning" on the iSCSI targets
- enabling jumbo frames everywhere (each switch and NIC)
- raising ddi_msix_alloc_limit to 8
- raising ip_soft_rings_cnt to 16
- raising tcp_deferred_acks_max to 16
- raising tcp_local_dacks_max to 16

Rerunning the same tests, we now see...


[1GB file size, 1KB record size]
Command: iozone -i o -i 1 -i 2 -r 1k -s 1g -f /data-das/perftest/1gbtest
Write: 143373
Rewrite: 183170
Read: 433205
Reread: 435503
Random Read: 90118
Random Write: 19488

[8GB file size, 512KB record size]
Command: iozone -i 0 -i 1 -i 2 -r 512k -s 8g -f /volumes/data-iscsi/perftest/8gbtest
Write:  463260
Rewrite:  449280
Read:  1092291
Reread:  881044
Random Read:  442565
Random Write:  565565

[64GB file size, 1MB record size]
Command: iozone -i o -i 1 -i 2 -r 1m -s 64g -f /data-das/perftest/64gbtest
Write: 357199
Rewrite: 342788
Read: 609553
Reread: 645618
Random Read: 218874
Random Write: 339624

Thanks so much to everyone for all their great contributions!
-Gray

Using POPtray to check your Axigen Mail

To check your Axigen mail using POPtray you need to tick the following
box in Axigen Console: Services: POP3
On UNSECURED connections allow authentication with:
Normal login (unsecured)
( Otherwise you get "Invalid Authentication Type" message  within POPtray when you check your account)



Saturday, October 24, 2009

script for fmadm alerting

source: http://prefetch.net/code/fmadmnotifier

From above site I found the following script
#!/bin/bash
#
# Program: E-mail fault manager errors
#
# Author: Matty < matty91 at gmail dot com >
#
# Current Version: 1.1
#
# Revision History:
#
# Version 1.1
# Avoid the use of temporary files -- Michael Shon
#
# Version 1.0
# Initial Release
#
# Last Updated: 08-18-2006
#
# Purpose:
# Fmadm.sh queries the fault manager to see if errors have been
# generated. If an error is detected, the script will email the
# admininstrator defined in the ADMIN vairable with the error
# details.
#
# License:
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# Installation:
# Copy the shell script to a suitable location
#
# Usage:
# To check for events once per hour, add a cron job similar to the following:
#
# $ crontab -l | grep fmadmnotifier.sh
# 0 * * * * /etc/scripts/fmadmnotifier.sh
#

PATH=/usr/bin:/sbin:/usr/sbin:/usr/sfw/bin

# Who to E-mail with new updates
ADMIN="root"

# Location of binaries
AWK=$(which awk)
FMADM=$(which fmadm)
HOSTNAME=$(which hostname)
MAIL=$(which mailx)
MKTEMP=$(which mktemp)

# Check to make sure the mail binary exists
if [ ! -f ${MAIL} ]
then
echo "Cannot find ${MAIL}"
exit 1
fi

# Check to make sure the fmadm utility exists
if [ ! -f ${FMADM} ]
then
echo "Cannot find ${FMADM}"
exit 1
fi

# Verify that mktemp exists
if [ ! -f ${MKTEMP} ]
then
echo "Cannot find ${MKTEMP}"
exit 1
fi

# Run fmadm faulty to check for hardware errors
FMADMOUTPUT=$(${FMADM} faulty | ${AWK} '$0 !~ /STATE/ && $0 !~ /^----/ { print $0 }')

if [ -n "${FMADMOUTPUT}" ]
then
(
echo "The fault manager detected a problem with the system hardware."
echo "The fmadm and fmdump utilities can be run to retrieve additional"
echo "details on the faults and recommended next course of action. "

echo ""
echo "fmadm faulty output:"
echo ""

${FMADM} faulty
echo ""
) | ${MAIL} -s "Hardware fault on $($HOSTNAME)" ${ADMIN}
fi

And some fmadm details:
The fmadm utilities "config" option can be used to view the list of diagnosis engines and agents that are active on a system:
i $ fmadm config
MODULE cpumem-retire disk-transport eft fmd-self-diagnosis io-retire snmp-trapgen sysevent-transport syslog-msgs zfs-diagnosis zfs-retire VERSION 1.1 1.0 1.16 1.0 2.0 1.0 1.0 1.0 1.0 1.0 STATUS active active active active active active active active active active DESCRIPTION CPU/Memory Retire Agent Disk Transport Agent eft diagnosis engine Fault Manager Self-Diagnosis I/O Retire Agent SNMP Trap Generation Agent SysEvent Transport Agent Syslog Messaging Agent ZFS Diagnosis Engine ZFS Retire Agent Fault manager logs
· The fault manager maintains two log files: ­ The error log contains a list of errors events that have been sent to the fault manager daemon ­ The fault log contains a list of problems that have been diagnosed and repaired · The fault log can be viewed by running fmdump:
$ fmdump · The error log can be viewed with fmdump's "-e" option:
$ fmdump -e · Fmdump also has a "-u" option to limit the output to a specific UUID, a "-T" option to display events that occurred during a specific timeframe, and "-v" and "-V" options to display verbose output Viewing faulty components

Monday, October 5, 2009

zpool monitoring

The second script checks the current state of the zpools, looking for degraded arrays (caused by failed drives), unavailable spares and unrecovered errors. Because it keeps a state file in /etc/zfs, it would need to be run as root. I run this hourly. It should be possible to update this script to also check for ZFS checksum errors, but I haven't taken the time to do it. The reminder code hasn't been tested, as I haven't had a failure since the code was put in place.

#! /bin/sh

STATEFILE="/etc/zfs/chk.state"
ALARMUSER="root@localhost"

zpool status 2>&1 | \
egrep -i '(degraded|unavail|unrecover)' > /dev/null

STATE=$?

if [ -f $STATEFILE ]
then
LASTSTATE=`cat $STATEFILE`
else
LASTSTATE=1
echo $STATE > $STATEFILE
fi

#
# Error is currently set.
#
if [ $STATE = 0 ]
then

#
# Error wasn't set previously. Send out the error message.
#
if [ $LASTSTATE = 1 ]
then
HOSTNAME=`uname -n`
zpool status -x | \
mailx -s "ZFS.error.on.$HOSTNAME" $ALARMUSER
echo $STATE > $STATEFILE
exit
fi

#
# Send out a reminder every other day.
#
FOUND=`find $STATEFILE -mtime -2`
if [ -z $FOUND ]
then
exit
fi
HOSTNAME=`uname -n`
zpool status -x | \
mailx -s "ZFS.error.reminder.on.$HOSTNAME" $ALARMUSER
echo $STATE > $STATEFILE
exit
fi

#
# Error was set, but is no longer. Send out the fixed message.
#
if [ $STATE = 1 -a $LASTSTATE = 0 ]
then
HOSTNAME=`uname -n`
zpool status -x | \
mailx -s "ZFS.error.fixed.on.$HOSTNAME" $ALARMUSER
echo $STATE > $STATEFILE
exit
fi


EDIT: Updated above script to look for unrecovered errors, thanks to information in this post by nhamilto40. To reset the error counts, the "zpool clear pool" command can be used.

I scanned this thread, and see no scripts. Perhaps this will be more useful than I thought.

ZFS tutorial using files instead of disks

Using Files
To use files on an existing filesystem, create four 128 MB files, eg.:

# mkfile 128m /home/ocean/disk1
# mkfile 128m /home/ocean/disk2
# mkfile 128m /home/ocean/disk3
# mkfile 128m /home/ocean/disk4

# ls -lh /home/ocean
total 1049152
-rw------T 1 root root 128M Mar 7 19:48 disk1
-rw------T 1 root root 128M Mar 7 19:48 disk2
-rw------T 1 root root 128M Mar 7 19:48 disk3
-rw------T 1 root root 128M Mar 7 19:48 disk4

This is easy for testing you don't need real disks or partitions
(source: http://flux.org.uk/howto/solaris/zfs_tutorial_01)

Saturday, October 3, 2009

Remote powerdown from Windows with plink.exe

Because I am using a private network without connection to the outside world,
I am not concerned about security.
Usink plink.exe as part of the puTTY package I managed a remote shutdown:
Create a shortcut on windows with the following command:
(I use the user admin for logon)

plink.exe -ssh admin@hostname -pw password -m shutdown

The tricky bit is the remote command with the option -m,
(you have to use the full path because no profile is loaded)
so my "shutdown" saved on the windows box contains this line:

/usr/bin/pfexec /usr/sbin/init 5

very similar to the 'pfexec init 5' you use when logged on in Solaris

Wednesday, September 30, 2009

Autologon

Go to /etc/X11/gdm/custom.conf and manually modify the required fields in the [daemon] section and add the following;

[daemon]
AutomaticLoginEnable=true
AutomaticLogin=<username>
Note: You cannot auto-logon as root.

Bare in mind that I’m not concerned about security at this point as the box is not exposed to the open world, and is somewhat protected by the fact it lives on a “private” LAN. (i.e. my home lan)

If you want to run something automatically on logon you can put the commands into the /etc/profile file. Since I’ve been looking for a way to autostart virtualbox machines this will be the place i do it. (mainly because it is one of the easiest way to do it)
(source: http://sigtar.com/2009/01/29/open-solaris-autologin/)

Monday, September 28, 2009

Wireless using WUSB54GC (usb13b1,20)

At first I had a WUSB54GC based on Ralink RT3070 chipset recognized as usb1737,77 but so far no driver exists so I swapped it for the well-known older version being usb13b1,20 which uses the rum driver

It was now quite easy to get it up and running

If no wired link is available, a scan for wireless LANs is done, and the resulting list offered via a GUI popup window prompts the console user to select a preference. If a successful connection is made, the WLAN in question is stored in the plain text file /etc/nwam/known_wifi_nets and the daemon may connect to any WLAN in that list without prompting the user again. If a user wishes to add other preferences or revoke existing ones, he can do so by bringing up the NWAM Manager menu with right-click on the icon, and then selecting "Manage Favorite Wireless Networks...". A user can also edit the known_wifi_nets file directly. This interface is volatile and might change in a future release

admin@opensolaris:/etc/nwam# more known_wifi_nets
denver 0:18:39:ad:ce:36

Note: My network was recognized after I enabled broadcast again on the wireless modem and choosing the option within the Gui of NWAM to put wireless as preferred connection.

/etc/nwam/llp contains:
admin@opensolaris:/etc/nwam# more llp
bge0 static 10.0.0.4/24
rum0 static 10.0.0.10/24

In order to have wireless standard as preferred put rum0 first in llp after bge0

Helpful commands:
ifconfig -a
dladm show-wifi
dladm scan-wifi
dladm show-secobj
(Note: I removed all the profiles with dladm delete-secobj)
svcadm restart nwam

Sunday, September 6, 2009

Initial startup of remote Desktop for OpenSolaris

I've not used the xvnc-inetd service on OpenSolaris, but I have been using the vino-server without issue, which is a vnc server. The only gotcha on that is that it requires the keyring password upon first connect to the desktop, so you have to be AT the desktop at least once to "approve" the connection. To get around this and effectively dissociate the vino-server from the keyring, here is a procedure I stole from another web site. This works for me on several installations from 2008.05 on up to 2008.11. Someone may have a more efficient process than this.

Procedure:
First, enable Vino by going to System...Preferences...Desktop Sharing
0. Once you've configured Remote Desktop, go to the
System...Administration...Keyring Manager. Enter your keyring
password when prompted and let it have access to itself if prompted
(!).
1. Highlight the key that contains "vino" in it. Delete that key. Yes.
2. Start gconf-editor
3a. Navigate to desktop...gnome...remote_access.
3b. Click in the empty field to the right of "vnc_password" (the
"value" column). Enter your base64 encoded password from above.
That's it. Don't need to log out. Just connect to the system with a
VNC viewer on display "0" if you didn't change the port number.

Boot sequence with IDE and SATA Disk

Originally set in bios boot section to boot from sata disk. I had my IDE disk which was originally my boot device disconnected.

I want to mirror my boot disk so use both IDE and SATA disk when I connected the power again and tried to boot up It didn’t wanted to boot. Although it still sees my SATA disk as first boot device It apparently wants to boot from IDE no matter what.

In order to boot from SATA and having the IDE disk powered and connected It was mentioned I should disable the device in the main menu where it was recognized by BIOS auto detection. I changed the value into Not installed.

That did the trick, If I do a format the disk is seen by Solaris. So now I can setup the disk as mirror for my boot drive.

Find missing zpool

I replaced my OS disk and now only the rpool was visible using zpool status. In order to see other existing pools run zpool import without options:

# zpool import
  pool: dawpool
    id: 8233866255479348343
state: ONLINE
status: The pool was last accessed by another system.
action: The pool can be imported using its name or numeric identifier and
        the '-f' flag.
   see: http://www.sun.com/msg/ZFS-8000-EY
config:

        dawpool     ONLINE
          raidz1    ONLINE
            c8t0d0  ONLINE
            c8t1d0  ONLINE
            c8t2d0  ONLINE
        spares
          c8t3d0

There it is again my raidz pool ready to be imported

Remote Desktop from windows to OpenSolaris

I was looking for some software to take over the whole desktop as in windows with remote desktop. Funny thing is it is already built in OpenSolaris.
On your Solaris box goto System –> Preferences –> Desktop Sharing and set the following:

Yes I know it is not very secure but in my case this will become a NAS server with no connection to the outside world. Now you can start a browser session http://<hostname>:5800 and it will give you RDP like you are used to in Windows.

After shutdown and restart I could not start this remote session http://<ip-address>:5800. Checked the desktop on Solaris and it mentions the Gnome-keyring-daemon-wrapper.

To turn it off:
go to System->Preferences->Sessions and uncheck
>>> GNOME Keyring Daemon Wrapper in the Startup Programs

Saturday, September 5, 2009

WUSB54GC wireless USB stick (usb1737,77)

In order to get wireless working I tried several things, so far not successful.
According to other bloggers I have a new version based on Ralink RT3090
Information I gathered so far:

To find out which usb devices are connected run as root:
# echo ::prtusb | mdb -k
INDEX DRIVER INST NODE VID.PID PRODUCT
1 ehci 0 pci1043,82e2 0000.0000 No Product String
2 ehci 1 pci1043,82e2 0000.0000 No Product String
3 ohci 0 pci1043,82e2 0000.0000 No Product String
4 ohci 1 pci1043,82e2 0000.0000 No Product String
5 usb_mid 0 device 413c.2003 DELL USB Keyboard
6 hid 2 mouse 046d.c03d USB-PS/2 Optical Mouse
7 usb_mid 1 device 1737.0077 802.11 g WLAN

> 7 usb_mid 1 device 1737.0077 802.11 g wlan
Hmm, this device is new version, which is a Ralink 3090 chipset,


#modinfo
#devfsadm -i
#dmesg | grep Ralink

SUNWural
Package SUNWural didn't work so I removed package
SUNWrum
Also tried with SUNWrum package (rum driver) but no.
# update_drv -a -i "usb1737,77" rum
# ifconfig rum0 plumb

From Ubuntu Forum: Problem solved! idea
I have to rename /etc/Wireless/RT3090STA to /etc/Wireless/RT2860STA
Although it is a RT3090 driver, it uses RT2860 as its internal reference. confused2
Anyway, I can connect to the Internet with no problem now.

#iwconfig to configure it

nwam will configure interface automatically (NetWork Auto Magic = Standard on opensolaris)
Note that in auto-magic mode, there is a limitation that only one link is active at a time. This mode is thus not recommended for machines which use more than one link at once. For machines with wired and wireless links, wired is preferred by default, although this can be adjusted by altering the order of the lines in the plain text file /etc/nwam/llp. Note, however, that this interface is Volatile and may change in a future release.

===============================================
By hand:

export PAGER='less'
man dladm

cat > /tmp/mykey
mykey123
^D (Ctrl + D / EOF)

create-secobj -c wpa -f /tmp/mykey mykey
scan-wifi
connect-wifi -e myap -s wpa -a open -m g -k mykey
dladm show-wifi
dladm disconnect-wifi
==================================================
# Linksys WUSB54GC
DEVICE=wlan0
BOOTPROTO=none
HWADDR=xx:xx:xx:xx:xx:xx
ONBOOT=yes
TYPE=Wireless
USERCTL=yes
PEERDNS=yes
NETMASK=255.255.255.0
IPADDR=192.168.1.4
GATEWAY=192.168.1.254
ESSID=xxx
CHANNEL=1
MODE=Master

And my wpa_supplicant.conf:

ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel
ap_scan=1

network={
ssid="xxx"
bssid=xx:xx:xx:xx:xx:xx
mode=0
key_mgmt=WPA-PSK
proto=WPA
auth_alg=OPEN
pairwise=TKIP
psk="xxx"
}

Asus M4N78pro with MCP78S connect to the internet with nge

I was having problems as well on how to get to the internet using this board (MCP78S [GeForce 8200] Ethernet) and opensolaris 2009.06 because the NIC was not recognized.
To get out of this "catch 22" you can use nge as the driver for the NIC.
For this you don't need a compiler. After you are connected to the internet you can download gcc compiler and the preferred nfo driver.

Lets inform the system to let nge handle the device

#pfexec update_drv -a -i "pci10de,760" nge
(or add nge "pci10de,760" to /etc/driver_aliases)
#pfexec ifconfig nge0 plumb
#ifconfig -a showed nge0

nge needs just a little tweaking to work
your ethernet address is probably reversed (it's what I have)
so do as root
#ifconfig nge0 ether
ether 5:3c:db:21:19:0

now just reverse the order of the words delimited by : (do not totally reverse character by character)
and restart dhcp
#ifconfig nge0 ether 0:19:21:db:3c:5
#ifconfig nge0 dhcp start

I decided to use static IP:
echo "10.0.0.138" > /etc/defaultrouter (IP of your router)
echo "10.0.0.0 255.255.255.0" > /etc/netmasks
edit /etc/resolv.conf (DNS from your provider)
nameserver 195.121.1.34
nameserver 195.121.1.66

Switch to using the DNS servers...
dawbckup:/etc# cp nsswitch.conf nsswitch.conf.original
dawbckup:/etc# cp nsswitch.dns nsswitch.conf
dawbckup:/etc# svcadm restart svc:/network/dns/client:default

Step 4: Switch to a static IP
# vi /etc/nwam/llp
change the 'nge0 dhcp' to 'nge0 static 10.0.0.3/24'

svcadm restart svc:/network/physical:nwam

step5.
edit /etc/hosts
add 10.0.0.3 dawbckup

Do a restart (init 6) and you should be able to connect to the internet after you reverse the ip adress again

ifconfig nge0 ether 0:19:21:db:3c:5

Now you can get your gcc compiler and download the nfo driver.

Monday, August 31, 2009

iostat -En

An example of the above command:
# iostat -En
c8d0 Soft Errors: 0 Hard Errors: 0 Transport Errors: 0
Model: ST3160215AS Revision: Serial No: 6RA Size: 160.04GB <160039305216 bytes>
Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0
Illegal Request: 0
c7t0d0 Soft Errors: 0 Hard Errors: 9 Transport Errors: 0
Vendor: PLEXTOR Product: DVDR PX-712A Revision: 1.09 Serial No:
Size: 0.00GB <0 bytes>
Media Error: 0 Device Not Ready: 9 No Device: 0 Recoverable: 0
Illegal Request: 0 Predictive Failure Analysis: 0
c10t0d0 Soft Errors: 0 Hard Errors: 0 Transport Errors: 0
Vendor: WDC WD40 Product: 0LB-07DNA2 Revision: 7B79 Serial No:
Size: 40.02GB <40020664320 bytes>
Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0
Illegal Request: 76 Predictive Failure Analysis: 0

Sunday, August 30, 2009

Clone boot disk to another disk with bigger partition

Created a 30gb partition in the second disk(c10t0d0)
#format
choose disk1
#fdisk
========================================
Note:
If you receive the EFI label complaint
before you set-up mirror and after OS has been installed on a first
disk make sure you put SMI label on the second disk and partition it
exactly the same. Use format -e disk2 and then issue 'label' - it will
ask you if you want smi or efi label, choose smi. then do: prtvtoc
/dev/rdsk/disk1s2 | fmthard -s - /dev/rdsk/disk2s2

then, assuming your os is installed in s0 setup an mirror like:
#zpool attach rpool disk1s0 disk2s0
==========================================

# prtvtoc /dev/rdsk/c8d0s2| fmthard -s - /dev/rdsk/c10t0d0s2
fmthard: Partition 2 specifies the full disk and is not equal
full size of disk. The full disk capacity is 62492850 sectors.
fmthard: New volume table of contents now in place.

#zpool attach rpool c8d0s0 c10t0d0s0
invalid vdev specification
use '-f' to override the following errors:
/dev/dsk/c10t0d0s0 is part of exported or potentially active ZFS pool rpool. Please see zpool(1M).

#zpool attach -f rpool c8d0s0 c10t0d0s0
Zfs started resilvering process (check with zpool status)
Please be sure to invoke installgrub(1M) to make 'c10t0d0s0' bootable.

# installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c10t0d0s0
stage1 written to partition 0 sector 0 (abs 16065)
stage2 written to partition 0, 271 sectors starting at 50 (abs 16115)
#

switched bootdisk and started up fine. I didn't want my mirror configuration any more so I did:
#zpool detach rpool c8d0s0

Saturday, August 29, 2009

Using Axigen Command Line Interface

After the use of the axigen-cfg-wizard to setup a domain
I noticed the following after installing the license key and restart of Axigen.

I could not access my mail using webmail or use the GUI
I found the answer in the knowledgebase of Axigen.
After installation of the license belonging to the free version you may only have one domain. I remembered that I had left the original also in the config so I had 2 domains which is not allowed. Therefore no domain was present.

And here comes the CLI to the rescue:

To start the CLI: telnet 127.0.0.1 7000
root@opensolaris:/var/opt/axigen/webadmin# telnet 127.0.0.1 7000
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Welcome to AXIGEN's Command Line Interface
You must login first. For a list of available commands, type HELP
user admin
xxxxx
For a list of available commands, type HELP
+OK: Authentication successful
<#> help
-------------------------------------
The commands available for the Initial context are:
EXIT/QUIT - exits CLI and closes connection to AXIGEN
HELP - prints this help message

LIST Domains [wildcard (ex: domain*)] - lists the domains of this server
LIST domainActivationRequests - lists the requests made for domain registration

CLEAR domainActivationRequests - clear the list of requests not pending

SAVE CONFIG [] - saves the server's running configuration (a suffix will be added)

CONFIG SERVER - enters the Server context

SET admin-password - sets the admin password (max. 32 chars) (OBSOLETE - kept for backward compatibility)

CHANGE password oldPassword newPassword - changes your password (max. 32 chars)

ENTER QUEUE - enters the Queue context
ENTER AACL - enters the Administrative ACL context

CREATE Domain name domainLocation postmasterPassword - creates a domain (changes context)
CREATE Subdomain prefix parentDomain postmasterPassword - creates a subdomain (changes context)
REGISTER Domain domainLocation - registers a domain to the server (changes context)
UNREGISTER Domain name - unregisters a domain from the server

UPDATE Domain name - updates a domain from the server (changes context)
SHOW Domain name [ATTR ] - shows the given domain
-------------------------------------
<#> list domains
The list of domains for the server:
+OK: command successful
<#> create domain name solsan domainlocation /var/opt/axigen/domains/solsan postmasterpassword xxxxx
+OK: command successful
commit
committing changes and switching back to previous context.
This operation might take some time. Please wait....
+OK: command successful

<#> list domains
The list of domains for the server:

name Total Used
------------------------------------------------------------
solsan 20Kb 20Kb

+OK: command successful
<#> help
-------------------------------------
<#> exit
WARNING: all changes made and not committed are lost
connection to AXIGEN closing.
+OK: have a nice day
Connection to 127.0.0.1 closed by foreign host.
root@opensolaris:/var/opt/axigen/webadmin# /etc/init.d/axigen restart
Stopping AXIGEN Mail Server... DONE
Starting AXIGEN Mail Server... DONE
root@opensolaris:/var/opt/axigen/webadmin# /etc/init.d/axigen reload
Reloading AXIGEN configuration... DONE
root@opensolaris:/var/opt/axigen/webadmin# /etc/init.d/axigen restart
Stopping AXIGEN Mail Server... DONE
Starting AXIGEN Mail Server... DONE
root@opensolaris:/var/opt/axigen/webadmin#

Mail from command prompt using Axigen

http://www.axigen.com/kb/show/35

# ln -sf /opt/axigen/bin/sendmail /usr/lib/sendmail
# chown axigen:axigen sendmail
# chmod 6750 sendmail

Note: The chown command will reset the SUID and GUID bits, so you need to issue it before the chmod command.
At the end, in order for any user to be able to send e-mails using the command line sendmail wrapper, you need to insert the respective user in the axigen group.
In my case I added unix user "admin" to axigen and tested to see if I received any mail in axigen

To test:
echo "Coming home for dinner" | mail admin
mailx -s "Axigen conf file" admin < axigen.cfg

Additional some locations:
/var/opt/axigen/run/axigen.cfg
webmail http://10.0.0.4:8000 / 10.0.0.4 for Axigen 7.2
webadmin: http://10.0.0.4:9000

CLI: telnet 10.0.0.4 7000

Axigen Mail on OpenSolaris

In order to receive alerts from my NAS I decided to use Free Axigen Office Edition (Standard)
By setting up email on my NAS I only need a pop-email notifier on my DAW to see if there are alerts. I use poppeeper for this

Axigen provides the whole package including POP3 in a modern interface and easy installation. Officially Axigen is not supported on OpenSolaris but it turned out fine.

Downloaded latest version for Solaris

First removed sendmail because I will use the sendmail functionality from Axigen:
OpenSolaris: pkg uninstall SUNWsndm

Execute as root ./axigen-7.1.4.i386.solaris.run

Then the wizard needs to be launched by issuing one of the following commands, on Solaris and all Linux platforms:

/opt/axigen/bin/axigen-cfg-wizard

This Wizard is using xterm and that was causing some problems:

I tried with VNC;
started vncserver as root and used vncviewer on windows 10.0.0.4:5901
although xclock was working as root i could not start axigen-cfg-wizard.

In google I found: install the following package: ncurses
After that was done I could start the wizard.

=========

If you don't want to use VNC; Axigen provides the following solution for this problem:
Error opening terminal when running axigen-cfg-wizard on Solaris
Quick Link: http://www.axigen.com/kb/show/56
Article updated on 26 January, 2007

Description
Running axigen-cfg-wizard on Solaris returns "Error opening terminal"

Resolution
Because of the non-default path of the terminfo terminal definitions in Solaris, the axigen-cfg-wizard application returns:

Error opening terminal. This can easily be solved by setting the TERMINFO environment variable to the correct terminfo

path:

TERMINFO="/usr/share/lib/terminfo"
export TERMINFO

STEPS:
Logon to your Solaris box
Open a terminal window as admin (standard user created during install of openSolaris) and open xterm session as root with:
pfexec xterm

In this window at the prompt type:
TERMINFO="/usr/share/lib/terminfo"
export TERMINFO

now you can start the wizard
/opt/axigen/bin/axigen-cfg-wizard

I configured everything according standard.
(you can easily change it later using the GUI)

Installing Logwatch on OpenSolaris

source: Caffeinated
Typically, installing Logwatch is fairly trivial. On Linux, you’d just use the package installer command and you’re done. On OpenSolaris, there doesn’t seem to be a packaged version of Logwatch (yet), so installing from the source tarball is necessary. Fortunately, there’s a shell script that performs the installation. The bad news is this script finds /usr/sbin/install which is the Solaris version of install. This version behaves very differently from those found in other Unix variants. The Logwatch installer is expecting the behavior of the install script found on Linux, so it fails miserably on OpenSolaris.

The good news is, there’s a simple solution. Just install the SUNWscp package. This is the “source compatibility package”, which installs numerous commands that help OpenSolaris behave more like other Unix systems. The Logwatch installer script prepends the /usr/ucb directory to the PATH when it runs, so it finds the install script that it is expecting, and thus it installs Logwatch perfectly. The only thing left is to add the crontab entry, as shown at the end of the install output.

One last note about Logwatch, and it concerns that crontab entry. It seems that the default configuration for Logwatch is to print the report rather than sending an email to the default recipient, root. However, the example crontab entry is redirecting all output to /dev/null. So how exactly is one supposed to get a daily report? The answer is to edit the /etc/logwatch/conf/logwatch.conf file, adding Print = no at the end of the file. That tells Logwatch to email the report rather than printing. It’s a mystery to me why that’s the default given the example crontab entry they display during the installation process. But at least it’s easy to fix, and nicely demonstrates how easy it is to customize Logwatch without touching the default configuration files.

Sunday, August 16, 2009

Get serial number of disk using smartmontools

(source: http://cafenate.wordpress.com/2009/02/22/setting-up-smartmontools-on-opensolaris/)
Installed smartmontools 5.38:
tar zxvf smartmontools-5.38.tar.gz
cd smartmontools-5.38
./configure
make
make install
(Smartmontools is by default installed in /usr/local)

The first change to make in /usr/local/etc/smartd.conf is to comment out the DEVICESCAN line, which is fine if you want to scan all disks in your system, but I found that smartmontools didn’t like my rpool disk, and it wanted me to declare the disk types as “scsi” for it to do anything at all. Next we have to tell smartd which disks to monitor, so I added the following lines to the end of the smartd.conf file:

/dev/rdsk/c8t0d0 -d scsi -H -m redalert
/dev/rdsk/c8t1d0 -d scsi -H -m redalert
/dev/rdsk/c8t2d0 -d scsi -H -m redalert
/dev/rdsk/c8t3d0 -d scsi -H -m redalert
/dev/rdsk/c8t4d0s0 -d scsi -H -m redalert


goto /usr/local/sbin

root@dawbckup:/usr/local/sbin# ./smartctl -d scsi -a /dev/rdsk/c7t0d0
smartctl version 5.38 [i386-pc-solaris2.11] Copyright (C) 2002-8 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

Serial number: S13PJDWS647014
Device type: disk
Local Time is: Sun Aug 16 15:11:29 2009 WEST
Device supports SMART and is Enabled
Temperature Warning Disabled or Not Supported
SMART Health Status: OK

Current Drive Temperature: 31 C

Error Counter logging not supported
No self-tests have been logged
root@dawbckup:/usr/local/sbin

c8t0d0: S13PJDWS647014
c8t1d0: S13PJDWS304477
c8t2d0: S13PJDWS647020
c8t3d0: S13PJDWS304478
(the disks of my SAN)

So far so good, but what about having smartd run at bootup, and continuously monitoring the disk status? In Linux, you’d use initd, but since this is OpenSolaris, we’ll use the Service Management Framework (SMF) instead. To do that, paste the following text into /var/svc/manifest/site/smartd.xml, change the file ownership to root:sys, and invoke:
pfexec svccfg -v import /var/svc/manifest/site/smartd.xml
Then check that the service is running (svcs smartd), and if not, enable it using pfexec svcadm enable smartd.

<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type="manifest" name="smartd">
  <service
     name="site/smartd"
     type="service"
     version="1">
    <single_instance/>
    <dependency
       name="filesystem-local"
       grouping="require_all"
       restart_on="none"
       type="service">
      <service_fmri value="svc:/system/filesystem/local:default"/>
    </dependency>
    <exec_method
       type="method"
       name="start"
       exec="/usr/local/etc/rc.d/init.d/smartd start"
       timeout_seconds="60">
      <method_context>
        <method_credential user="root" group="root"/>
      </method_context>
    </exec_method>
    <exec_method
       type="method"
       name="stop"
       exec="/usr/local/etc/rc.d/init.d/smartd stop"
       timeout_seconds="60">
    </exec_method>
    <instance name="default" enabled="true"/>
    <stability value="Unstable"/>
    <template>
      <common_name>
        <loctext xml:lang="C">
          SMART monitoring service (smartd)
        </loctext>
      </common_name>
      <documentation>
        <manpage title="smartd" section="1M" manpath="/usr/local/share/man"/>
      </documentation>
    </template>
  </service>
</service_bundle>

A this point we have a managed service that is checking the health of our disks, and if anything comes up, it will send an email to the redalert user.

Saturday, August 15, 2009

iostat command

iostat -xnzc 1

us sy wt id
1 7 0 92
extended device statistics
r/s w/s kr/s kw/s wait actv wsvc_t asvc_t %w %b device
0.0 348.0 0.0 6340.0 0.0 0.1 0.1 0.2 3 5 c7t0d0
0.0 348.0 0.0 6340.0 0.0 0.1 0.1 0.2 3 5 c7t1d0
0.0 347.0 0.0 6340.0 0.0 0.1 0.1 0.2 3 5 c7t2d0

iostat -xtc 2 2

extended device statistics tty cpu
device r/s w/s kr/s kw/s wait actv svc_t %w %b tin tout us sy wt id
cmdk0 2.6 0.8 134.4 13.7 0.1 0.0 32.7 1 3 0 97 1 1 0 99
fd0 0.0 0.0 0.0 0.0 0.0 0.0 981.3 0 1
sd0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0
sd3 0.1 21.1 1.8 369.1 0.0 0.0 0.5 0 0
sd4 0.1 21.1 1.8 369.1 0.0 0.0 0.4 0 0
sd5 0.1 21.1 1.8 369.1 0.0 0.0 0.4 0 0
sd6 0.1 0.0 1.3 0.3 0.0 0.0 0.9 0 0
extended device statistics tty cpu
device r/s w/s kr/s kw/s wait actv svc_t %w %b tin tout us sy wt id
cmdk0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 309 0 0 0 100
fd0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0
sd0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0
sd3 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0
sd4 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0
sd5 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0
sd6 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0


zpool iostat 3

capacity operations bandwidth
pool used avail read write read write
---------- ----- ----- ----- ----- ----- -----
dawpool 2.78G 2.72T 0 16 3 771K
rpool 7.79G 12.2G 2 0 137K 14.0K
---------- ----- ----- ----- ----- ----- -----
dawpool 2.78G 2.72T 0 0 0 0
rpool 7.79G 12.2G 0 0 0 0

Set I/O block size

You must also consider I/O block size before creating a ZFS store this is not something that can be changed later so now is the time. It’s done by adding the –b 64K to the ZFS create command. I chose to use 64k for the block size which aligns with VMWare default allocation size thus optimizing performance. The –s option enables a sparse volume feature aka thin provisioning. In this case the space was available but it is my favorite way to allocate storage.

(Note we use 64k also for formatting the disk in windows so it makes sense to use the same blocksize here)

zfs create -b 64K -V 1800G dawpool/backup

ZFS Management Console WEBMIN

ZFS Web-Based Management

A web-based ZFS management tool is available to perform many administrative actions. With this tool, you can perform the following tasks:

* Create a new storage pool.
* Add capacity to an existing pool.
* Move (export) a storage pool to another system.
* Import a previously exported storage pool to make it available on another system.
* View information about storage pools.
* Create a file system.
* Create a volume.
* Take a snapshot of a file system or a volume.
* Roll back a file system to a previous snapshot.

==============================================
Note: this is what I found regarding Webmin on opensolaris:

1. Install the Sun Webmin package by running - pkg install SUNWwebmin
2. Go to /usr/sfw/lib/webmin and run ./setup.sh
3. Edited /etc/webmin/miniserv.users and added my primary user as follows:
admin:x:101
-This allows you to login to the server
4. Change password for webmin account admin
(At running setup I was not asked to provide a userID/password, so login failed)
To set/change/update password for the user created in step 3:

#cd /usr/sfw/lib/webmin
# ./changepass.pl admin
usage: changepass.pl

This program allows you to change the password of a user in the Webmin
password file. For example, to change the password of the admin user
to foo, you would run:
changepass.pl /etc/webmin admin foo
This assumes that /etc/webmin is the Webmin configuration directory.

5. Edited /etc/webmin/webmin.acl using a copy of the existing entry for root and added a new line and changed root to admin to give access to all the modules
6. Restart webmin using svcadm restart webmin
7. You can now access the WebMin interface at http://:10000/

Resilvering

The process of replacing a drive can take an extended period of time, depending on the size of the drive and the amount of data in the pool. The process of moving data from one device to another device is known as resilvering, and can be monitored by using the zpool status command.

Traditional file systems resilver data at the block level. Because ZFS eliminates the artificial layering of the volume manager, it can perform resilvering in a much more powerful and controlled manner. The two main advantages of this feature are as follows:

*

ZFS only resilvers the minimum amount of necessary data. In the case of a short outage (as opposed to a complete device replacement), the entire disk can be resilvered in a matter of minutes or seconds, rather than resilvering the entire disk, or complicating matters with “dirty region” logging that some volume managers support. When an entire disk is replaced, the resilvering process takes time proportional to the amount of data used on disk. Replacing a 500-Gbyte disk can take seconds if only a few gigabytes of used space is in the pool.
*

Resilvering is interruptible and safe. If the system loses power or is rebooted, the resilvering process resumes exactly where it left off, without any need for manual intervention.

To view the resilvering process, use the zpool status command. For example:

# zpool status tank
pool: tank
state: DEGRADED
reason: One or more devices is being resilvered.
action: Wait for the resilvering process to complete.
see: http://www.sun.com/msg/ZFS-XXXX-08
scrub: none requested
config:
NAME STATE READ WRITE CKSUM
tank DEGRADED 0 0 0
mirror DEGRADED 0 0 0
replacing DEGRADED 0 0 0 52% resilvered
c1t0d0 ONLINE 0 0 0
c2t0d0 ONLINE 0 0 0
c1t1d0 ONLINE 0 0 0

In this example, the disk c1t0d0 is being replaced by c2t0d0. This event is observed in the status output by presence of the replacing virtual device in the configuration. This device is not real, nor is it possible for you to create a pool by using this virtual device type. The purpose of this device is solely to display the resilvering process, and to identify exactly which device is being replaced.

Note that any pool currently undergoing resilvering is placed in the DEGRADED state, because the pool cannot provide the desired level of redundancy until the resilvering process is complete. Resilvering proceeds as fast as possible, though the I/O is always scheduled with a lower priority than user-requested I/O, to minimize impact on the system. Once the resilvering is complete, the configuration reverts to the new, complete, configuration. For example:

# zpool status tank
pool: tank
state: ONLINE
scrub: scrub completed with 0 errors on Thu Aug 31 11:20:18 2006
config:

NAME STATE READ WRITE CKSUM
tank ONLINE 0 0 0
mirror ONLINE 0 0 0
c2t0d0 ONLINE 0 0 0
c1t1d0 ONLINE 0 0 0

errors: No known data errors

The pool is once again ONLINE, and the original bad disk (c1t0d0) has been removed from the configuration.

Friday, August 14, 2009

SATA Mode set to AHCI

Setup raidZ with AHCI SATA

Updated Asus Bios to 1102 using Alt-F2 during boot (updated Bios file was loaded onto my USB stick). Bios successfully updated.
At first boot after bios update I went into Bios setup and configured in bios SATA Mode to AHCI (was SATA)
After second boot up I destroyed dawpool and did a format to recognize the disks again:


root@dawbckup:~# format
Searching for disks...done


AVAILABLE DISK SELECTIONS:
0. c0d1
/pci@0,0/pci-ide@6/ide@0/cmdk@1,0
1. c7t0d0
/pci@0,0/pci1043,82e2@9/disk@0,0
2. c7t1d0
/pci@0,0/pci1043,82e2@9/disk@1,0
3. c7t2d0
/pci@0,0/pci1043,82e2@9/disk@2,0
4. c7t3d0
/pci@0,0/pci1043,82e2@9/disk@3,0
Specify disk (enter its number): ^C
root@dawbckup:~#

zpool create dawpool raidz c7t0d0 c7t1d0 c7t2d0 spare c7t3d0

root@dawbckup:~# zpool create dawpool raidz c7t0d0 c7t1d0 c7t2d0 spare c7t3d0
invalid vdev specification
use '-f' to override the following errors:
/dev/dsk/c7t0d0s0 is part of exported or potentially active ZFS pool dawpool. Please see zpool(1M).
root@dawbckup:~# zpool create -f dawpool raidz c7t0d0 c7t1d0 c7t2d0 spare c7t3d0
root@dawbckup:~#


root@dawbckup:~# zpool status
pool: dawpool
state: ONLINE
scrub: none requested
config:

NAME STATE READ WRITE CKSUM
dawpool ONLINE 0 0 0
raidz1 ONLINE 0 0 0
c7t0d0 ONLINE 0 0 0
c7t1d0 ONLINE 0 0 0
c7t2d0 ONLINE 0 0 0
spares
c7t3d0 AVAIL

errors: No known data errors

pool: rpool
state: ONLINE
scrub: none requested
config:

NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
c0d1s0 ONLINE 0 0 0

errors: No known data errors
root@dawbckup:~#

Wednesday, August 12, 2009

install package from commandline (gcc compiler)

root@dawbckup:/usr/sbin# which gcc
no gcc in /usr/sbin /usr/bin
root@dawbckup:/usr/sbin# pfexec pkg install gcc-dev
DOWNLOAD PKGS FILES XFER (MB)
Completed 20/20 3095/3095 37.97/37.97

PHASE ACTIONS
Install Phase 3932/3932
PHASE ITEMS
Reading Existing Index 8/8
Indexing Packages 20/20
root@dawbckup:/usr/sbin#

Create raidz pool dawpool with 3 disks with hot spare

I bought 4 samsung 1TB disks with 32M cache to build a raidz storage consisting of 3 disks with a hot spare:

After i finished installing the disks in my server it was time to discover the new disks:

root@dawbckup:~# format
Searching for disks...done


AVAILABLE DISK SELECTIONS:
0. c0d1
/pci@0,0/pci-ide@6/ide@0/cmdk@1,0
1. c5d0
/pci@0,0/pci-ide@9/ide@0/cmdk@0,0
2. c5d1
/pci@0,0/pci-ide@9/ide@0/cmdk@1,0
3. c6d0
/pci@0,0/pci-ide@9/ide@1/cmdk@0,0
4. c6d1
/pci@0,0/pci-ide@9/ide@1/cmdk@1,0
Specify disk (enter its number): ^C

We see c0d1 as OS disk holding OpenSolaris

root@dawbckup:~# zpool create dawpool raidz c5d0 c5d1 c6d0 spare c6d1
root@dawbckup:~#

root@dawbckup:~# zpool list
NAME SIZE USED AVAIL CAP HEALTH ALTROOT
dawpool 2.72T 1.22M 2.72T 0% ONLINE -
rpool 20G 7.53G 12.5G 37% ONLINE -
root@dawbckup:~# zpool status
pool: dawpool
state: ONLINE
scrub: none requested
config:

NAME STATE READ WRITE CKSUM
dawpool ONLINE 0 0 0
raidz1 ONLINE 0 0 0
c5d0 ONLINE 0 0 0
c5d1 ONLINE 0 0 0
c6d0 ONLINE 0 0 0
spares
c6d1 AVAIL

errors: No known data errors

pool: rpool
state: ONLINE
scrub: none requested
config:

NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
c0d1s0 ONLINE 0 0 0

errors: No known data errors
root@dawbckup:~#

root@dawbckup:~# zfs list
NAME USED AVAIL REFER MOUNTPOINT
dawpool 95.2K 1.78T 25.3K /dawpool
rpool 9.41G 10.3G 78K /rpool
rpool/ROOT 5.61G 10.3G 18K legacy
rpool/ROOT/be_name 5.51G 10.3G 3.37G /
rpool/ROOT/nfo2 57K 10.3G 2.94G /
rpool/ROOT/nfo_setup 39K 10.3G 2.24G /
rpool/ROOT/nfo_static 60K 10.3G 3.07G /
rpool/ROOT/opensolaris 82.6M 10.3G 2.81G /
rpool/ROOT/opensolaris-1 24.8M 10.3G 3.33G /
rpool/dump 1.87G 10.3G 1.87G -
rpool/export 39.8M 10.3G 19K /export
rpool/export/home 39.8M 10.3G 19K /export/home
rpool/export/home/admin 39.8M 10.3G 39.8M /export/home/admin
rpool/swap 1.87G 12.2G 66K -
root@dawbckup:~# zfs create -V 1700G dawpool/backup
root@dawbckup:~#


root@dawbckup:~# zfs get shareiscsi dawpool
NAME PROPERTY VALUE SOURCE
dawpool shareiscsi off default
root@dawbckup:~#
root@dawbckup:~# zfs set shareiscsi=on dawpool
root@dawbckup:~# zfs get shareiscsi dawpool
NAME PROPERTY VALUE SOURCE
dawpool shareiscsi on local
root@dawbckup:~# iscsitadm list target -v
Target: dawpool/backup
iSCSI Name: iqn.1986-03.com.sun:02:....7c64-....-....-....-....3cd75dac
Alias: dawpool/backup
Connections: 0
ACL list:
TPGT list:
LUN information:
LUN: 0
GUID: 0
VID: SUN
PID: SOLARIS
Type: disk
Size: 1.7T
Backing store: /dev/zvol/rdsk/dawpool/backup
Status: online
root@dawbckup:~#

I fired up the MS ISCSI service in my workstation and it was recognized in diskmanagement

I added as one drive of 1700G and performed a full format (no Quick Format):
Format NTFS with 64K at 17:15 finished 1700GB at (20% in 15 min)

Saturday, May 23, 2009

Ghost 4 Linux faster than Clonezilla

After a successful clone of my OS-disk in 75 minutes with CloneZilla I tried to do the same with Ghost 4 Linux (G4L). I used the latest version 0.30 and used similar option to clone the disk/partition: source hdb1 -> sda1. Sda1 was again attached via USB using my usb/IDE adapter.

G4L managed to clone the disk in less than 15 minutes for 20GB. So almost 4 times faster than CloneZilla.
Booting with the new cloned disk did not give any problems.

Wednesday, May 20, 2009

Import existing array to new server

After a POC (Proof of Concept) with openSolaris on an old Dell GX270 with a zfs pool "daw" I wanted to know how to link that existing pool to my new Config based on M4N78-PRO setup:

admin@dawbckup:~# zpool import daw
cannot import 'daw': pool may be in use from other system, it was last accessed by dawbkup (hostid: 0xc9e4de) on Wed May 6 16:02:36 2009
use '-f' to import anyway
admin@dawbckup:~# zpool import -f daw
cannot share 'daw/backup': iscsitgtd failed request to share
zfs set shareiscsi=on daw/backup
admin@dawbckup:/etc# iscsitadm list target -v
Target: daw/backup
iSCSI Name: iqn.1986-03.com.sun:02:aa46a269-bef7-4432-9ed2-9890738fc784
Alias: daw/backup
Connections: 0
---

Voila here it is back again. Now I can mount it again in windows and we're back in business.

admin@dawbckup:~# zpool list
NAME SIZE USED AVAIL CAP HEALTH ALTROOT
daw 149G 5.29G 144G 3% ONLINE -
rpool 20G 6.60G 13.4G 33% ONLINE -

admin@dawbckup:/etc# zfs list
NAME USED AVAIL REFER MOUNTPOINT
daw 120G 26.7G 18K /daw
daw/backup 120G 141G 5.29G -
rpool 8.89G 10.8G 78K /rpool
rpool/ROOT 4.99G 10.8G 18K legacy

Clonezilla to make Backup OpenSolaris Bootdisk

I wanted to check if it was possible to clone my bootdisk with Opensolaris.
I used the latest version: clonezilla-live-1.2.2-14.iso

Booted with the clonezilla CD and chose the option "device to device clone"
My OpenSolaris bootdisk partition was recognized as hdb1.
I connected the new disk using my IDE to USB adapter and this disk was called sda1
Clonezilla asked If I wanted to replace the bootsector on the target (=yes)
After giving the final approval it went off and my 20GB partition took about 75 minutes.

Replacing the original bootdisk in the server with this cloned copy booted up fine!
Hurray for Clonezilla

Add ISCSI package

After the update to the latest version:
admin@dawbckup:/etc# uname -a
SunOS dawbckup 5.11 snv_111a i86pc i386 i86pc

You have to select from the Category "Storage" the package "storage-nas"
Without it I could not run the command: iscsitadm list target -v

update to the latest OpenSolaris (save Boot Environment)

Before you update make a backup of your BE:
#save BOOT Environment
beadm create (type the name for this backup here)

Add dev to the package manager environment to get the latest updates:
http://pkg.opensolaris.org/dev
run package manager from the menu and choose update all (555 packages in my case)
If you get an error that it cannot install them, you probably forgot to check the radiobutton to set dev as Preferred Repository

Update to specific build:
So, can anybody advise how the system can be upgraded to chosen dev version?

Ok, here is the procedure:

Starting from OpenSolaris 2009.06 (snv_111b) active BE.

1) beadm create snv_111b-dev
2) beadm activate snv_111b-dev
3) reboot
4) pkg set-authority -O http://pkg.opensolaris.org/dev opensolaris.org
5) pkg install SUNWipkg
6) pkg list 'entire*'
7) beadm create snv_118
8) beadm mount snv_118 /mnt
9) pkg -R /mnt refresh
10) pkg -R /mnt install entire@0.5.11-0.118
11) bootadm update-archive -R /mnt
12) beadm umount snv_118
13) beadm activate snv_118
14) reboot

Now you have a snv_118 development environment.

You need a jump-off BE that has a lower build then the one you want to install.

Set Static IP on OpenSolaris

ifconfig nfo0 plumb (do a ifconfig -a to see if it is nfo0 or anything else)
ifconfig nfo0 10.0.0.3 netmasks 255.255.255.0 up (I decided to give it 10.0.0.3)
echo "10.0.0.138" > /etc/defaultrouter (My router IP)
echo "10.0.0.0 255.255.255.0" > /etc/netmasks

dawbckup:/etc# cp nsswitch.conf nsswitch.conf.original
dawbckup:/etc# cp nsswitch.dns nsswitch.conf

Remove the file if present: /etc/dhcp.nfo0

edit /etc/hosts
add 10.0.0.3 dawbckup

vi /etc/defaultrouter
(add '10.0.0.138' on its own line)

vi /etc/hostname.nfo0
(add dawbckup)

everything should be okay when you'll reboot,

=========== reset config =====
In contemporary (Solaris 8/Solaris 9) days, "sys-unconfig" is the correct answer
==============================

step 1 select NIC nfo0
step 2. setup nameservers
edit /etc/resolv.conf
domain qstudio.nl (to get rid of the FQDN message)
nameserver 195.121.1.34 (Use DNS from your Internet Provider)
nameserver 195.121.1.66

step 3.Switch to using the DNS servers...
dawbckup:/etc# cp nsswitch.conf nsswitch.conf.original
dawbckup:/etc# cp nsswitch.dns nsswitch.conf
dawbckup:/etc# svcadm restart svc:/network/dns/client:default

Step 4: Switch to a static IP
gedit /etc/nwam/llp
change the 'nfo0 dhcp' to 'nfo0 static 10.0.0.3/24'

svcadm restart svc:/network/physical:nwam

step5.
edit /etc/hosts
add 10.0.0.3 dawbckup

vi /etc/defaultrouter
(add '10.0.0.138' on its own line)

(Hmmm, I realise I used two ways to edit/change files, one time using vi and started with "echo" Whichever you prefer)

step 6 (I did not need to do step 6, but it was mentioned by a user)
# pfexec svcadm enable svc:/network/physical:default
# pfexec svcadm restart network/routing-setup

Asus M4N78-Pro works with OpenSolaris 2008.11

I run opensolaris on my new asus board. Had some difficulty with the Gigabit driver not being recognized but used the latest driver from the website mentioned by the device driver utility (http://homepage2.nifty.com/mrym3/taiyodo/eng/)

I first tried to set this MCP78S (Geforce 8200 Ethernet) as a nge0 device but had trouble with the reverse bug with the MAC address.
I then decided to set it up as nfo0 with the nfo-2.6.3.tar.gz.
Installation following the readme provided with the tar file went OK and revealed itself as pci10de,760.

OpenSolaris - slow boot fix

If you've installed opensolaris 11/08 and unhappily found it's slow as mud to boot..

# edit /rpool/boot/grub/menu.lst
# look for the lines like.. below and remove them..

splashimage /boot/solaris.xpm
foreground d25f00
background 115d93

# next find the kernel line and change from
--kernel$ /platform/i86pc/kernel/$ISADIR/unix -B $ZFS-BOOTFS,console=graphics
++kernel$ /platform/i86pc/kernel/$ISADIR/unix -B $ZFS-BOOTFS

My boot time went from longer than 5 minutes to under 30 seconds. and you get to see the svc errors :)

Tuesday, May 5, 2009

ZFS Alerting

http://en.wikibooks.org/wiki/System_Monitoring_with_Hobbit/HOWTO#Hobbit_Client_and_ZFS_monitoring

Check which disk are in the system and ID’s given by Solaris:
bash-3.00# metastat |tail -3
Device Reloc Device ID
c0t1d0 Yes id1,sd@SSEAGATE_ST336607LSUN36G_3JA6ECDF00007418PJ5V
c0t0d0 Yes id1,sd@SSEAGATE_ST336607LSUN36G_3JA6EGFK00007418A7PM
bash-3.00#

bash-3.00# format
Searching for disks...done


AVAILABLE DISK SELECTIONS:
0. c0t0d0
/pci@1c,600000/scsi@2/sd@0,0
1. c0t1d0
/pci@1c,600000/scsi@2/sd@1,0
2. c0t2d0
/pci@1c,600000/scsi@2/sd@2,0
3. c0t3d0
/pci@1c,600000/scsi@2/sd@3,0


Show Health
# bash-3.00# zpool list -H
# mypool 33.8G 84.5K 33.7G 0% ONLINE -
# bash-3.00#


Script that sends an email out to redalert
This the script (run as root via crontab) I use to have an email sent
to 'root' if a fault is detected. It has already reported a fault:

#!/bin/sh
REPORT=/tmp/faultreport.txt
SYSTEM=$1
rm -f $REPORT
/usr/sbin/fmadm faulty 2>&1 > $REPORT
if test -s $REPORT
then
/usr/bin/Mail -s "$SYSTEM Fault Alert" redalert < $REPORT
fi
rm -f $REPORT

Setup ZFS iSCSI

Created an array
bash 3.2# zpool create daw c1t1d0

root@dawbkup:~# zfs set shareiscsi=on daw
root@dawbkup:~# zfs get shareiscsi daw

NAME PROPERTY VALUE SOURCE
daw shareiscsi on local

zfs create -V 120G daw/backup
[any zvols (not filesystems, I checked) created under daw will automatically become LUNs]

Ignore the following eror Probably caused by the fact I forgot to import from categorie Storage the "storage-san" package
root@dawbkup:~# zfs set shareiscsi=on daw/backup
cannot share 'daw/backup': iscsitgtd failed request to share

zfs set shareiscsi=on daw/backup

root@dawbkup:~# iscsitadm list target -v

Target: daw/backup
iSCSI Name: iqn.1986-03.com.sun:02:aa46a269-bef7-4432-9ed2-9890738fc784
Alias: daw/backup

After this I downloaded the Iscsi Initiator for windows XP and used the instructions from Microsoft. At the end the volume is shown when you go to My computer -> Manage -> Disk management. You now can create partitions add drive letters and format just like a regular disk within Windows.