Tuesday, March 30, 2010

Sun Fire V120 as NAS part 4: Testing ZFS RAID-Z

I wanted to test a RAID5 configuration but having my server booting from a ZFS disk, seems that the Solaris Volume Manager (SVM) databases are not created and I can't use it. Anyway my main project is focuses in ZFS. Start!!!!!
From the SSM software or the format utility I get the disks names (SCSI nodes 1 to 3, scsi bus 2 - onle array disk):
  • c2t1d0
  • c2t2d0
  • c2t3d0

Create a ZFS RAIDZ array is easy, just type:
# zpool create fsshared raidz c2t1d0 c2t2d0 c2t3d0
Now I have a new folder named /fsshared:
# ls
bin       dev       export    kernel    mnt       platform  sbin      usr
boot      devices   fsshared  lib       net       proc      system    var
cdrom     etc       home      lom2      opt       rpool     tmp       vol
# zfs list
NAME                        USED  AVAIL  REFER  MOUNTPOINT
fsshared                   89,9K  33,1G  28,0K  /fsshared
rpool                      4,67G  28,6G    97K  /rpool
rpool/ROOT                 3,67G  28,6G    21K  legacy
rpool/ROOT/s10s_u8wos_08a  3,67G  28,6G  3,67G  /
rpool/dump                  512M  28,6G   512M  -
rpool/export                 44K  28,6G    23K  /export
rpool/export/home            21K  28,6G    21K  /export/home
rpool/swap                  512M  28,8G   230M  -
At the list you can see the main boot zfs systems named as root and my new fsshared array. Now it's time to check speed.
Create a new 2 GB file and watch how the array free space decreases:
# cd /fsshared
# mkfile 2g testfile
# ls
testfile
# zfs list
NAME                        USED  AVAIL  REFER  MOUNTPOINT
fsshared                   2,00G  31,1G  2,00G  /fsshared
rpool                      4,74G  28,5G    97K  /rpool
rpool/ROOT                 3,74G  28,5G    21K  legacy
rpool/ROOT/s10s_u8wos_08a  3,74G  28,5G  3,74G  /
rpool/dump                  512M  28,5G   512M  -
rpool/export                 44K  28,5G    23K  /export
rpool/export/home            21K  28,5G    21K  /export/home
rpool/swap                  512M  28,8G   230M  -
To check the write speed I copied the testfile to / and measured the time manualy
# cp /fsshared/testfile /
2048 MB  -  161s  - 12.8 MB/s
# rm /fsshared/testfile
# cp /testfile /fsshared
2048 MB  -  181 s  -  11.3 MB/s
This is not a good result and I'm start to think that the small amount of  RAM in the server is one of the causes (with the slow CPU of course). Writing from the main disk to the array is slower than the reverse option. This speed is not fantastic but it's a write speed, now I need a gigabit card to check read speed. If read performance is ok, the V120 will be enough as NAS.

A new test copying the same file from the array to the disk 2 of the server:
# zpool create disc2 c1t1d0
# cp /fsshared/testfile /disc2
2048 MB  -  164 s  -  12,5 MB/s
Not better results here... And from the main disk to the second one of the server? And reverse?

# rm /disc2/testfile
# cp /testfile /disc2
2048 MB  -  121s  - 16.9 MB/s

Wow... Maybe the ZFS RAID calculations are too heavy for this server.
 Ok. Next must be test NFS, FTP and SMB trasfer results.

Sun Fire V120 as NAS part 3: Enabling ssh root login

Ok. I'm tired. This server is too loud to work behind it. Because I don't want to create users yet and I want to admin the server from another room I decided to enable login with the root account, like my other linux servers

Very easy to do, from the serial console logged as root: edit /etc/ssh/sshd_config and change:
PermitRootLogin no >>PermitRootLogin yes

