Veritas Storage Foundation Symantec Guia de Uso Frecuente




Agregar un nuevo Disco:

vxdisksetup -i

Ejemplo:

/etc/vx/bin/vxdisksetup -i c2t1d0

Ejemplo:

/etc/vx/bin/vxdisksetup -i sena1_4




Estándar del tamaño de la Partición Privada = 2048 blocks. Puede Ser Cambiada de la siguiente manera:

/etc/vx/bin/vxdisksetup -i c2t1d0 privlen=2500k


# vxdisksetup -i c#t#d# privlen=1m



Quitar Discos:


vxdiskunsetup [-C] disk_device_address

Ejemplo:

/etc/vx/bin/vxdiskunsetup -C c0t4d0


Nombre Estándar de un Volumen:


vol01


Nombre por default de un plex:


volname-##


Cuales son los paquetes mínimos para que funcione Veritas Storage Foundation

lic & vxvm

Cual es el Valor Estándar de la ráfaga de Copia en un Volumen Raid 5?


16K (raid5_stripeunit=width)



Que Comando Importa, borra y renombra un Diskgroup:

vxdg -n -C import

Comandos Para Aumentar y Disminuir el tamaño de un volumen.

vxassist growto

vxassist growby

vxassist maxgrow

vxassist shrinkby

vxassist shrinkto


Comando para Deportar un Diskgroup y cambiar el nombre:

vxdg -n deport gallia



Como cambiar la versión de un DiskGroup


vxdg -T 50 upgrade rootdg

vxdg list rootdg



Como es el nombre de los Unix group para vmsa administrators?

vrtsadm



Como crear un volumen concatenado:

vxassist -g rootdg make vol01 10m layout=nostripe


Como Crear un DiskGroup:

vxdg init gallia c0t1d0


Donde Conseguir los Logs:


root@nestorix # ls -l /var/opt/vmsa/logs/

total 6

-rw-r--r-- 1 root root 104 Oct 24 18:25 access

-rw-r--r-- 1 root root 946 Oct 24 23:34 command

-rw-r--r-- 1 root root 933 Oct 27 10:48 server.log



Cual es el valor Estadar del Stripe:


stripe unit width= 128 blocks = 64KB

columns=#disks



Como Buscar los Discos por todas las controladoras SCSI:

vxdiskconfig

root@nestorix # vxdiskconfig



This command may take a few minutes to complete execution



Executing Solaris command: drvconfig (part 1 of 4) at 13:44:36 MET



Executing Solaris command: disks (part 2 of 4) at 13:44:50 MET



Executing Solaris command: devlinks (part 3 of 4) at 13:44:52 MET



Executing VxVM command: vxdctl enable (part 4 of 4) at 13:44:54 MET



Command completed at 13:44:55 MET

root@nestorix # which vxdiskconfig

/usr/sbin/vxdiskconfig

root@nestorix # file /usr/sbin/vxdiskconfig

/usr/sbin/vxdiskconfig: executable /sbin/sh script





Como Monitorear el Task Process:

vxtask monitor 166




Como Colocar una política de Round Robin:

vxvol rdpol round vol01


Como Colocar una política de prefer a un Volumen:

vxvol rdpol prefer vol02 vol02-01

volnm plex



Como Crear un Mirror con 3 Submirror:

vxassist -o ordered make mirstrvol 10g layout=mirror-stripe \

ncol=3 disk01 disk02 disk03 disk04 disk05 disk06



vxassist make vol01 1m layout=mirror nmirror=3





Como Remover un Disk de un DiskGroup:

vxdg -g rootdg rmdisk c0t1d0




Como Cambiar el Tamaño de un FS

fsadm -b 10m /opt/v01

- works even on a mounted fs

- increase does not work if fs 100% full ;-( errno 28 )



Como Crear Un Snap:

mount -F vxfs -o snapof=/dev/vx/dsk/rootdg/vol01 \ # vol to be snapped.

/dev/vx/dsk/rootdg/vol02 \ # backing store

/mnt # mtpt of snap


Simular la creación de un FS:


mkfs -F vxfs -oN,... /dev/vx/rdsk/rootdg/vol01



Colocar el Logsize a un FS:


mkfs -F vxfs -o logsize=n blocks

ERROR: logsize must be >= 256 and <= 16384





Colocar una etiqueta de reusable a un Diskgroup:

vxprint -mpvshr -g diskgroup_name


Como borrar un Volumen:


vxedit -rf rm vol01

vxassist remove volume vol01



Como remover un Plex de un Mirror:

vxplex dis vol01-02

vxedit -rf rm vol01-02

- dis-associates plex "vol01-02" with the vol01 volume.

- removes plex "vol01-02" and associated subdisk.



Otra manera:

vxassist remove mirror



Remover Todos los Disk de un DiskGroup:

vxdg destroy test

MPxIO de Solaris: como eliminar una LUN del sistema





Cuando se tiene configurado MPxIO y se desea eliminar una LUN del sistema, hay que tener presente que si la LUN no es eliminada del Traffic Manager (MPxIO), después pueden ocurrir cosas raras (personalmente, he presentado nuevas LUN y parecen ser idénticas a la eliminada, tamaños distintos, etc) que sólo se solucionan rebooteando el servidor (lo cual no es la idea).



El proceso de eliminar una LUN del sistema es simple, pero debe realizarse en orden. Básicamente, para eliminar una(s) LUN(s) del sistema se debe hacer lo siguiente:



