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.