SPECIAL TIP!!!! I can't use the vi editor from the console as I can't see all the lines of the file. I uploaded to my main server via ftp, modified it in my workstation an then it downloaded again.
# svcadm disable svc:/network/ssh:default
# ftp 192.168.2.254
(...)
# svcadm enable svc:/network/ssh:default

Monday, March 29, 2010

Sun Fire V120 as NAS part 2: SSM

Before I create a ZFS array I decided to check the RAID 5 software with the standard UFS configuration to get some performance results and, then, compare with a RAID-Z. But before everything, to install the Sun Storage Subsystem Manager 2.0 (SSM) is a good idea. This software monitors the status of the atthached StorEdge S1 SCSI array writing messages to the system log and can be accessed from diferent clients utside the main server.

The SSM can be downloaded form the Sun downloads page here or, like me, it can be installed with the CDROM supplied with the disk array.

Fortunately, the lasts versions of the Solaris operating system come with the Solaris Volume Manager (SVM) loaded by default and the cdrom is mounted as soon as the disc is in the drive:
# cd /cdrom/cdrom0
# ls
Copyright FR_Copyright License.ps Packages
# cd Packages
# ls
SUNWssmr SUNWssmu
# pkgadd -d /cdrom/cdrom0/Packages SUNWssmu SUNWssmr
Just type 'y' when the wizard ask to follow with the intallation. Now the status of the array can be followed with the help of the ssmadmin utility:
# /opt/SUNWssmu/bin/ssmadmin -view
At first time the server didn't show the status of my disk because I had the array turned off and for this reason the configuration file was bad. I have to recreated the disk configuration booting the system with thr '-r' flag at the ok prompt. To create a new one if you change any of the disk or insert a new one:
lom>poweroff
LOM event: +0h26m56s host power off
lom>bootmode forth
lom>poweron
lom>
LOM event: +0h27m19s host power on
ok setenv auto-boot? off
auto-boot? = false
ok reset-all

Sun Fire V120 (UltraSPARC-IIe 648MHz), No Keyboard
OpenBoot 4.0, 512 MB memory installed, Serial #56372093.
Ethernet address 0:3:ba:5c:2b:7d, Host ID: 835c2b7d.

ok boot -r
Boot device: /pci@1f,0/pci@1/scsi@8/disk@0,0:a File and args: -r
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.

v120 console login: root
password:

Last login: Mon Mar 29 21:10:49 on console
Mar 29 21:32:56 v120 login: ROOT LOGIN /dev/console
Sun Microsystems Inc. SunOS 5.10 Generic January 2005

# format
Searching for disks...done


AVAILABLE DISK SELECTIONS:
0. c1t0d0
/pci@1f,0/pci@1/scsi@8/sd@0,0
1. c1t1d0
/pci@1f,0/pci@1/scsi@8/sd@1,0
2. c2t1d0
/pci@1f,0/pci@1/scsi@8,1/sd@1,0
3. c2t2d0
/pci@1f,0/pci@1/scsi@8,1/sd@2,0
4. c2t3d0
/pci@1f,0/pci@1/scsi@8,1/sd@3,0

# /opt/SUNWssmu/bin/ssmadmin -c /etc/opt/SUNWssmu/ssmon.conf
Reading configuration file: /etc/opt/SUNWssmu/ssmon.conf

Searching for disks...done.


NOTE: A disk drive must be physically installed in the
base target slot of each storage unit.

Press enter to continue:

Disks found on the system:

Disk
Number Bus Target Disk
1 1 0 c1t0d0s0
2 1 1 c1t1d0s0
3 2 1 c2t1d0s0
4 2 2 c2t2d0s0
5 2 3 c2t3d0s0


Please enter the disk number of the base target address of
the storage unit. NOTE: An asterisk denotes a selected disk.

Just press enter when finished: 3
Disks found on the system:

Disk
Number Bus Target Disk
1 1 0 c1t0d0s0
2 1 1 c1t1d0s0
* 3 2 1 c2t1d0s0
* 4 2 2 c2t2d0s0
* 5 2 3 c2t3d0s0