1) Desmontar todos los filesystem que dependen de la(s) LUN(s) a eliminar (sacar de vfstab, etc)



2) Deportar diskgroup al que pertenece(n) la(s) LUN(s) o eliminar los volúmenes correspondientes (en el caso de VERITAS Volume Manager). Si es Solstice Disk Suite (o Solaris Volume Manager) eliminar los metadevices correspondientes.



3) Despresentar las LUNs desde el Storage (o desconectar discos en el caso de que sea una caja de discos sin inteligencia). La idea es que bajo MPxIO los discos queden en la condición unusable (esto se ve con el comando cfgadm -al -o show_FCP_dev en Solaris 8 y con cfgadm -al -o show_SCSI_LUN en Solaris 10, aunque el primer caso a mi me ha funcionado tanto en Solaris 8 como 10).



4) cfgadm no permite eliminar una única LUN del sistema, cuando el Storage conectado no es Sun (por lo menos eso me ha pasado con los StorageWorks HP EVA8000). Por esta razón, los discos se dejan en la condición unusable, para después poder eliminarlos con el siguiente comando (se debe hacer por cada PORT del Controlador del Storage por donde se ve el disco, de acuerdo a la salida del cfgadm -al -o show_FCP_dev):

cfgadm .c unconfigure -o unusable_FCP_dev DEVICE, donde DEVICE corresponde a cada puerto del controlador.



EJEMPLO

En este ejemplo, se tiene un servidor SunFire v880/Solaris 8/2 x HBA Sun/HP StorageWorks EVA8000/MPxIO/VERITAS Volume Manager 4.0.



En este punto ya se desmontaron filesystem, se sacaron de Volume Manager y se despresentaron las LUN desde el Storage.



Con el comando cfgadm -al -o show_FCP_dev debemos ver los discos en Condicion unusable:



# cfgadm -al -o show_FCP_dev

Ap_Id Type Receptacle Occupant Condition

c1 fc-private connected configured unknown

c1::21000004cf16426e,0 disk connected configured unknown

c1::21000004cf9b566c,0 disk connected configured unknown

c1::21000004cf9b6102,0 disk connected configured unknown

c1::21000004cf9b6107,0 disk connected configured unknown

c1::21000004cf9b6120,0 disk connected configured unknown

c1::21000004cfb47161,0 disk connected configured unknown

c1::508002000019f829 ESI connected configured unknown

c10 fc-fabric connected configured unknown

c10::50001fe150020dd9,0 array-ctrl connected unconfigured unknown

c10::50001fe150020dd9,1 disk connected configured unknown

c10::50001fe150020dd9,2 disk connected configured unknown

c10::50001fe150020dd9,3 disk connected configured unknown

c10::50001fe150020dd9,4 unavailable connected configured unusable

c10::50001fe150020ddb,0 array-ctrl connected unconfigured unknown

c10::50001fe150020ddb,1 disk connected configured unknown

c10::50001fe150020ddb,2 disk connected configured unknown

c10::50001fe150020ddb,3 disk connected configured unknown

c10::50001fe150020ddb,4 unavailable connected configured unusable

c10::50001fe150020ddd,0 array-ctrl connected unconfigured unknown

c10::50001fe150020ddd,1 disk connected configured unknown

c10::50001fe150020ddd,2 disk connected configured unknown

c10::50001fe150020ddd,3 disk connected configured unknown

c10::50001fe150020ddd,4 unavailable connected configured unusable

c10::50001fe150020ddf,0 array-ctrl connected unconfigured unknown

c10::50001fe150020ddf,1 disk connected configured unknown

c10::50001fe150020ddf,2 disk connected configured unknown

c10::50001fe150020ddf,3 disk connected configured unknown

c10::50001fe150020ddf,4 unavailable connected configured unusable

c11 fc-fabric connected configured unknown

c11::50001fe150020dd8,0 array-ctrl connected unconfigured unknown

c11::50001fe150020dd8,1 disk connected configured unknown

c11::50001fe150020dd8,2 disk connected configured unknown

c11::50001fe150020dd8,3 disk connected configured unknown

c11::50001fe150020dd8,4 unavailable connected configured unusable

c11::50001fe150020dda,0 array-ctrl connected unconfigured unknown

c11::50001fe150020dda,1 disk connected configured unknown

c11::50001fe150020dda,2 disk connected configured unknown

c11::50001fe150020dda,3 disk connected configured unknown

c11::50001fe150020dda,4 unavailable connected configured unusable

c11::50001fe150020ddc,0 array-ctrl connected unconfigured unknown

c11::50001fe150020ddc,1 disk connected configured unknown

c11::50001fe150020ddc,2 disk connected configured unknown

c11::50001fe150020ddc,3 disk connected configured unknown

c11::50001fe150020ddc,4 unavailable connected configured unusable

c11::50001fe150020dde,0 array-ctrl connected unconfigured unknown

c11::50001fe150020dde,1 disk connected configured unknown

c11::50001fe150020dde,2 disk connected configured unknown

c11::50001fe150020dde,3 disk connected configured unknown

c11::50001fe150020dde,4 unavailable connected configured unusable



Para explicar un poco la salida del comando anterior, tenemos lo siguiente:

- Este servidor tiene 3 controladoras de Fibra, que son c1 (controladora de discos internos de fibra), c10 y c11 (las 2 tarjetas HBA conectadas al EVA8000)

