Tag Archive for 'solaris'

Manually mount a removable media under Solaris 10

This morning I had to install some SUNW packages in a remote Solaris 10 x86 system (a Sun Fire X4150). I had the packages in the installation DVD, so I tried to map the DVD as a virtual device using the SUN embedded Light Out Manager console (sun-elom).

Apparently the thing was working. When I mapped the DVD I head the DVD started to spin, but I couldn’t see the DVD mounted into the system: it should appear under /rmdisk (removable disk), but it didn’t.

I first ran volcheck -v, and then rmformat:

# volcheck -v
media was found

# rmformat
Looking for devices...
     1. Volmgt Node: /vol/dev/aliases/cdrom0
        Logical Node: /dev/rdsk/c1t0d0s2
        Physical Node: /pci@0,0/pci108e,4843@1d,7/storage@1/disk@0,0
        Connected Device: TSSTcorp CD/DVDW TS-T632A SR03
        Device Type: DVD Reader/Writer

     2. Volmgt Node: /vol/dev/aliases/rmdisk0
        Logical Node: /dev/rdsk/c3t0d0p0
        Physical Node: /pci@0,0/pci108e,4843@1d,7/storage@5/disk@0,0
        Connected Device: manufact product          1234
        Device Type: Removable

# ls -al /vol/dev/aliases/rmdisk0
lrwxrwxrwx   1 root     root          35 Apr 30 12:15 /vol/dev/aliases/rmdisk0 -> /vol/dev/rdsk/c3t0d0/unknown_format

So the removable DVD is rmdisk0, and its device file is /dev/rdsk/c3t0d0p0. Unfortunately (I don’t know why — using PCA I looked for a patch that could solve this, but didn’t see any), it seems that volfs couldn’t recognize the DVD format (unknown_format), so it didn’t mount it automatically.

I then tried to force volfs to mount it, using volrmmount, but it didn’t mount anything:

# volrmmount -i rmdisk0

I finally had to mount the device manually. To do this, first i had to disable volfs:

# svcadm disable -st volfs

I then checked the filesystem type of the virtual device (to also be sure that the system was actually seeing it correctly). To do that, I used the command fstyp and the device file returned by rmformat:

# fstyp -v /dev/dsk/c3t0d0p0
hsfs
CD-ROM is in ISO 9660 format
System id: Solaris
Volume id: OpenSolaris
Volume set id:
Publisher id:
Data preparer id:
Application id: MKISOFS ISO 9660/HFS FILESYSTEM BUILDER & CDRECORD CD-R/DVD CREATOR (C) 1993 E.YOUNGDALE (C) 1997 J.PEARSON/J.SCHILLING
Copyright File id:
Abstract File id:
Bibliographic File id:
Volume set size is 1
Volume set sequence number is 1
Logical block size is 2048
Volume size is 330857

The system could actually see the device, which filesystem is a hsfs. Knowing that, I could easily mount the device:

# mount -F hsfs /dev/dsk/c3t0d0p0 /mnt
# ls  /mnt
LICENSE            devices            reconfigure        solarismisc.zlib
archive.bz2        jack               release_notes.txt  system
bin                mnt                root               tmp
boot               platform           sbin
dev                proc               solaris.zlib

Once I had finished with the virtual device, I just had to unmount it and restart volfs:

# umount /mnt
# svcadm enable -s volfs

iSCSI entre una Solaris (Initiator) y un Linux (target)

Respondiendo al comentario de gonzo34 a ese post solicitando mas informacion sobre como usar iSCSI en Solaris, voy a poner aqui mis notas sobre el tema.

En el linux, que “exporta” por iSCSI el disco (o el lvol), instalamos el iSCSI Target. Una vez instalado, indicamos al demonio qué disco/lvol exportar (por ejemplo el /dev/vg01/lviscsi01):

# vi /etc/ietd.conf
#IncomingUser nwsmith secretsecret
Target iqn.2006-06.com.alegrome:storage.lvm
Lun 0 /dev/vg01/lviscsi01
Alias iscsitest01

Iniciamos el demonio (o lo reiniciamos):

# service iscsi-target start
Starting iSCSI target service:    [  OK  ]

Comprobamos que este arriba el demonio:

# netstat -ntlp | grep 3260
tcp  0  0  0.0.0.0:3260  0.0.0.0:*  LISTEN 3160/ietd
# tail /var/log/messages
Jan 14 15:59:02 server kernel: iSCSI Enterprise Target Software - version 0.4.5
Jan 14 15:59:02 server kernel: iotype_init(91) register fileio
Jan 14 15:59:03 server kernel: target_param(109) d 1 8192 262144 65536 2 20 8 0
Jan 14 15:59:03 server iscsi-target: ietd startup succeeded

alegrome# cat  /proc/net/iet/volume
tid:1 name:iqn.2006-06.com.alegrome:storage.lvm
        lun:0 state:0 iotype:fileio iomode:wt path:/dev/vg01/lviscsi01

Ahora en la solaris (cambiar IP por la IP del Linux):

# iscsiadm add discovery-address IP:3260

# iscsiadm modify discovery --sendtargets enable

# iscsiadm list discovery
Discovery:
        Static: disabled
        Send Targets: enabled
        iSNS: disabled

# devfsadm -v -i iscsi
devfsadm[752]: verbose: symlink /dev/dsk/c1t2d0s0 -> ../../devices/iscsi/disk@0000iqn.2006-06.com.alegrome%3Astorage.lvm0001,0:a
[...]

Ya vemos el disco con el format:

# format
Searching for disks...done

c1t2d0: configured with capacity of 1008.00MB

AVAILABLE DISK SELECTIONS:
       0. c0t0d0 
          /pci@1f,0/pci@1,1/ide@3/dad@0,0
       1. c1t2d0 
          /iscsi/disk@0000iqn.2006-06.com.alegrome%3Astorage.lvm0001,0
Specify disk (enter its number): ^D

Vemos los targets descubiertos:

# iscsiadm list target
Target: iqn.2006-06.com.alegrome:storage.lvm
        Alias: -
        TPGT: 1
        ISID: 4000002a0000
        Connections: 1
...

Y mas informacion sobre cada uno:

# iscsiadm list target-param -v iqn.2006-06.com.alegrome:storage.lvm
Target: iqn.2006-06.com.alegrome:storage.lvm
        Alias: -
        Bi-directional Authentication: disabled
        Authentication Type: NONE
        Login Parameters (Default/Configured):
                Data Sequence In Order: yes/-
                Data PDU In Order: yes/-
                Default Time To Retain: 20/-
                Default Time To Wait: 2/-
                Error Recovery Level: 0/-
                First Burst Length: 65536/-
                Immediate Data: yes/-
                Initial Ready To Transfer (R2T): yes/-
                Max Burst Length: 262144/-
                Max Outstanding R2T: 1/-
                Max Receive Data Segment Length: 8192/-
                Max Connections: 1/-
                Header Digest: NONE/-
                Data Digest: NONE/-
        Configured Sessions: 1

Por otra parte en la Linux, vemos la session iSCSI:

alegrome# cat  /proc/net/iet/session
tid:1 name:iqn.2006-06.com.alegrome:storage.lvm
        sid:281475681353792 initiator:iqn.1986-03.com.sun:01:0800209efab9.46bc3c8b
                cid:0 ip:192.168.0.30 state:active hd:none dd:none

Espero que le sirva a alguien ;-)

Parchear una maquina Solaris

He descubierto hace poco el PCA - Patch Check Advanced:

Patch Check Advanced (pca) generates lists of installed and missing patches for Sun Solaris systems and optionally downloads patches. It resolves dependencies between patches and installs them in correct order. It can be the only tool you ever need for patch management on a single machine or a complete network. Just one perl script, it doesn’t need compilation nor installation, and it doesn’t need root permissions to run. It works on all versions of Solaris, both SPARC and x86.

Este script (de perl) utiliza wget para bajar los parches a instalar, por lo que si no lo hemos instalado, podemos instalar los siguientes pkgs: SUNWwgetr y SUNWwgetu.

Bajamos el pca:

    # mkdir /var/crash/parches
    # cd /var/crash/parches
    # PATH=$PATH:/usr/sfw/bin
    # wget http://www.par.univie.ac.at/solaris/pca/pca -O pca
    # chmod +x pca

Buscamos una cuenta de SunSolve necesaria para poder bajarse los parches. Para esto, basta con abrir http://www.bugmenot.com/view/sunsolve.sun.com.

Por ejemplo, podemos usar el siguiente usuario:

Username: bugnotme
Password: notmebug

Lanzamos el pca, primero para que se baje el fichero patchdiag.xref, donde viene la lista de parches disponibles por version de Solaris, con dependencias y descripcion. Al hacer esto, nos dice la lista de parches que deberiamos instalar en el sistema:

# ./pca | tee report.pca
Download xref-file to /var/tmp/patchdiag.xref: done
Using /var/tmp/patchdiag.xref from Aug/30/07
Host: hostname (SunOS 5.10/Generic_118833-33/sparc/sun4u)
List: missing

Patch  IR   CR RSB Age Synopsis
------ -- - -- --- --- -------------------------------------------------------
118371 07 < 10 RS- 137 SunOS 5.10: elfsign patch
118557 07 < 09 ---  80 SunOS 5.10: platform/sun4u/kernel/drv/sparcv9/su patch
118666 06 < 12 -S-  72 JavaSE 5.0: update 12 patch (equivalent to JDK 5.0u12)
118667 06 < 12 -S-  72 JavaSE 5.0: update 12 patch (equivalent to JDK 5.0u12), 64bit
118676 02 < 03 --- 259 SunOS 5.10: patch for Solaris make and sccs utilities
118708 13 < 15 --- 175 SunOS 5.10: Sun XVR-1200 and Sun XVR-600 Graphics Accelerator Patc
118712 10 < 18 R--  66 SunOS 5.10: Sun XVR-100 Graphics Accelerator Patch
[...]

Ahora, podemos bajar los parches (sin instalarlos):

# ./pca -y --user=bugnotme --passwd=notmebug -d --dltries=5
Download Summary: 24 total, 1 successful, 23 skipped, 0 failed

Es importante fijarse bien en la linea de resumen que aparece: a veces no se bajan bien los parches (no es por el PCA, tambien pasa por la web). Si hay algun failed, relanzar hasta que baje todo.

Instalar los parches:

# ./pca -y -i | tee install.pca

Una vez más, es importante fijarse en el log de la instalación, por si hubiera cualquier problema!

Mas información:

Este metodo necesita que la maquina tenga salida a internet, si no directa, al menos a traves de un proxy.

¡Me gusta Solaris!

Los que me conocen saben que nunca he sido un gran fan de Solaris. Siempre he estado mucho mas del lado HP-UX.

Hace unos dias (o semanas, ya ni me acuerdo), instalé Solaris Express Developper Edition (OpenSolaris, lo que un dia sera Solaris 11) en una Ultra-5 que tengo en casa y la verdad es que propone muchas cosas novedosas e interesantes.

Lo primero que me ha molado es que en una maquina tan poco potente como mi Ultra-5, con sus escasos 256 MB de RAM y 4GB de disco duro, haya podido instalar esta ultimisima version de Solaris.

De hecho instale lo minimo — Core Install (no necesito ni Gnome, ni entornos graficos, ni todo el software de Sun (Directory,…)) — y he ido añadiendo algunos pocos paquetes para poder probar funcionalidades nuevas de este OS.

Como con 4 GB no me da para mucho, he exportado algunos LVoles de mi Linux (el cual tiene 460 GB de disco) por iSCSI y asi poder darle a mi Solaris unos discos iSCSI y poder jugar con ZFS.

He estado probando un poco tambien el tema de las zonas. Me falta de momento experimentar con el tema de los Resource Pool de los containers.

Tambien he instalado el Solaris Cluster Express, montando un cluster de un solo nodo, con 2 zonas (curioso!, leer mas aqui). Ahora que me han dado una segunda Ultra-5 (gracias Carlos), a ver si consigo montar un cluster de 2 nodos!

Asi que, lo reconozco, me esta empezando a gustar Solaris (version 10 para arriba).

Podeis leer algunos articulos que escribo sobre mis experimentos con Solaris en este wiki del que formo parte: Kernelpanic.

Rename a Solaris zone

I’ve written a small article at Kernelpanic about renaming a Solaris zone.

Actually it’s not only about renaming the zone itself (strictly speaking), but also all this related things:

  • the zonepath,
  • the subjacent ZFS filesystem name and mountpoint,
  • the zone’s hostname.

Also, I treat a case where the zone is part of a Solaris Cluster.

Read the article at Kernelpanic.




Close
Powered by ShareThis