Please enter the disk number of the base target address of
the storage unit. NOTE: An asterisk denotes a selected disk.

Just press enter when finished:


The following disks have been selected:

/dev/rdsk/c2t1d0s0
/dev/rdsk/c2t2d0s0
/dev/rdsk/c2t3d0s0

Save configuration? (yes,no): yes


The SSM daemon must be stopped and restarted after re-creating
the configuration file. Use the /etc/init.d/ssmgmt script to
stop and start the daemon:
# /etc/init.d/ssmgmt stop
# /etc/init.d/ssmgmt start

# /etc/init.d/ssmgmt stop
stopping SSM server.
# /etc/init.d/ssmgmt start
starting SSM server.
ssmond: Failed to open message catalog.
#
You can see the error message but the SSM works nice:
# /opt/SUNWssmu/bin/ssmadmin -view
ssmond: Failed to open message catalog.

Number of S1-D130 Units: 1
Critical Temperature Threshold: 60 Degrees Celsius
Warning Temperature Threshold: 50 Degrees Celsius

TIME: 29 de marzo de 2010 21:40:12 CEST
*****************************************************************

v120::S1-D130-1: Online
-------------------

DISK1[c2t1d0s0]:
Serial Number: 0224Z35960
Vendor: FUJITSU
Model: SUN18G
Status: Online
Current Temperature: 26 Degrees Celsius
DISK2[c2t2d0s0]:
Serial Number: 3BT2FCQL
Vendor: SGI
Model: C
Status: Online
DISK3[c2t3d0s0]:
Serial Number: 0224Z35919
Vendor: FUJITSU
Model: SUN18G
Status: Online
Current Temperature: 28 Degrees Celsius

#

Wednesday, March 24, 2010

Sun Fire V120 as NAS part 1: Installing Solaris 10 and drivers

One of my friends started to test FreeNAS in an old PC with bad results in performance over gigabit network and Samba. Seeking in the FreeNAS forums there is a lot of work to get a system working well in gigaethernet, with a lot of parameters to tweak. His test remembered me an old project: Creating my own NAS with an Sparc server.


I have a SunFire V120 and a Storedge S1 from a long time with no use and I decided to get a try with this system. Unfortunately it has 100 Mbit Ethernet and only one PCI slot, so: I can put a Sun Gigaswift or Quad Gigaswift network card or an SATA card but not both cards at the same time. Anyway if the systems probes its reliability with my configuration, I will buy a new server with more CPU power like the SunFire V210 who has gigaethernet and one PCI slot to atach a SATA RAID card.

In the other hand, if the project goes well I can use a X64 server with Solaris 10 or OpenSolaris and get a lot of power with low cost. Now in the after market there are a lot of Sun V20z for a low price and these systems have dual AMD Opteron (and dual core) possibility with two PCI slots.

For this test I choosed 5 hard disk: on 36GB 10K for the Solaris installation and four 18GB 10K as array in RAID 5 configuration, three of them in external SCSI array StorEdge S1. Not sure if I can mix internal HD's with the StorEdge ones but. If the mix is not possible maybe a new Storedge S1 must come here (now are very very cheap, more cheap without disk!). I pretend to use ZFS in all disks.
Ok. First of all I have to install the OS. I downloaded the latest Solaris 10. To connect to the server console we need a RJ45 RS232 cable (Cisco serial system) connected to the LOM port (blue cable in the picture). Once the terminal software is running (9600 baud, no par, 8 bit, 1 stop) the server must boot from the cdrom. Not easy to figure how to boot the DVD from the console: the V120 User guide says a few steps but this instructions doesn't work in my case. Finally, after a lot of websearch and found the solution:

1. Boot the machine to the console system. From the lom prompt type:
lom> bootmode forth
lom> poweron
2. The boot command usually has the cdrom argument, but in this case I have to add - install:
ok boot cdrom - install
    At this stage, if the server renponds with Fast Data Access MMU Miss you must reset the server. This is because a forced power off:
ok setenv auto-boot? false # Yes, with the '?'
ok reset
Now the V120 will reboot and the installation can start (well, start the wizard takes a lot of time with this DVD device).
 
3. Now only is follow the screen installer is needed. Installed the Final User Software Group, configured the network and a lot of time before, the server will reboot. In Spanish in the picture:

4. After the first reboot the server showed a warning about the label of the second hard disk: Corrupt label; wrong magic number. This hd was on my SGI Octane and has SGI label. Logged in the system as root I labeled disk 1:
# format
Searching for disks...Mar 24 21:52:20 v120 scsi: WARNING: /pci@1f,0/pci@1/scsi@8,1/sd@3,0 (sd18):
Mar 24 21:52:20 v120    Corrupt label; wrong magic number
Mar 24 21:52:20 v120 scsi: WARNING: /pci@1f,0/pci@1/scsi@8,1/sd@3,0 (sd18):
Mar 24 21:52:20 v120    Corrupt label; wrong magic number
Mar 24 21:52:20 v120 scsi: WARNING: /pci@1f,0/pci@1/scsi@8,1/sd@5,0 (sd20):
Mar 24 21:52:20 v120    Corrupt label; wrong magic number
Mar 24 21:52:20 v120 scsi: WARNING: /pci@1f,0/pci@1/scsi@8,1/sd@5,0 (sd20):
Mar 24 21:52:20 v120    Corrupt label; wrong magic number
done

c2t3d0: configured with capacity of 16.86GB
c2t5d0: configured with capacity of 16.86GB


AVAILABLE DISK SELECTIONS:
       0. c1t0d0           /pci@1f,0/pci@1/scsi@8/sd@0,0
       1. c2t3d0           /pci@1f,0/pci@1/scsi@8,1/sd@3,0
       2. c2t4d0           /pci@1f,0/pci@1/scsi@8,1/sd@4,0
       3. c2t5d0           /pci@1f,0/pci@1/scsi@8,1/sd@5,0
Specify disk (enter its number):  1
selecting c2t3d0
[disk formatted]
Mar 24 21:54:38 v120 scsi: WARNING: /pci@1f,0/pci@1/scsi@8,1/sd@3,0 (sd18):
Mar 24 21:54:38 v120    Corrupt label; wrong magic number
Disk not labeled.  Label it now? y
Mar 24 21:54:41 v120 scsi: WARNING: /pci@1f,0/pci@1/scsi@8,1/sd@3,0 (sd18):
Mar 24 21:54:41 v120    Corrupt label; wrong magic number
Mar 24 21:54:41 v120 scsi: WARNING: /pci@1f,0/pci@1/scsi@8,1/sd@3,0 (sd18):
Mar 24 21:54:41 v120    Corrupt label; wrong magic number
Mar 24 21:54:41 v120 scsi: WARNING: /pci@1f,0/pci@1/scsi@8,1/sd@3,0 (sd18):
Mar 24 21:54:41 v120    Corrupt label; wrong magic number


FORMAT MENU:
        disk       - select a disk
        type       - select (define) a disk type
        partition  - select (define) a partition table
        current    - describe the current disk
        format     - format and analyze the disk
        repair     - repair a defective sector
        label      - write label to the disk
        analyze    - surface analysis
        defect     - defect list management
        backup     - search for backup labels
        verify     - read and display labels
        save       - save new disk/partition definitions
        inquiry    - show vendor, product and revision
        volname    - set 8-character volume name
        !     - execute , then return
        quit
format> quit
Repeated with all the bad labeled disks. The format is showing only 4 disk now... I can't see the second hd of the server... I will look later.