- El Storage EVA8K tiene 2 controladores y cada controlador tiene 4 Puertos. Esto implica que cada LUN la veré por 8 PATH distintos (2 Controllers * 4 Ports = 8 PATH).

- Por cada HBA se ve un controlador (los 4 PORTS de un controlador). Debajo de cada Puerto (array-ctrl) aparecen las LUN que están presentadas al servidor (el número de la LUN es el que está después de la ",").



En este caso, se ha despresentado una LUN, la LUN 4. Se puede apreciar que en todos los Puertos aparece la LUN ",4" en Condicion unusable. Hay que eliminarla una por una (8 veces) de cada Puerto. En el comando para eliminar, se debe poner el WWPN de cada Puerto (todo el chorizo hasta antes de la ","). De esta manera, el cfgadm va a eliminar todas los dispositivos que estén en estado unusable del Controlador indicado.



Para hacer todo en un sólo paso y poder automatizar el proceso de eliminación, hice un "script" que hace todo (pero todo lo que tiene que ver con MPxIO, no desmonta ni deporta grupos de discos):



cfgadm -al -o show_FCP_dev | grep unusable | awk '{print $1}' | while read t; do device=`echo $t | cut -d"," -f1`; cfgadm -c unconfigure -o unusable_FCP_dev $device; done

Pequeña guia de VI


Forward One Character —-> —-> [ESC]-l
Backward One Character —-> [ESC]-h
Delete One Character —-> [ESC]-x
Replace One Character —-> [ESC]-r
Forward End of Word —-> [ESC]-e
Backward Beginning of Word —-> [ESC]-b
Delete to End of Line —-> [ESC]-D
Insert Text (current space) —-> [ESC]-i
Insert Text (adjacent space) —-> [ESC]-a
Move Cursor to Beginning of Line —-> [ESC]-^
Move Cursor to End of Line —-> [ESC]-$


Previous Command —-> [ESC]-k Use this key combination to access your previous command
Next Command —-> [ESC]-j Use this key combination to access your next command (if applicable)
Filename Completion —-> [ESC]-\ Use this key combination to complete a filename, or partial portion thereof
Filename Check —-> [ESC]-= Use this key combination to show which files would complete the command at this point

Solaris ZFS y Zonas



The following is a simple example of creating a ZFS filesystem and using it to hold a newly-created Solaris Zone (Solaris Container). Zones are in Solaris 10 now. ZFS is a new filesystem in OpenSolaris that allows for large, more reliable filesystems. Tke three key advantages are:

* Simple administration
* Data integrity (64-bit checksums on data)
* Large capacity format for future growth (2**128 512-byte block files). That's 256 quadrillion zettabytes.

Other features are:

* Filesystems built on virtual storage "pools"
* Copy-on-write removes need for recovery (no fsck)
* Dynamic striping and multiple block sizes optimizes throughput (512 to 128K)
* Optional compression
* No modifications needed for apps

ZFS software is in packages SUNWzfsr and SUNWzfsu.
Create a ZFS Pool

First, you need a virtual device for ZFS. Normally this would be raw disk (or raw disk slice, if you prefer). However, for testing/demonstration, I'll create a regular file (this takes a few minutes):

# mkfile 5g /virtualDeviceForZFS
4m12.95s

Now I create a "ZFS Storage Pool" for one or more ZFS filesystems:

# zpool create poolForZones /virtualDeviceForZFS
# zpool list
NAME SIZE USED AVAIL CAP HEALTH ALTROOT
poolForZones 4.97G 32.5K 4.97G 0% ONLINE

To create a mirrored-pool use the keyword "pool" and specify two virtual devices.
Create a ZFS Filesystem

Now, I'll create a ZFS filesystem using the ZFS pool I just created:

# zfs create poolForZones/twilightZone
# zfs set mountpoint=/twilightZone poolForZones/twilightZone
# zpool status -z
pool: poolForZones
state: ONLINE
scrub: none requested
config:

NAME STATE READ WRITE CKSUM
poolForZones ONLINE 0 0 0
/virtualDeviceForZFS ONLINE 0 0 0

# mount |grep twilightZone
/twilightZone on poolForZones/twilightZone read/write/setuid/devices/exec/atime/dev=3f50004 on Mon Nov 14 12:34:37 2005
# df -k /twilightZone
Filesystem kbytes used avail capacity Mounted on
poolForZones/twilightZone
5169408 8 5169341 1% /twilightZone
# ls -l /twilightZone
total 0

Note that /twilightZone is not in /etc/vfstab. Mounting is done automatically at boot time by ZFS:

# grep /twilightZone /etc/vfstab
#

If you want to allow the filesystem to be managed inside the zone, use the zfs zoned=on option when creating or modifying the filesystem.
Create a Solaris Zone

Use zonecfg to setup your zone:

# zonecfg -z twilightZone
twilightZone: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:twilightZone> create
zonecfg:twilightZone> set zonepath=/twilightZone
zonecfg:twilightZone> set autoboot=true
zonecfg:twilightZone> add net
zonecfg:twilightZone:net> set address=10.140.1.25
zonecfg:twilightZone:net> set physical=ce0
zonecfg:twilightZone:net> end
zonecfg:twilightZone> verify
zonecfg:twilightZone> commit
zonecfg:twilightZone> exit

Install a Solaris Zone

Now install packages to your Solaris Zone:

# zoneadm -z twilightZone install
/twilightZone must not be group readable.
/twilightZone must not be group executable.
/twilightZone must not be world readable.
/twilightZone must not be world executable.
could not verify zonepath /twilightZone because of the above errors.
zoneadm: zone twilightZone failed to verify

Ooops. We need to set proper permissions. The directory must not be world or group read, write, or execute:

# ls -ld /twilightZone
drwxr-xr-x 2 root sys 2 Nov 14 12:34 /twilightZone
# chmod go-rxw /twilightZone
# ls -ld /twilightZone
drwx------ 2 root sys 2 Nov 14 12:34 /twilightZone

Try install with zoneadm again. This takes several minutes:

# zoneadm -z twilightZone install
Preparing to install zone .
Creating list of files to copy from the global zone.
Copying <2808> files to the zone.
Initializing zone product registry.
Determining zone package initialization order.
Preparing to initialize <946> packages on the zone.
Initializing package <252> of <946>: percent complete: 26%
. . .
Initialized <946> packages on zone.
Zone is initialized.
The file
contains a log of the zone installation.

Later, if you wish to halt, uninstall, or delete a zone, use these commands, respectively:

zonecfg -z twilightZone halt
zonecfg -z twilightZone uninstall
zonecfg -z twilightZone delete

By default zonecfg creates a "sparse" zone--that is read-only files are shared from the "global" zone. This saves a lot of space as shown below: only 68 MB is used (as opposed to the 4GB or so for the global zone):

# df -k /twilightZone
Filesystem kbytes used avail capacity Mounted on
poolForZones/twilightZone
5169408 68508 5100754 2% /twilightZone

If a "sparse" zone isn't desired, use "create -b" instead of "create" in zonecfg above. This prevents the new zone from "inheriting" packages from the global zone. This is called a "whole root" configuration.

The zone has been created, but it won't show up until after the initial boot:

# zoneadm list -v
ID NAME STATUS PATH
0 global running /

Boot and Configure a Solaris Zone

Lets boot the zone and login to the console with zoneadm and zlogin. The initial boot prompts for basic configuration information (language, locale, terminal, hostname, name service, time zone, and root password):

# zoneadm -z twilightZone boot
# zlogin -C twilightZone
[Connected to zone 'twilightZone' console]
Loading smf(5) service descriptions: 1/108

twilightZone2 console login: root

Desmontar /opt cuanto esta busy UNIX


# cd /
# umount /opt (device busy)

Determinar que procesos esta usando /opt
# cd /
# fuser -cu /opt
# kill -9 PID1 PID2
# umount /opt

Alternativa para desmontar un fs
# cd /
# fuser -ck /opt
# umount /opt

Forzar:
# cd /
# umount -f /opt

IBIS: Como usar en Solaris



1) Mount the cdrom
2) cd /cdrom/eis-dvd/sun/install
3) . ./profile-EIS
4) ./setup-standard.sh
5) cd /cdrom/eis-dvd/sun/patch
6) goto the desired directory where the patches are available
7) unpack_patches
8) provide the path for unpacking for ex : /var/sun
9) init S
10) cd /var/sun
11) ./install_all_patches

Comandos de Hardware Solaris



format = slice/partition disk, surface scan, etc. Linux/DOS call this fdisk.

Note that under part submenu, use "label" to save changes to the partition table to disk.

Use "volname" to add a name to the disk volume (shown in format disk list)



prtvtoc : print the volume table of content (vtoc, ie the partition table + disk geometry data)



swap -l list swap info

swap -a /dev/dsk/c... add slide as swap

swap -d /dev/dsk/c... delete slide as swap







drvconfig; disks : create entries in /dev/dsk/c*t* ...

drvconfig; tapes : create entries for backup tape drives in /dev/rmt

: sometime drvcnofig cause problem, device config need boot -r to fix.

devfsadm : "new" solaris command for scanning new storage devices.





drvconfig; tapes; devlinks : tell system to reconfigure for new tape drive, eg /dev/rmt/0cbn etc







Fiber Channel commands:





cfgadm -c configure [c3] # configure controller 3 (HBA), scan san for LUN

# run devfsadm if needed, then see new "disks" in format



cfgadm -c unconfigure c3 # remove all config of the given controller





cfgadm -c unconfigure c0::dsk/c0t11d0 # unconfigure internal scsi disk (eg E250)

# so that dead disk no longer show up in "format"

# but still shows up in cfgadm -al

# (may need a reconfigure reboot to completely clear it)

cfgadm -c unconfigure c3::wwn # remove spurious entries in /etc/cfg/fp/fabric_WWN_map devices.

# such device cause boot warnings if left in there.

cfgadm -o force_update -c unconfigure cX::wwn # forceful manner of above

cfgadm -c unconfigure -o unusable_FCP_dev cX:wwn







luxadm fcode_download -p

display HBA firmware version and driver/path info.

luxadm is probably only for 880 w/ sse dev, and some sun array products.



luxadm probe

display WWN of fc dev



luxadm display [logical_dev]

Crear Mirror del Sistema Operativo Solaris



Primero Copiar la tabla de particiones


prtvtoc /dev/rdsk/c0t0d0s2 > vtoc.c0t0d0s2

fmthard -s vtoc.c0t0d0s2 /dev/rdsk/c0t1d0s2



Añadir dos copias de la base de datos en el slide 7

metadb -a -f -c 2 c0t0d0s7 c0t1d0s7





output of metadb:

flags first blk block count

a m p luo 16 1034 /dev/dsk/c0t0d0s7

a p luo 1050 1034 /dev/dsk/c0t0d0s7