5. Turn on autoboot from the ok prompt.
# setenv auto-boot? true
6. Install LOMLite 2.0. With only the OS installed the server cant speak to the LOM device and we can't control it or shutdown the machine properly. Also the power button doesn't work well without this patch. I have this patch stored in my main server and I can access via FTP:
# cd /var/spool/pkg
# ftp 192.168.2.105
Connected to 192.168.2.105.
220 ProFTPD 1.3.2 Server (ProFTPD) [192.168.2.105]
Name (192.168.2.105:root): admin
331 Password required for admin
Password:
230 User admin logged in
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> get lom20.zip
200 PORT command successful
150 Opening BINARY mode data connection for lom20.zip (546804 bytes)
226 Transfer complete
local: lom20.zip remote: lom20.zip
546804 bytes received in 1 seconds (526,38 Kbytes/s)
ftp> quit
221 Goodbye.

# unzip lom20.zip
# rm lom20.zip
# pkgadd
Now only follow the wizard to install the patch.

7. Shutdown the server. Here we have a problem with the shutdown command. The server doesn't have the NFS server configured and the shutdown command needs this service to send messages to all the client. Because I don't want to configure the NFS server now, I have to use the old shutdown command:
# /usr/ucb/shutdown now
this take the system to the ok promp, to power of the server then:
ok power-off

8. OPTIONAL and not needed: Update the PROM with a patch. This is done by the 111991-07 Sun patch. Like before I have it stored in my main server:
# ftp 192.168.2.100
Connected to 192.168.2.100
220 ProFTPD 1.3.2 Server (ProFTPD) [192.168.2.100]
Name (192.168.2.100:root): admin
331 Password required for admin
Password:
230 User admin logged in
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> cd /files
ftp> ls
200 PORT command successful
150 Opening ASCII mode data connection for file list
111991-07-PROM_ upgrade_patch.htm
110208-22_LightsOutManagement2_0_archivos
111991-07-PROM_ upgrade_patch_archivos
110208-22_LightsOutManagement2_0.htm
110208-22.zip
111991-07.zip
110208-22_LOM_2.0.txt
111991-07_PROM_UPGRADE.txt
226 Transfer complete
237 bytes received in 0,06 seconds (3,85 Kbytes/s)
ftp> bin
200 Type set to I
ftp> get 111991-07.zip
200 PORT command successful
150 Opening BINARY mode data connection for 111991-07.zip (694197 bytes)
226 Transfer complete
local: 111991-07.zip remote: 111991-07.zip
694197 bytes received in 1,1 seconds (637,70 Kbytes/s)
ftp> quit
221 Goodbye.
# reboot

9. When the machine is rebooting, type the scape carachters '#.' (without the ') and get the lom prompt:
 lom> break
Type  'go' to resume
ok boot -s
10. Now you have to type the root password to login the system, follow:
# chmod +x Update.to.flapjack2.4.0.17@OS
# ./Update.to.flapjack2.4.0.17@OS
After a new reboot, the ROM is updated.

Yes!!! Finish!!! I have the SunFire V120 running:
Now I need some time to start the next step: Configure the disks array.

Tuesday, March 2, 2010

USB Wacom tablets on IRIX

Googling for some information about the Wacom IRIX drivers for USB devices I found this great post in the Nekochan forums. Just some tweaking is needed to work. In my case I have a Wacom Graphire2 tablet (model ET-0405A-U) what I aquired some time before for only 6 Euro! The tablet was detected fine by the system and appeared on hinv, and it was useable -to some extend- in the PROM.

To use this on the X system I only created a config file like the Neko forum post:
fuel 1# cd /usr/lib/X11/input/config
fuel 2# vi tablet
    x_init {
    name "tablet"
    scalewhich "none"
    pushpointer "on"
    autostart "on"
    pressure "on"
    }
:wq

And then only logout and login to the X window system. Now at the end on the hinv I get:
USB controller: type OHCI
USB Human Interface Device: device id 0 type tablet