a p luo 16 1034 /dev/dsk/c0t1d0s7

a p luo 1050 1034 /dev/dsk/c0t1d0s7



Mapa de metadevice


###

### metadevice mapping to physical devices

### disk in tag 0 and 1 (9 gigs) pair

###

### orig new mirror

### root d0 submirrors: d10 d20 : c0t0d0s0 c0t1d0s0

### swap d1 submirrors: d11 d21 : c0t0d0s1 c0t1d0s1

### usr d4 submirrors: d14 d24 : c0t0d0s4 c0t1d0s4

### var d5 submirrors: d15 d25 : c0t0d0s5 c0t1d0s5

### u01 d6 submirrors: d16 d26 : c0t0d0s6 c0t1d0s6

###





# Crear los discos que van a ser replicas del sistema operativo

# boot disk c0t0 ::

metainit -f d10 1 1 c0t0d0s0 # init submirror of /

metainit -f d11 1 1 c0t0d0s1 # swap

metainit -f d14 1 1 c0t0d0s4 # /usr

metainit -f d15 1 1 c0t0d0s5 # /var

metainit -f d16 1 1 c0t0d0s6 # /oracle/u01



Crear los mirror del sistema operativo

metainit d0 -m d10 # mountable /

metainit d1 -m d11 # usable swap

metainit d4 -m d14 # mountable /usr

metainit d5 -m d15 # mountable /var

metainit d6 -m d16 # mountable /u01



Ejecuta el commando metaroot que actualiza la el /etc/vfstab y /etc/system

metaroot d0 # activate SVM for boot partition,

# add one entry to vfstab for /

# update /etc/system, etc



Actualizar el /etc/vfstab:

vi /etc/vfstab # update mount device to use /dev/md/... ::







#device device mount FS fsck mount mount

#to mount to fsck point type pass at boot options

fd - /dev/fd fd - no -

/proc - /proc proc - no -

/dev/dsk/md/d1 - - swap - no -

/dev/dsk/md/d0 /dev/rdsk/md/d0 / ufs 1 no logging

/dev/dsk/md/d4 /dev/rdsk/md/d4 /usr ufs 1 no logging

/dev/dsk/md/d5 /dev/rdsk/md/d5 /var ufs 1 no logging

/dev/dsk/md/d6 /dev/rdsk/md/d6 /u01 ufs 1 no logging

...

swap - /tmp tmpfs - yes -





(double check path is /dev/*dsk/md/...



Sincronizar los fs y reboot
sync; sync; # optional, flush all data to disk

lockfs -fa # lock fs, recommended

reboot




Crear los segundos submirror
# create the additional submirror components of all slides, use disk in c0t1

metainit -f d20 1 1 c0t1d0s0 # addtional mirror of /

metainit -f d21 1 1 c0t1d0s1 # additiional mirror for swap

metainit -f d24 1 1 c0t1d0s4 # additiional mirror for /usr

metainit -f d25 1 1 c0t1d0s5 # additiional mirror for /var

metainit -f d26 1 1 c0t1d0s6 # additiional mirror for /u01



Añadir los segundos submirror
# add the additional mirrors to be active:

metattach d0 d20 # activate mirror of / with new slide from d20

metattach d1 d21 # activate mirror of swap

metattach d4 d24 # activate mirror of /usr

metattach d5 d25 # activate mirror of /var

metattach d6 d26 # activate mirror of /u01



Validar con el metastat el estado del proceso de sincronización
# the above cmd return right away, use metastat to monitor sync process

# or metatool for gui monitor/admin tool.




# review /etc/lvm/md.tab



output of metastat -p:

d0 -m d10 d20 1

d10 1 1 c0t0d0s0

d20 1 1 c0t1d0s0

d1 -m d11 d21 1

d11 1 1 c0t0d0s1

d21 1 1 c0t1d0s1

d4 -m d14 d24 1

d14 1 1 c0t0d0s4

d24 1 1 c0t1d0s4

d5 -m d15 d25 1

d15 1 1 c0t0d0s5

d25 1 1 c0t1d0s5

d6 -m d16 d26 1

d16 1 1 c0t0d0s6

d26 1 1 c0t1d0s6




Boot de neuvo para validar estabilidad
When all done, reboot again just to be sure all is okay.

These errors from boot are ok:



Boot device: disk:a File and args:

SunOS Release 5.8 Version Generic_108528-16 64-bit

Copyright 1983-2001 Sun Microsystems, Inc. All rights reserved.

WARNING: forceload of misc/md_trans failed

WARNING: forceload of misc/md_raid failed

WARNING: forceload of misc/md_hotspares failed

WARNING: forceload of misc/md_sp failed

configuring IPv4 interfaces: hme0.

Hostname: cqdb

The system is coming up. Please wait.

checking ufs filesystems

/dev/md/rdsk/d6: is logging.

[...]

volume management starting.

The system is ready.





If these errors are annoying, update /etc/system and comment out the

forceload of the unecessary components. The problem with such mods is that

should there be a need of raid 5 device down the road, and forget to re-enable

these, then there maybe some hair pulling in finding out the error :)



----



Actualizar el OBP para que busque los dos submirror en caso de fallas:
Optional update to OBP to allow easier booting,

should one of the boot disk fail, this allows one to do:

boot rootmirror





Save the following content to a file, eg nvramrc.cmd

devalias rootdisk /pci@1f,4000/scsi@3/disk@0,0:a

devalias rootmirror /pci@1f,4000/scsi@3/disk@1,0:a



eeprom "boot-device=rootdisk rootmirror"

eeprom "use-nvramrc?=true"

eeprom "nvramrc=`cat nvramrc.cmd`"



eeprom boot-device # read back programmed content

eeprom nvramrc



Completado.

Lista de Commandos de Solaris por categorias




Mirror Disk Solaris

metastat

Debugging

Trace doing of given command ( useful debugging )
truss executable

Using multiple windows, this can be used to trace setuid/setgid programs
truss -f -p



Arp, ethernet trouble shooting

Shows the ethernet address arp table
arp -a .

Delete a stale ethernet entry for host myhost
arp -d myhost



Disk Commands

Reports disk space used in Kilobytes
du -k .

Reports only total disk space used in Kilobytes
du -sk .

Tells you how big the /var files are in reverse order
du -ad /var | sort -nr

Format diskette
fdformat -d -U

Command to display drives statistics
/usr/bin/iostat -E

Mount an ISO 9660 CDROM
/bin/mount -F hsfs -o ro /dev/sr0 /cdrom

Disk geometry and partitioning info
prtvtoc /dev/rdsk/c0t0d0s2

How much space is used by users in kilobytes
quot -af



Driver Parameters

Shows IP variables in the kernel
ndd /dev/ip \?

Tells you if forwarding is on (=1)
ndd /dev/ip ip_forwarding

Enables IP forwarding between interfaces
ndd -set /dev/ip ip_forwarding 1



File Manipulation

Converts DOS file formats to Unix
dos2unix | -ascii

Split files into pieces
split

Search and Replace text in vi
[vi] : %s/existing/new/g

Set line numbers in vi
[vi] :set nu

Set tab stops in vi
[vi] :set ts=[num]



File System

Zero's out the file without breaking pipe
cat /dev/null > filename

Make a mirror image of your boot disk
dd if=/dev/rdsk/... of=/dev/rdsk/... bs=4096

Unmount all file systems in disk group dg
df -k | grep dg| awk '{print $6}' |xargs -n 1 umount

Check a UFS filesystem on c0t0d0s0
fsck -F ufs /dev/rdsk/c0t0d0s0

Check answering yes to all questions
fsck -F ufs -y /dev/rdsk/c0t0d0s0

Check using an alternate super block
fsck -F ufs -o b=97472 /dev/rdsk/c0t0d0s0

Unpack .tar.gz files in place
gzip -dc file1.tar.gz | tar xf -

Creating hard links and soft links
ln [-fhns]

File sizes of current directory
ls -la | awk '{ print $5," ",$9 }' | sort -rn

Mount DOS fdisk partition from Solaris
mount -f pcfs /dev/dsk/c0d0p1 /export/dos

Used to remount root to make it writeable
mount -F ufs -o rw,remount /

Re-mount the ro file system rw and turn on ufs logging
mount -o remount,logging /spare

Create a tape (tar) archive
tar cvf filename.tar

Extract a tape (tar) archive
tar xvf filename.tar

Recursively copy files and their permissions
tar cf - . | (cd /newdir ; tar xf -)

Syncs File Systems and Reboots systems fast
/sbin/uadmin x x

Extract the patch_file that is a compressed tar file
zcat


File Transfer

Undocumented Feature of FTP
put "| tar cf - ." filename.tar

Fast alternative to cp -pr
find . -depth | cpio -pdmv /path/tobe/copied/to

Transferring large numbers of files within the same ftp control session
sendport



General

Create windex databases for man page directories
/usr/bin/catman -w

List out mail headers for specified user
mailx -H -u

Set file-completion for csh
set filec



Hardware

Verify reconfigurable hardware resources
cfgadm

Print M64 hardware configuration
m64config -prconf

Sets the screen depth of your M64 graphics accelerator
m64config -depth 8|24

Change the resolution of your M64 graphics accelerator
m64config -res 'video_mode'



Kernel

Display kernel module information
/usr/sbin/modinfo

Load a kernel module
/usr/sbin/modload

Unload a kernel module
/usr/sbin/modunload -i

Tuneable kernel parameters
nm -x /dev/ksyms | grep OBJ | more

Show system kernal tunable details
/usr/sbin/sysdef



Memory

Display Memory Size
prtconf | grep "Memory size"



Network Information

Prints ARP table in cache with IP and MAC address
ndd /dev/arp arp_cache_report

Displays number active established connections to the localhost
netstat -a | grep EST | wc -l

Undocumented netstat command
netstat -k hme0

Show the TCP/IP network interfaces
netstat -i

Similar to arp -a without name resolution
netstat -np

Show network route table
netstat -r

Displays routing information but bypasses hostname lookup.
netstat -rn

Show the state of all sockets
netstat -a | more

Follow the route to the ipaddress
traceroute



Network/Tuning

Change MTU of interface
ifconfig eth0 mtu 1500

Add an Interface
ifconfig eth0 10.1.1.1 netmask 255.255.255.255

Virtual Interfaces
/sbin/ifconfig hme0:1 inet 10.210.xx.xxx netmask 255.255.0.0 broadcast 10.210.xxx.xxx

Bring virtual interface up
/sbin/ifconfig hme0:1 up

Nailling to 100Mbps
/usr/sbin/ndd -set /dev/hme adv_100fdx_cap 1

To set more than 256 virtual ip addresses.
ndd -set /dev/ip ip_addrs_per_if 1-8192

Increase TCP-transmitbuffers
ndd -set /dev/tcp tcp_xmit_hiwat 65535

Increase TCP-receivebuffers
ndd -set /dev/tcp tcp_recv_hiwat 65535



Processes

Processes that are running from /var
fuser -uc /var

HUP any related process in one step
kill -HUP `ps -ef | grep [p]roccess | awk '{print $2}'`

Shows processes' current open files
pfiles

Kill a process by name
pkill -n

pkill for solaris 2.6
kill `ps -ef | grep program_name | grep -v grep | cut -f8 -d ' '`

An alternative for top command
prstat -a

Displays CPU % usage for each process in ascending order
/usr/ucb/ps -aux | more

Gives the full listing of the process (long listing)
/usr/ucb/ps -auxww | grep

Creates list of running PID by
ps -ef | grep -i | awk '{ print $2 }'

Gives you a list of any process with CPU time more than 0:00
ps -ef | grep -v "0:00" | more

Show all processes running
ps -ef | more

See which instances of Oracle are running
ps -fu oracle|grep pmon

Print the parent/child process 'tree' of a process
/usr/proc/bin/ptree

Print the working directory of a process
/usr/proc/bin/pwdx

Returns the process utilizing the most cpu and quits
top -b 1



Resource Management

List the dynamic dependencies of executable files
/usr/bin/ldd [filename]

Report address space map a process occupies
/usr/proc/bin/pmap pid



Route Configuration

Adds route to 128.50 network via 128.50.1.6
route add net 128.50.0.0 128.50.1.6 1

Deletes route to 128.50 network
route delete net 128.50.0.0 128.50.1.6

Which interface will be used to contact hostname
route get [hostname]

Monitors traffic to the routes
route monitor

Removes all entries in the route table
route flush



Searching Items

Search for multiple patterns within the same file
egrep "patterna|patternb"

Find a string in files starting cwd
find . -exec egrep -li "str" {} \;

Find without traversing NFS mounted file systems
find / -fstype nfs -prune -o fstype autofs -prune -o -name filename -print

Find recently modified files
find . -mtime -1 -type f

Find files modified during the past # of days
find / -mtime <# of days>

Finds and removes files older than specified
find . ! -mtime - | /usr/bin/xargs rm -rf

Find files containing within directory tree
find . -type f -exec grep "" {} \; -print

Recursive grep on files
find . -type f -print | xargs grep -i [PATTERN]

Find all files owned by
find / -user

Fast way to search for files
find / | grep [file mask]

Recursively finds files by name and automatically removes them
find -name "" -exec rm -rf {} \;

Find large files held open by a process
find /proc/fd -links 0 -type f -size +2000 -ls

Fast alternative to find
ls -lR | grep



Security

Stops users logging in
echo 'Please go away' > /etc/nologin

Find all your writable directories
find / -perm -0777 -type d -ls

Find all SGID files
find / -type f -perm -2000 -print

find all SUID files
find / -type f -perm -4000 -print



Set Terminal Options

Sets the Backspace Key to erase
stty erase ^H

Sets the Delete Key to erase
stty erase ^?

Rreset terminal after viewing a binary file.
stty sane

Reset to standard char set
tput rmacs



Snoop Your Network

Watch all network packets on device pcelx0
snoop -d pcelx0

Saves packets from device pcelx0 to a file
snoop -o /tmp/mylog pcelx0

View packets from logfile between host1 & host2
snoop -i /tmp/mylog host1 host2

Show all info on packet number 101 from a logfile
snoop -i /tmp/mylog -v -p101

Write a new logfile with all host1 packets
snoop -i /tmp/mylog -o /tmp/newlog host1

Return the first 120 bytes in the packet header
snoop -s 120

Capture arp broadcasts on your network
snoop -v arp



Swap File

Makes a 10 Megabyte swapfile in /export/disk
mkfile -v 10m /export/disk1/myswap

Makes an empty 10 Megabyte swapfile
mkfile -nv 10m /export/disk1/myswap



Swap Space

List the amount of swap space available, also see mkfile
swap -s

Add a swapfile
swap -a /export/disk1/swapfile

Deletes a swap device
swap -d /dev/dsk/c0t0d0s4

List the current swap devices
swap -l



System Configuration

Changes eeprom autoboot? setting without going to Ok prompt
/usr/sbin/eeprom auto-boot? false

Set the system to perform diagnostics on the next reboot.
/usr/sbin/eeprom diag-switch? true

Check /etc/group file syntax
/usr/sbin/grpck

Check /etc/passwd file syntax
/usr/sbin/pwck

Clear host specific network configuration information
/usr/sbin/sys-unconfig



System Information and Monitoring

Report global core
coreadm -e log

Convert UNIX timestamp to something human-readable
/bin/echo "0t${stamp}>Y\n
Show eeprom parameters
/usr/sbin/eeprom

List most recent attempts to switch to superuser account.
grep "\-root" /var/adm/sulog | grep -v \+ | tail -25

Quickly checkout if machine is in 32 or 64 bit mode
isainfo -bv

Tells who was or still is on the system
last

Log the process ID
logger -i

Show system configuration details
/usr/sbin/prtconf -vp

System Diagnostics
/usr/platform/`/bin/uname -i`/sbin/prtdiag -v

Display number of processors
psrinfo | wc -l

Provides cumulative system report.
sar -A

Manejo de HBA Solaris Lista de Commandos



- Verificar que software para la administración de los discos se esta
utilizando
# modinfo |egrep -i "SunFC|mpxio|scsi_vhci|qlc"

- Determinar que tipo de HBA se estan utilizando
# luxadm qlgc

- Listar los WWN de los dispositivos en el host
# luxadm -e port

- Determinar el Host Port WWN de la controladora en el host
# luxadm -e dump_map [Salida del luxadm -e port | /dev/cfg/c#] (donde
# es la controladora)

- Verificar el estado de los arrays
# cfgadm -al

- Determinar la relación entre las controladoras y el host
# luxadm probe
# luxadm probe -p (también muestra el path físico)

- Determinar los path físicos de las controladoras en el host
# luxadm display [Disco]

- Mostrar las LUNs de un Host en Solaris
# cfgadm -al -o show_FCP_dev (Solaris 8 and S10)
# cfgadm -al -o show_SCSI_LUN (Solaris 10)

- Muestra el path de los dispositivos en formato non-STMS a STMS si el
STMS esta habilitado (Multipath MPxIO).
# stmsboot -L

Nuevos comandos para la administracion de HBAs (fcinfo, mpathadm)
# fcinfo hba-port
# fcinfo hba-port -l
# fcinfo remote-port -slp 10000000c9327592
Remote Port WWN: 50060160082006e2

# mpathadm list mpath-support
mpath-support: libmpscsi_vhci.so

# mpathadm list initiator-port
Initiator Port: 210000e08b8143e5
Initiator Port: 210100e08ba143e5
Initiator Port: iqn.1986-03.com.sun:
01:0003ba5489a1.478f6ec2,4000002a00ff

# mpathadm show initiator-port 210100e08ba143e5
Initiator Port: 210100e08ba143e5
Transport Type: Fibre Channel
OS Device File: /devices/pci@1d,700000/SUNW,qlc@1,1/fp@0,0

# mpathadm show lu /dev/rdsk/c9t600C0FF000000000005DBC6286622D0Ed0s2
Logical Unit: /dev/rdsk/c9t600C0FF000000000005DBC6286622D0Ed0s2
mpath-support: libmpscsi_vhci.so
Vendor: SUN
Product: StorEdge 3510
Revision: 413C
Name Type: unknown type
Name: 600c0ff000000000005dbc6286622d0e
Asymmetric: no
Current Load Balance: round-robin
Logical Unit Group ID: NA
Auto Failback: on
Auto Probing: NA

Paths:
Initiator Port Name: 210000e08b8143e5
Target Port Name: 216000c0ff805dbc
Override Path: NA
Path State: OK
Disabled: no

Target Ports:
Name: 216000c0ff805dbc
Relative ID: 0

Zonas en Solaris 10



Una nueva Zona en Solaris 10.

Crear Directorio donde se almacenarán los archivos de la Zona
# mkdir -p /Zones/gm
# chmod 700 /Zones/gm
# ls -ld /Zones/gm
drwxr-xr-x 2 root root 512 Jul 5 07:08 /Zones/gm

Crear la zona usando zonecfg
# zonecfg -z gm

gm: No such zone configured
Use 'create' to begin configuring a new zone
zonecfg:gm> create
zonecfg:gm> set zonepath=/Zones/gm
zonecfg:gm> add net
zonecfg:gm:net> set address=192.168.100.14
zonecfg:gm:net> set physical=hme0
zonecfg:gm:net> end
zonecfg:gm> set autoboot=true
zonecfg:gm> info
zonepath: /Zones/gm
autoboot: true
pool:
inherit-pkg-dir:
dir: /lib
inherit-pkg-dir:
dir: /platform
inherit-pkg-dir:
dir: /sbin
inherit-pkg-dir:
dir: /usr
net:
address: 192.168.100.14
physical: hme0
zonecfg:gm> verify
zonecfg:gm> commit
zonecfg:gm> exit

Ahora hay que instalar la zona con el comando zoneadm
# zoneadm -z gm install

Preparing to install zone .
Creating list of files to copy from the global zone.
Copying <2574> files to the zone.
Initializing zone product registry.
Determining zone package initialization order.
Preparing to initialize <914> packages on the zone.
Initializing package <535> of <914>: percent complete: 58%

La instalación demora de 10-15 minutos.

Initialized <914> packages on zone.
Zone is initialized.
Installation of these packages generated warnings:
The file contains a log of the zone installation.

La zona está instalada. Ahora a boot

# zoneadm -z gm boot

Por ultimo hay que loggearse en la zona con la opción -C
# zlogin -C gm


[Connected to zone 'gm' console]

Select a Language
0. English
1. fr
Please make a choice (0 - 1), or press h or ? for help: 0

Select a Locale
0. English (C - 7-bit ASCII)
1. Belgium-Flemish (ISO8859-1)
2. Belgium-Flemish (ISO8859-15 - Euro)
3. Great Britain (ISO8859-1)
4. Great Britain (ISO8859-15 - Euro)
5. Ireland (ISO8859-1)
6. Ireland (ISO8859-15 - Euro)
7. Netherlands (ISO8859-1)
8. Netherlands (ISO8859-15 - Euro)
9. Go Back to Previous Screen
Please make a choice (0 - 9), or press h or ? for help: 0

What type of terminal are you using?
1) ANSI Standard CRT
...
12) X Terminal Emulator (xterms)
13) CDE Terminal Emulator (dtterm)
14) Other

Escoger la opción que se ajusta a la utilizada

Creating new rsa public/private host key pair
Creating new dsa public/private host key pair

Listo.!